Check These Out
the "delay" utility is an invaluable tool for me. with gnu-screen it allows you to schedule something and have it run and output to the current terminal, unlike "at".
You can also use it like "sleep" with seconds and also with date:
delay until 13:33 friday && echo test
get it from: http://onegeek.org/~tom/software/delay/current/delay.c
(author: Tom Rothamel)
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Limits the usage of bandwidth by apt-get, in the example the command will use 30Kb/s ;)
It should work for most apt-get actions (install, update, upgrade, dist-upgrade, etc.)
This normalizes volume in your mp3 library, but uses mp3gain's "album" mode. This applies a gain change to all files from each directory (which are presumed to be from the same album) - so their volume relative to one another is changed, while the average album volume is normalized. This is done because if one track from an album is quieter or louder than the others, it was probably meant to be that way.
$ # 4 cores with 2500 pi digits
$ CPUBENCH 4 2500
$.
$ every core will use 100% cpu and you can see how fast they calculate it.
$ if you do 50000 digitits and more it can take hours or days
the --time-style argument to 'ls' takes several possible modifiers: full-iso, long-iso, iso, locale, +FORMAT.
The +FORMAT modifier uses the same syntax as date +FORMAT.
--time-style=+"%Y-%m-%d %H:%M:%S" strikes a happy medium between accuracy and verbosity:
$ ls -lart --time-style=long-iso
doesn't show time down to the nearest second,
$ ls -lart --time-style=full-iso
displays time to 10E-9 second resolution, but with no significant digits past the full seconds, also showing the timezone:
$ -rw-r--r-- 1 bchittenden bchittenden 0 2011-02-10 12:07:55.000000000 -0500 bar
Send microphone audio to another computer using netcat and arecord.
Connect to the stream using "nc [other ip] 3333|aplay"
You can set up two-way communication by piping audio the reverse direction on another port:
Machine #1:
$arecord -D hw:0,0 -f S16_LE -c2|nc -l 3333 &;nc -l 3334|aplay
Machine #2:
$$ip=[machine1_ip];arecord -D hw:0,0 -f S16_LE -c2|nc $ip 3334 &;nc $ip 3333|aplay
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video).
$ cat /proc/acpi/video/VGA/LCD/brightness
to discover the possible values for your display.