Check These Out
I usually have 5 or more ssh connections to various servers, and putting this command in my .bash_profile file makes my putty window or x terminal window title change to this easily recognizable and descriptive text. Includes the username, group, server hostname, where I am connecting from (for SSH tunneling), which device pts, current server load, and how many processes are running.
You can also use this for your PROMPT_COMMAND variable, which updates the window title to the current values each time you exec a command.
I prefix running this in my .bash_profile with
$ [[ ! -z "$SSH_TTY" ]] &&
which makes sure it only does this when connecting via SSH with a TTY.
Here's some rougher examples from http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
$ # If set, the value is executed as a command prior to issuing each primary prompt.
$ #H=$((hostname || uname -n) 2>/dev/null | sed 1q);W=$(whoami)
$ #export PROMPT_COMMAND='echo -ne "\033]0;${W}@${H}:${PWD/#$HOME/~} ${SSH_TTY/\/dev\//} [`uptime|sed -e "s/.*: \([^,]*\).*/\1/" -e "s/ //g"`]\007"'
$ #PROMPT_COMMAND='echo -ne "\033]0;`id -un`:`id -gn`@`hostname||uname -n 2>/dev/null|sed 1q` `command who -m|sed -e "s%^.* \(pts/[0-9]*\).*(\(.*\))%[\1] (\2)%g"` [`uptime|sed -e "s/.*: \([^,]*\).*/\1/" -e "s/ //g"` / `command ps aux|wc -l`]\007"'
$ #[[ -z "$SSH_TTY" ]] || export PROMPT_COMMAND
$ #[[ -z "$SSH_TTY" ]] && [[ -f /dev/stdout ]] && SSH_TTY=/dev/stdout
And here's a simple function example for setting the title:
$ function set_window_title(){ echo -e "\033]0; ${1:-$USER@$HOST - $SHLVL} \007"; }
Installs pip packages defining a proxy
Really useful for when you have a typo in a previous command. Also, arguments default to empty so if you accidentally run:
$ echo "no typozs"
you can correct it with
$ ^z
Access a random news web page on the internet.
The Links browser can of course be replaced by Firefox or any modern graphical web browser.
Shorter version, works with multiple words.
Like top, but for files
Trace python statement execution and syscalls invoked during that simultaneously
The crypt function takes a password, key, as a string, and a salt character array which is described below, and returns a printable ASCII string which starts with another salt. It is believed that, given the output of the function, the best way to find a key that will produce that output is to guess values of key until the original value of key is found.
from http://en.wikipedia.org/wiki/Crypt_(Unix)
This prints a summary of your referers from your logs as long as they occurred a certain number of times (in this case 500). The grep command excludes the terms, I add this in to remove results Im not interested in.