Formatted CSV output on Linux shell

If you want to output a CSV file on Linux shell, you could just open it with less, cat or nano (un-formatted CSV output): $> less mydummyfile.csv $> cat mydummyfile.csv $> nano mydummyfile.csv The problem with this approach is, that you will get an unformatted ugly chunk of characters like that: A much better way is it, […]

Lock shellscript process under Unix based systems

Today I ran again into a common problem when dealing with cron based scipts that run concurrently. That’s why I had to lock shellscript process until it is finished before starting the next executing round. On Unix based systems like Linux you can achieve that with flock. flock binds a file descriptor to a certain lock […]

Get your public IP via shell

To get your public IP you can use websites like www.whatismypublicip.com/ or just google for it (http://lmgtfy.com/?q=public+ip) But you can also get your public IP via the following Linux shell  command (the smart way :-D): $> curl ifconfig.me/all This gives you an output like that: ip_addr: 31.18.198.134 remote_host: ip123456.dynamic.kabel-deutschland.de user_agent: curl/7.35.0 port: 47745 lang: connection: keep_alive: encoding: […]

Run a DynDNS client under Raspbian

For a home automation project I have to setup a local DynDNS client on my Banana Pi running with Raspian. Here are the steps I’ve taken to run a DynDNS client under Raspbian (will work on other Debian based Linux distributions too): Install ddclient package: $>sudo apt-get install ddclient This command installs the package and starts the DynDNS […]

Xubuntu – Fix black screen after wakeup from suspend mode

On Xubuntu 14.04.3 LTS I got a black screen after wakeup the machine from suspend mode. This didn’t happen all the time. It was more of a sporadic phenomenon happening after entering the credentials to unlock the machine. Under these circumstances the screen got black and the machine didn’t react on any actions any more. I could got to […]

Deleting multiple lines with nano

That’s not as easy as you might think with nano. Mainly because of the stage keystroke-philosophy of nano. Here is the way I cut out multiple lines, whole paragraphs or also huge text blocks with nano (Xubuntu 14.04, MacOS X 10.9.5). Open file in nano: $> nano -c textFileToEdit.txt -c shows line-numbers. Alternatively you can press […]

Change shell keymap for Arch Linux or Ubuntu (Debian)

To switch you shells keymap on Arch Linux or Ubuntu to another language you can use localectl. You can print the actual settings with the following command: $> localectl status To get a list of possible keymaps use: $> localectl list-keymaps And finally you can set the respective keymap with (de-QUERZ layout in this example): $> […]