diff --git a/zsh/commands b/zsh/commands index 79c563f..3c93985 100644 --- a/zsh/commands +++ b/zsh/commands @@ -1,14 +1,9 @@ # aliases -alias ta='tmux -2 attach' -alias tmux='tmux -2' alias cd..='cd ..' alias :q='exit' alias e='vim' alias :e='vim' -alias j='java' -alias jj='java -jar' -alias jc='javac' alias ll=' ls -al --group-directories-first' alias c="clear" alias g='gcc -Wall -pedantic' @@ -31,6 +26,21 @@ whothefuckisusingport() { # functions +function tm() { + NUM="$(\tmux ls 2>/dev/null|wc -l)" + if [ "$NUM" -eq 0 ] ; then + \tmux -2 + elif [ "$NUM" -eq 1 ] ; then + \tmux -2 attach + else + echo "Found more than one tmux session!" + \tmux ls + echo -n "Which session do you want to attach to? " + read CHOICE + \tmux -2 attach -t "$CHOICE" + fi +} + function extract () { if [ -f "$1" ] ; then case "$1" in @@ -109,9 +119,6 @@ function printtime() { function unix() { php -r "date_default_timezone_set('Europe/Berlin');echo date('Y-m-d, H:i:s',$1).PHP_EOL;" } -function 0l3() { - curl "http://0l3.de/api/create.plain/$1" -} cp_p() { strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ @@ -130,15 +137,6 @@ cp_p() } END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 } -# lima-city - -function limaftp() { - if [ $# -ne 2 ] ; then - echo "Usage: $0 " - return 2 - fi - lftp -u "$1:$2" "$1.lima-ftp.de" -} # systemctl command -v systemctl > /dev/null && { diff --git a/zsh/commands-server b/zsh/commands-server index 3aaddb9..23139cc 100644 --- a/zsh/commands-server +++ b/zsh/commands-server @@ -4,7 +4,7 @@ stty ixoff -ixon BROWSER='elinks' -alias maillog='sudo journalctl -u dovecot -u postgrey -u postfix -u opendkim' +alias maillog='sudo journalctl -u dovecot -u postgrey -u postfix -u opendkim -u opendmarc -u policyd-spf' alias chk-starttls='openssl s_client -starttls smtp -crlf -connect' function dist_file {