Blog

  • postconf

    postconf allow you to list/change postfix configuration.

    To list current config, run

    postconf -n
    

    To change a configuration, run

    postconf -e home_mailbox=Maildir/
    

    postfix

  • Amazon Workmail Review

    Amazon Workmail is business email hosting like Google G Suite, Office 365, etc..

    https://aws.amazon.com/workmail/

    Workmail cost $4 per user, comes with 50 GB storage.

    It come with all normal access modes like IMAP, POP3, etc..

    Webmail is basic with contacts and Calendar.

    Configuring WorkMail

    You can find instructions to configure email clients at

    https://docs.aws.amazon.com/workmail/latest/userguide/clients.html

    For IMAP/SMTP, see

    https://docs.aws.amazon.com/workmail/latest/userguide/using_IMAP.html

    SMTP works with phpmailer, so you can use it with your website to send emails.

    What is WorkMail webmail URL?

    You can find the Amazon WorkMail webmail URL at

    Amazon WorkMail > Organizations 
    

    Amazon Workmail

    Since i am used to Google G Suite, it feel little hard for me to use.

    One thing i noticed is when i sent email, i used to type recipient email address, press tab, enter subject, tag again, type message. This is the workflow i am used to in Google G Suite. When i try same in Amazon Workmail, it did not work because there are too many elements on the compose email screen and i have to press TAB multiple times to get into subject or body field.

    Amazon Workmail Compose

    All the marked elements here force you to press TAB. After enter recipient, you need to press TAB 3 times to get into subject field, again TAB 4 times before you can start wring the message.

    To get to compose, you need to click “New Item” then select “New email” from drop down menu. That is lot of wasted time on a Mail application where primary purpose is to sent and receive emails. It will be better to have a “Compose” or “New email” button like most other email providers, make easy for users.

    I don’t think i can compare it with Google G Suite as it come with much more features like Google Drive, Documents and many more. But for business use, many of these may not required, it depends on the business.

    aws

  • Install Docker on Ubuntu

    To install Docker on Ubuntu, run

    apt install docker.io

    Add your user in docker group

    sudo usermod -aG docker YOUR_USER_NAME

    Back to Docker

  • portainer – Web based UI for Docker

    Portainer is a web based UI for managing docker.

    https://portainer.io

    You can run it with command

    docker volume create portainer_data
    docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

    Now login to portainer with url

    http://YOUR_SERVER_IP:9000

    Portainer  Docker Control Panel

    docker

  • swap

    First create a 2 GB file

    dd if=/dev/zero of=/swapfile bs=1M count=4096
    

    For 8 GB, use count=8192. You can also use fallocate command instead of dd.

    fallocate -l 8G /swapfile
    

    Make it swap

    mkswap /swapfile
    chmod 0600 /swapfile
    swapon /swapfile
    

    Add it to /etc/fstab

    echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
    

    swapon

  • Apache Invalid command Header

    On a new Debian server with Apache, web site give 500 internal server error.

    On checking error log, i found

    [Thu Jan 04 06:44:42.483932 2018] [core:alert] [pid 27583] [client 112.133.248.19:63020] /home/user/public_html/.htaccess: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

    The error is due to Apache headers module not installed on the server.

    To fix, run

    a2enmod headers
    

    Restart Apache

    systemctl restart apache2
    

    Apache

  • Radio

    http://libretime.org/

    allow you to run your own radio station. It allow you to manage you media, playlists. It support IceCast and Shutcast as media servers.

  • Ubuntu point all .test domains to 127.0.0.1

    Until recently .dev was popular TLD used by developers for local web development. Recently google acquired the rights to use .DEV domain name extension and forced SSL for this LTD in google chrome.

    Web developers are looking for alternate home for their local development web sites. Some suggested .localhost as development LTD, but it is too large. Another option is .test, this is a reserved LTD, so you won’t be forced to leave and is short. So many opted for .test as local development domain extension.

    DNSMasq allow you to point *.test domains to 127.0.01, so you don’t have to edit /etc/hosts and add each domain you need for local development.

    To do this, create file

    vi /etc/NetworkManager/dnsmasq.d/test
    

    Add following

    address=/.test/127.0.0.1
    

    Restart network-manager.

    service network-manager restart
    

    We restarted network-manager as dnsmasq is started by Network Manager.

    root@hon-pc-01:~# pstree -sp $(pidof dnsmasq)
    systemd(1)───NetworkManager(11557)───dnsmasq(11594)
    root@hon-pc-01:~#

    dnsmasq

  • certbot certificates

    To list all letsencrypt SSL certificates, run

    certbot certificates
    

    Example

    root@ok:~# certbot certificates
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Revocation status for /etc/letsencrypt/live/boby.hosthat.com/cert.pem is unknown
    
    -------------------------------------------------------------------------------
    Found the following certs:
      Certificate Name: boby.hosthat.com
        Domains: boby.hosthat.com
        Expiry Date: 2017-06-11 15:10:00+00:00 (INVALID: EXPIRED)
        Certificate Path: /etc/letsencrypt/live/boby.hosthat.com/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/boby.hosthat.com/privkey.pem
      Certificate Name: img.serverok.in
        Domains: img.serverok.in
        Expiry Date: 2018-05-02 16:06:53+00:00 (VALID: 66 days)
        Certificate Path: /etc/letsencrypt/live/img.serverok.in/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/img.serverok.in/privkey.pem
      Certificate Name: lab.hostonnet.com
        Domains: lab.hostonnet.com
        Expiry Date: 2018-04-25 03:34:37+00:00 (VALID: 59 days)
        Certificate Path: /etc/letsencrypt/live/lab.hostonnet.com/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/lab.hostonnet.com/privkey.pem
      Certificate Name: yboby.cf
        Domains: yboby.cf www.yboby.cf
        Expiry Date: 2018-03-21 19:43:49+00:00 (VALID: 25 days)
        Certificate Path: /etc/letsencrypt/live/yboby.cf/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/yboby.cf/privkey.pem
    -------------------------------------------------------------------------------
    root@ok:~# 
    

    letsencrypt

  • Syntax error or access violation: 1071 Specified key was too long

    When running database migration in a new larvel project, i get following error

    boby@hon-pc-01:~/www/proxy (master)$ php artisan migrate

    In Connection.php line 664:

    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))

    In Connection.php line 458:

    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

    boby@hon-pc-01:~/www/proxy (master)$

    This is due to recent change in Lavral, that changed default charset to utf8mb4.

    To fix this error, open file

    vi app/Providers/AppServiceProvider.php
    

    Find

    use Illuminate\Support\ServiceProvider;
    

    Add below

    use Illuminate\Support\Facades\Schema;
    

    Find

        public function boot()
        {
            //
        }
    

    Replace with

        public function boot()
        {
            Schema::defaultStringlength(191);
        }