CLI

Autosave for VIM

I believe that it’s a good idea that vi does not auto save during editing. Think of config files or src files that should never be in an inconsistent state. The programmer or sysadmin should decide when he wants to save data. But sometime auto save is handy, while typing lists like todo lists or …

Autosave for VIM Read More »

Wget Ignores its Timeout

Problem: wget has an option to configure the timeout for dns, connect, and read or a combined timeout option “-T”. This option usually works, but it does not work during SSL handshake. You can test it with these commands: in one terminal start a dummy tcp service: nc -l 7777 and then try to connect to …

Wget Ignores its Timeout Read More »

“dd” shows its progress

Problem: “dd” is a useful tool on linux. E.g. you can copy a disk image or wipe a disk, etc. But dd doesn’t show you any progress indicator, and you don’t know how long you have to wait until it has finished. Solution:   send signal USR1 to the dd process and it will show you how much data …

“dd” shows its progress Read More »

Howto generate an SSL key and self signed cert with openssl

For SSH, HTTPS, TLS SMTP,POPS, IMAPS you need a RSA key pair. Most Linux package installers produce this pairs automatically, but if you like, you can generate them yourself. The quickest method I found is: openssl req -x509 -nodes -newkey rsa:2048 -keyout servername.key -out servername.crt -days 1024 This command asks you some questions. The most …

Howto generate an SSL key and self signed cert with openssl Read More »

Unix/Linux date command fails when calculating “yesterday”

Problem: A shell-script running every day short after midnight doesn’t work properly once per year after daylight-saving time adjustment. e.g. an expected logfile is missing (“somefile.YYYYMMDD.log”) Discussion: The Unix date command calculates the wrong date when used with “–date yesterday” on the day after daylight-saving time adjustment. # date Mon Mar 31 00:15:03 CEST 2014 # date …

Unix/Linux date command fails when calculating “yesterday” Read More »

Mysql “Select” Output Turned Arround

When you have a mysql table with lot’s of attributes, it’s hard to read the output of a statement like this in mysql: select * from table limit 1; The data is folded very ugly. Easy Solution: select * from table limit 1 \G Mysql is showing one “Fieldname: Value” per line.