usefulfor.com/nothing

If it doesn’t fit anywhere else, it’s in /nothing
Options:

Archive for the ‘Shell Script’ Category

Every now and then I need to send by email some file to a friend or coworker or even myself. I have found that the easiest way to do this is just having a shell script that do the hard work for you.
After some research I found a set of scripts that actually do what [...]

matar: bloodlust

Here is a tiny script that can be usefull to terminate (kill -9) all the programs which contain a certain string (i.e.: kill all the running copies of ping).
#!/bin/bash

for foo in `ps aux | grep $1 | awk ‘{print $2}’`; do kill -9 $foo; done
Just run: matar <program name> and that’s it. They are [...]

replace spaces in filename

Just a quick tip!
You have to use the bash function ${foo//string1/string2}. Check the Advanced Bash-Scripting Guide for a complete list of string manipulating functions.
for foo in *; do mv "$foo" ${foo// /_}; done

Much in the way we did with xfce here is the way to implement de auto change feature in KDE.
This is an easy one. Although you can perform background auto change from KDE control center, it may be usefull to have a script to do the task. You can use this script to create a [...]

qmail queue size

qmail is one of the most popular MTA’s in the world. I am addicted to it since I found lifewithqmail.org, an step-by-step guide on installing qmail.
There are some tools that let you work with qmail’s queue (qmail-qread, qmHandle, etc.), but none of them gives you an idea of the amount of data queued for sending. [...]

Finally I have bought an UPS. Its the MGE Pulsar Ellipse 1200. I have chosen MGE because of their support to the open source community (mge opensource). You can connect up to four standard computers to this UPS, it’s perfect for my home network.

What I want to do is to be able to shut down [...]

We need three files for this:

signature.txt: you should point your mail client to this one
signature.tpl: here is the common text to display, something like “xmms is now playing:“
signature.sh: the script first copies the contents of the template file to the final signature file, and then adds the current song as a new line.

First of all check Xfce 4 Desktop Manager help. Click on the New list… button and create a list with all the backgrounds you want to rotate.
From this page:
To refresh the backdrop with a new random image from the list just run the xfdesktop command again, e.g. from a terminal or the run dialog, or [...]