function for opening tmux and added units to maillog

main
Thomas Ba. 4 years ago
parent b877c898bf
commit 0f5a13cfbf

@ -1,14 +1,9 @@
# aliases # aliases
alias ta='tmux -2 attach'
alias tmux='tmux -2'
alias cd..='cd ..' alias cd..='cd ..'
alias :q='exit' alias :q='exit'
alias e='vim' alias e='vim'
alias :e='vim' alias :e='vim'
alias j='java'
alias jj='java -jar'
alias jc='javac'
alias ll=' ls -al --group-directories-first' alias ll=' ls -al --group-directories-first'
alias c="clear" alias c="clear"
alias g='gcc -Wall -pedantic' alias g='gcc -Wall -pedantic'
@ -31,6 +26,21 @@ whothefuckisusingport() {
# functions # 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 () { function extract () {
if [ -f "$1" ] ; then if [ -f "$1" ] ; then
case "$1" in case "$1" in
@ -109,9 +119,6 @@ function printtime() {
function unix() { function unix() {
php -r "date_default_timezone_set('Europe/Berlin');echo date('Y-m-d, H:i:s',$1).PHP_EOL;" 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() cp_p()
{ {
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
@ -130,15 +137,6 @@ cp_p()
} }
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
} }
# lima-city
function limaftp() {
if [ $# -ne 2 ] ; then
echo "Usage: $0 <username> <password>"
return 2
fi
lftp -u "$1:$2" "$1.lima-ftp.de"
}
# systemctl # systemctl
command -v systemctl > /dev/null && { command -v systemctl > /dev/null && {

@ -4,7 +4,7 @@ stty ixoff -ixon
BROWSER='elinks' 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' alias chk-starttls='openssl s_client -starttls smtp -crlf -connect'
function dist_file { function dist_file {

Loading…
Cancel
Save