Mac OS - bashrc / homebrew - random notes

Posted on Sun 26 June 2016 in OSX • Tagged with Bash, OSX, notepad • 1 min read

bash-completion

if [ -f $(brew --prefix)/etc/bash_completion ]; then
    source $(brew --prefix)/etc/bash_completion
fi

generic colouriser

example - colour

if [ -f $(brew --prefix)/etc/grc.bashrc ]; then
    source $(brew --prefix)/etc/grc.bashrc
fi

spotlight for cmd

spotlight () { mdfind "kMDItemDisplayName == '$@'wc"; }

How to delete a command from the bash history / Hide an command from the bash history

Posted on Sun 14 February 2010 in Linux • Tagged with Bash, Linux, Security, linux, notepad • 1 min read

Hide an command from the bash history:
Start a terminal and try

wget user:passwd@ftp.example.com/secret.tar.gz; kill -9 $$;

Now you can check your history ;)

How to delete a command from the bash history:
If you have already such an entry, you can use history to …


Continue reading

Don't try this at home - root shell Russian roulette

Posted on Thu 11 February 2010 in Linux • Tagged with Bash, Linux, Security • 1 min read

Don't try this at home!

[ $[$RANDOM%6] = 0 ] || rm -rf /;

Unless you really know what you are doing.