Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Not all of these are original ideas, but these are commands I actually like :)
- cl()
- {
- # change directory then view its contents in one step
- if [ -z $2 ]
- then
- cd $1 && ls -lah
- else
- cd $1 && ls $2
- fi
- }
- fliptable() {
- # Taken from https://twitter.com/climagic/status/370595711483514880
- # Example usage:
- # gpg --verify file.sig file || fliptable
- echo "(╯°□°)╯ ┻━┻";
- }
- function fuck() {
- # Example usage: `fuck you java`
- killall -9 $2;
- if [ $? == 0 ]
- then
- echo
- echo " (╯°□°)╯︵$(echo $2|flip &2>/dev/null)"
- echo
- fi
- }
- banip() {
- if [ -z $1 ]
- then
- echo "Parameter not passed."
- else
- iptables -A INPUT -s $1 -j DROP
- iptables -A OUTPUT -d $1 -j DROP
- echo "$1 banned."
- #If you get an error, switch the comment out below
- #/etc/init.d/iptables save
- iptables-save
- fi
- }
- #usage: banip XX.XX.XX.XX
- # Blocks incoming and outgoing connections to a given IP or subnet
- function git-branch-name {
- git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
- }
- function git-branch-prompt {
- local branch=`git-branch-name`
- if [ $branch ]; then printf " [%s]" $branch; fi
- }
- PS1="\e[38;5;154m\u@\h\e[0m \[\033[0;36m\]\W\[\033[0m\]\[\033[0;32m\]\$(git-branch-prompt)\[\033[0m\] \$ "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement