Code: Select all
function pac() { links https://packages.debian.org/en/sid/"$@" ;}
function bug() { links http://bugs.debian.org/"$@" ;}
bug <packagename> opens the bug tracker. For those who don't have apt-listbugs.
Code: Select all
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
Code: Select all
function encode() { echo -n $@ | perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'; }
function goo() { links http://www.google.com/search?q="`encode $@`" ;}
function wikide() { links http://de.wikipedia.org/w/index.php?search="`encode $@`" ;}
function wikien() { links http://en.wikipedia.org/w/index.php?search="`encode $@`" ;}
function wikihu() { links http://hu.wikipedia.org/w/index.php?search="`encode $@`" ;}
A classic:
Code: Select all
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
}
function marks {
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
}