Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • Mads Madsen 10:29 on November 12, 2020 Permalink | Reply
    Tags: aws, docker   

    Run aws lambda locally 

    Create simple Dockerfile:

    The above Dockerfile is for nodejs lambdas, check for more docker images.

    Build the above docker image:

    Run the docker image:

  • Mads Madsen 10:42 on September 10, 2020 Permalink | Reply
    Tags: bash, environment, export   

    Export environment variables without exposing them to command history 

    Environment file example:

    Export command:

  • Mads Madsen 18:51 on April 7, 2019 Permalink | Reply
    Tags: ,   

    Permission denied (publickey). fatal: Could not read from remote repository. 

    On mac os, fix:

  • Mads Madsen 13:16 on April 6, 2019 Permalink | Reply

    Git Error: Could could not read Username for ‘’: terminal prompts disabled 

    If you have enabled 2FA on github, you can no longer use https:// in the terminal, run the command below, to always force ssh when trying to access github from the terminal.

  • Mads Madsen 13:30 on February 16, 2019 Permalink | Reply
    Tags: , Pi zero, Raspberry PI   

    Rename default pi user 

    After installing Raspbian Lite on a Raspberry PI, the default user pi is a liability. To fix this, a possibility is to create a new user and delete the old pi user, but I like recycling, so I’ll just rename the user.

    First we need to allow root login over ssh;

    1. Add PermitRootLogin yes to /etc/ssh/sshd_config
    2. Change the password of the root user $ sudo passwd root
    3. Restart ssh $ sudo service ssh restart

    Second login to the raspberry with root and execute the following;

    1. Kill all processes started by pi
      1. $ pkill -u pi
      2. $ pkill -9 -u pi
    2. $ usermod -l new_username pi
    3. $ groupmod -n new_username pi
    4. $ usermod -d /home/new_username new_username
    5. Remove PermitRootLogin yes from /etc/ssh/sshd_config
    6. Remove the root password $ passwd -d root
    7. Restart the raspberry pi $ reboot

  • Mads Madsen 01:44 on June 18, 2017 Permalink | Reply
    Tags: , rsyslog   

    Make rsyslog log a specific program into its own log file and stop logging into syslog 

  • Mads Madsen 09:58 on June 15, 2017 Permalink | Reply
    Tags: npm, scope   

    Setup NPM to use a private registry for scoped packages 


  • Mads Madsen 11:34 on October 23, 2014 Permalink | Reply

    Get Last Day of the Month in Python 

  • Mads Madsen 17:07 on March 26, 2014 Permalink | Reply
    Tags: android, disable 2g, force 3g, force 4g, kitkat   

    Force 3G or 4G Android Kitkat 4.4 

    In the dialer type in *#*#4636#*#*.

    Go to Phone information and scroll down to ‘Set preferred network type’ and set it to ‘LTE/CDMA’.
    And now your phone will not try to connect to EDGE/2G.

    Note this mode completely disables GSM/EDGE/2G so when the phone is out of reach from a 3G tower, you will not be able to make phone calls. In this case just switch back to a GSM mode.

  • Mads Madsen 09:26 on March 18, 2014 Permalink | Reply

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc