Waiting for server to accept SSH connections

Sometimes you need to wait for a just booted server to accept SSH connections. This can be solved with a one-line bash script: until nc -w 10 -z $SERVER_IP 22; do echo "SSH not available" && sleep 5; done

October 22, 2016 · 1 min

npm install fails with "npm ERR! tar.unpack untar error"

Problem npm failed randomly while installing packages. It didn’t matter which packages or if running on Debian itself or inside virtual machines using Ubuntu (vagrant). Upgrading npm to the latest version (sudo npm install -g npm@latest ) and clearing npm’s cache (npm cache clean ) didn’t help either. After examining the downloaded temporary packages in /tmp I realized that they were corrupt. The corrupt packages changed randomly on every download attempt....

April 25, 2016 · 2 min

Simulate the environment of Cron Jobs

Often you will find yourself in the situation that one of your cron jobs works perfectly if you execute it manually but fails as soon as is gets executed by cron. The root cause might be the different environment. To simulate the environment of a cron job add the following entry to your crontab using crontab -e. This will create the file cronenv in your root directory and dump all available environment variables into it....

March 21, 2016 · 1 min

Ubuntu: Mount encrypted home directory

After changing harddrives I needed to transfer some files from the old harddrive which had an encrypted home directory. The command sudo ecryptfs-recover-private did not work: sudo ecryptfs-recover-private /home/.ecryptfs/user/.ecryptfs/ INFO: Found [/home/.ecryptfs/user/.ecryptfs/]. Try to recover this directory? [Y/n]: INFO: Found your wrapped-passphrase Do you know your LOGIN passphrase? [Y/n] INFO: Enter your LOGIN passphrase... Passphrase: Inserted auth tok with sig [f7402d552edaa194] into the user session keyring mount: mount(2) failed: No such file or directory ERROR: Failed to mount private data at [/tmp/ecryptfs....

February 3, 2016 · 1 min

Gnome 3: Minimize, Maximize and Close on the left

gsettings set org.gnome.desktop.wm.preferences button-layout 'close,maximize,minimize,close:'

October 11, 2015 · 1 min

fix mouse pointer speed in Gnome 3.16

When upgrading to Gnome 3.16 you might find yourself in the situtation that your mouse pointer speed has changed. To revert this run the following command: /usr/bin/xset m default

July 3, 2015 · 1 min

PHP: Disable Xdebug for CLI

In most scenarios you won’t need Xdebug on your CLI. Also it is recommended to disable it if you use Composer . sudo php5dismod -s cli xdebug

February 10, 2015 · 1 min

Debian: get around maintenance shell asking for root password

Once in a while it might happen to you that you attempt to boot some Debian machine and some fsck errors occur. Debian will then present you a maintenance shell and ask for your root password. There are two options at this point: Enter your root password or hit CTRL-D to continue. Continuing will not resolve the problem as the fsck error needs to be fixed manually. If you don’t know your root password or you’re just to lazy to type in a 30 character string the following might help....

August 11, 2014 · 1 min

prevent TeamViewer from running on system startup

By default TeamViewer 9 starts its daemon on system startup, even if you won’t use TeamViewer in your current session. You can disable the daemon with the following command: sudo teamviewer --daemon disable In case you need TeamViewer the command teamviewer --daemon start will start the daemon.

January 20, 2014 · 1 min

php5-mcrypt not working after upgrade to Ubuntu 13.10

If you are using the php5-mcrypt library in your projects you might experience that it’s no longer working after you have upgraded Ubuntu to 13.10. You can fix this with the following three commands I have found on stackoverflow [1]: sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available sudo php5enmod mcrypt sudo service apache2 restart [1] http://stackoverflow.com/questions/19446679/mcrypt-not-present-after-ubuntu-upgrade-to-13-10

October 21, 2013 · 1 min