Check These Out
One of the first functions programmers learn is how to print a line. This is my 100% bash builtin function to do it, which makes it as optimal as a function can be. The COLUMNS environment variable is also set by bash (including bash resetting its value when you resize your term) so its very efficient. I like pretty-output in my shells and have experimented with several ways to output a line the width of the screen using a minimal amount of code. This is like version 9,000 lol.
This function is what I use, though when using colors or other terminal features I create separate functions that call this one, since this is the lowest level type of function. It might be better named printl(), but since I use it so much it's more optimal to have the name contain less chars (both for my programming and for the internal workings).
If you do use terminal escapes this will reset to default.
$ tput sgr0
For implementation ideas, check my
http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
Shows all block devices in a tree with descruptions of what they are.
I removed the dependency of the English language
This is meant for the bash shell. Put this function in your .profile and you'll be able to use tab-completion for sshing any host which is in your known_hosts file. This assumes that your known_hosts file is located at ~/.ssh/known_hosts. The "complete" command should go on a separate line as such:
function autoCompleteHostname() {
local hosts=($(awk '{print $1}' ~/.ssh/known_hosts | cut -d, -f1));
local cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=($(compgen -W '${hosts[@]}' -- $cur ))
}
complete -F autoCompleteHostname ssh
this creates a tree of your branch merges. very useful if you want to follow the features you add.
-vn removes tha video content, the copy option tells ffmpeg to use the same codec for generating the output
Particularly useful on OS X where netstat doesn't have -p option.
Using this command you can track a moment when usb device was attached.