You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.1 KiB
65 lines
2.1 KiB
if [ "$(uname)" != "Darwin" ] ; then
|
|
eval "$(gnome-keyring-daemon --start --daemonize --components=pkcs11,secrets,ssh,gpg)"
|
|
export SSH_AUTH_SOCK
|
|
export GPG_AGENT_INFO
|
|
fi
|
|
|
|
# aliases
|
|
|
|
alias fuckflash='mplayer `\ls -lv /proc/$(pgrep -nf plugin)/fd/* | grep Fl | awk "{print \\$9;}" | tail -n 1`'
|
|
alias dumpflash='mplayer `\ls -lv /proc/$(pgrep -nf plugin)/fd/* | grep Fl | awk "{print \\$9;}" | tail -n 1` -dumpstream -dumpfile'
|
|
alias o='okular'
|
|
alias mg="history|egrep '( m )|( m6 )'|grep -v grep|tail"
|
|
alias m6='mplayer -channels 6'
|
|
alias m='mplayer'
|
|
alias p='mirage'
|
|
alias flash=' clive --stream-exec="mplayer -really-quiet %i" --stream=10'
|
|
alias speed='xmodmap ~/.speedswapper'
|
|
|
|
|
|
function mac() {
|
|
if [ ! $# -eq 2 ] ; then
|
|
echo "Usagen: $0 <interface> <mac>"
|
|
fi
|
|
MAC="$2"
|
|
if [ "$(echo "$MAC"|sed -rn '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/p'|wc -l)" -eq 1 ] ; then
|
|
sudo su -c "ifconfig $1 down;ifconfig $1 hw ether '$MAC';ifconfig $1 up"
|
|
else
|
|
echo no valid mac!
|
|
fi
|
|
}
|
|
function offlineimap-solve-uuid-problem() {
|
|
if [ $# -ne 2 ] ; then
|
|
echo "Usage:"
|
|
echo " $0 <account> <folder>"
|
|
fi
|
|
ACCOUNT="$1"
|
|
FOLDER="$2"
|
|
FOLDER2="$(echo $FOLDER|tr '.' '/')"
|
|
if [ -d ".Maildir/$ACCOUNT/$FOLDER2" -a -f ".offlineimap/Account-$ACCOUNT/LocalStatus-sqlite/$FOLDER" -a -f ".offlineimap/Repository-$ACCOUNT-local/FolderValidity/$FOLDER" ] ; then
|
|
rm -rv \
|
|
".Maildir/$ACCOUNT/$FOLDER2" \
|
|
".offlineimap/Account-$ACCOUNT/LocalStatus-sqlite/$FOLDER" \
|
|
".offlineimap/Repository-$ACCOUNT-local/FolderValidity/$FOLDER"
|
|
else
|
|
echo "File or folder not found!"
|
|
fi
|
|
}
|
|
|
|
# ssh to the server a user in located on and change to his directory
|
|
function userssh() {
|
|
if [[ "$1" =~ "^[a-z][a-z0-9-]+[a-z0-9]$" ]] ; then
|
|
SERVER="$(curl -Ss "https://$LIMA_API_KEY@www.lima-city.de/internal_api/users/$1/placement"|jq -r '.user.placement')"
|
|
if [ "$SERVER" = "null" ] ; then
|
|
echo 'Invalid username!'
|
|
else
|
|
echo "Connecting to server $SERVER.trafficplex.de ..."
|
|
ssh "$SERVER.trafficplex.de" -t "cd /mnt/webhosting/$1/; exec \$SHELL --login"
|
|
fi
|
|
else
|
|
echo 'Invalid username!'
|
|
fi
|
|
}
|
|
|
|
# vim: ft=zsh :
|