Tag: bash

Running gcp.py from cron

On my backup server I run gcp.py from gdatacopier to backup my google docs. I had to fix two issues in order to get it to run from a bash script: – the PYTHONPATH had to be exported prior to running,…

Search and replace text in many files

This is a handy one liner that searches and replaces text in multiple files. (You can use find for example to run it in multiple folders) perl -pi -e ‘s/old_text/new_text/g’ *.conf This line replaces old_text with new_text in all the…

flac2mp3 conversion bash script

I recently started buying some music in flac format. Though I’m content on storing it as flac on my NAS I don’t like filling up my phone’s memory and also I have the impression that listening to flac uses more…

My fortune command line…

I take my bash profile very seriously 🙂 I use: fortune fortunes fortunes-o fortunes2 forunes2-o 30% startrek The above means to choose fortunes only from the 5 specified files and more it assures that I get startrek fortunes from time…

Force fsck on next reboot

Let’s say you run a headless server and you want to fsck the main partition. The easy solution in this case is (if possible) to force fsck to run on the next boot. If you run slackware than all you…