So, when you write a bash script that does a certain amount of tasks for you, but you don’t want the script to keep running after some command inside the script failed, simply add a line to the script.
Tag Archives: linux
Apply low priority to low priority processes
My transmission client was hogging my machine. Then I realized I never really use process priorities for CPU and/or IO, which is actually a pretty bad thing, considering some processes just are there to get some job done, but don’t need priority at all. Then I realized I also never use it for backup and [...]
Automate sudo nano; something I should’ve done a loooong time ago
Remember those countless times you’ve edited a file with nano, didn’t notice that you weren’t root at the time, and carefully made your configuration changes and saved the file, only to find out that you weren’t root and you have no rights to modify the file?
Password-less authentication SSH
I use this a lot, and you should too. It saves lots of time, but you should also be aware that password-less authentication (and it’s ease) imposes a security risk on your behalf. You should be very cautious when you’re connecting to the remote machines (whether they are testing, staging or production environments, in ascending [...]
Bash control structures have redirection too
I found out a useful thing today. You can redirect output of bash control structures as well. Typically useful for for loops, which would need a buffer of some kind otherwise to have it’s output sorted, for example.
How to restore grub with a live CD
I borked my primary boot device’s grub installation last week because I wanted to start Windows 7 to play some LAN games. Windows 7 wouldn’t boot from grub, so I thought I’d install a new grub version. I reinstalled grub before regenerating the config file and rebooted. Too bad the Arch packages don’t handle that [...]
Linux Devbox: Running multiple PHP versions
Ever since PHP5 came out, there is some need to run multiple PHP versions on your local development box, or at least make it easy to switch from one version to another. Derick Rethans has posted a solution based on your PATH environment variable. I have devised an alternative approach which changes the system wide [...]