Check These Out
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name.
i.e.: logfile.1.gz > logfile.2.gz
I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.
Uses pygmentize and python to create indented and colorized JSON output
If you want a password length longer than 6, changing the -c6 to read -c8 will give you 8 random characters instead of 6. To end up with a line-feed, use this with echo:
# echo `< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6`
Modern systems need higher strenght, so add some special characters:
# < /dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8
This should automatically mount it to /media/truecrypt1. Further mounts will go to /media/truecrypt2, and so on. You shouldn't need sudo/su if your permissions are right.
I alias tru='truecrypt' since tr and true are commands.
To explicitly create a mount point do: tru volume.tc /media/foo
To make sure an GUI explorer window (nautilus, et al) opens on the mounted volume, add: --explorer
To see what you currently have mounted do: tru -l
To dismount a volume do: tru -d volume.tc. To dismount all mounted volumes at once do: tru -d
Tested with Truecrypt v6.3a / Ubuntu 9.10
Use as: $ s host1
Will ssh to remote host upon first invocation. Then use C-a d to detatch. Running "s host1" again will resume the shell session on the remote host. Only useful in LAN environment. You'd want to start the screen on the remote host over a WAN.
Adapted from Hack 34 in Linux Server Hacks 2nd Addition.
This works more reliable for me ("cut -c 8-" had one more space, so it did not work)
Function to add a shebang to an existing script, handy if you forgot to add it in the first place.
This command is for UNIX OSes that have plain vanilla System V UNIX commands instead of their more functional GNU counterparts, such as IBM AIX.
Just refining last proposal for this check, showing awk power to make more complex math (instead /1024/1024, 2^20). We don't need declare variable before run lsof, because $(command) returns his output. Also, awk can perform filtering by regexp instead to call grep. I changed the 0.0000xxxx messy output, with a more readable form purging all fractional numbers and files less than 1 MB.