bashrc, zshrc: Add functions mkcd and gribble-gpg-everify

mkcd: Create the specified directory/-ies and change to the first one.
gribble-gpg-everify: Decrypt encrypted Bitcoin OTC from gribble and print everify command
This commit is contained in:
nyuszika7h 2012-04-24 16:30:37 +02:00 committed by Mika Suomalainen
parent 48a9e788b2
commit 4377a3a494
2 changed files with 43 additions and 9 deletions

27
bashrc
View File

@ -73,7 +73,7 @@ fi
unset color_prompt force_color_prompt unset color_prompt force_color_prompt
# Red colour for root, thanks nyuszika7h :D # Red colour for root, thanks nyuszika7h :D
# check if we're root # Check if we're root
if [[ $EUID == 0 ]]; then if [[ $EUID == 0 ]]; then
PS1='\033[1;31m\u@\h:\w\$\033[0m ' PS1='\033[1;31m\u@\h:\w\$\033[0m '
else else
@ -408,10 +408,27 @@ fi
} }
# Given by nyuszika7h. Shortens GitHub URLs with git.io # Given by nyuszika7h. Shortens GitHub URLs with git.io
gitio () { function gitio() {
curl -s -i http://git.io -F "url=$1" | grep curl -s -i http://git.io -F "url=$1" | grep --color=never -P '^Location: ' | awk '{ print $2 }'
--color=never -P '^Location: ' | awk '{ print $2 }' }
}
function mkcd() {
if [[ $# -gt 1 ]]; then
echo 'Warning: All directories will be created, but will change to first specified directory.' 1>&2
fi
mkdir -p "$*"
cd "$1"
}
function gribble-gpg-everify() {
# Set which command to use for gpg. You
# probably want to use gpg2 here.
local gpg=gpg2
read -r -i 'Enter Bitcoin OTC URL: ' REPLY
echo -n ';;everify '
lynx -hiddenlinks=ignore -dump $REPLY | $gpg --decrypt
}
##### Tmux (example) 4G2W9C ##### ##### Tmux (example) 4G2W9C #####

25
zshrc
View File

@ -353,10 +353,27 @@ fi
} }
# Given by nyuszika7h. Shortens GitHub URLs with git.io # Given by nyuszika7h. Shortens GitHub URLs with git.io
gitio () { function gitio() {
curl -s -i http://git.io -F "url=$1" | grep curl -s -i http://git.io -F "url=$1" | grep --color=never -P '^Location: ' | awk '{ print $2 }'
--color=never -P '^Location: ' | awk '{ print $2 }' }
}
function mkcd() {
if [[ $# -gt 1 ]]; then
echo 'Warning: All directories will be created, but will change to first specified directory.' 1>&2
fi
mkdir -p "$*"
cd "$1"
}
function gribble-gpg-everify() {
# Set which command to use for gpg. You
# probably want to use gpg2 here.
local gpg=gpg2
read -r -i 'Enter Bitcoin OTC URL: ' REPLY
echo -n ';;everify '
lynx -hiddenlinks=ignore -dump $REPLY | $gpg --decrypt
}
##### Tmux (example) 4G2W9C ##### ##### Tmux (example) 4G2W9C #####