blob: 97791605d9b64d7aed9a78a5371cfc649c48da85 (
plain) (
tree)
|
|
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=100000000
HISTFILESIZE=1000000000
shopt -s checkwinsize
function upload () {
chmod 0644 "$1"
sftp -b- upload@upload <<< "put '$1' www/`[ '$2'x = x ] && echo $1 || echo $2`"
}
function mcd () {
mkdir -p $@ && cd $@
}
function ocd () {
cd $OLDPWD
}
function atoi () {
# Returns the integer representation of an IP arg, passed in ascii dotted-decimal notation (x.x.x.x)
IP=$1
IPNUM=0
for (( i=0 ; i<4 ; ++i )); do
((IPNUM+=${IP%%.*}*$((256**$((3-${i}))))))
IP=${IP#*.}
done
echo $IPNUM
}
function itoa () {
# returns the dotted-decimal ascii form of an IP arg passed in integer format
echo -n $(($(($(($((${1}/256))/256))/256))%256)).
echo -n $(($(($((${1}/256))/256))%256)).
echo -n $(($((${1}/256))%256)).
echo $((${1}%256))
}
export QT_QPA_PLATFORMTHEME=qt5ct
alias gdb="gdb -q"
alias x11vnc="x11vnc -repeat -multiptr"
alias digs="dig +nocomments +noquestion +nostats +norrcomments +nocmd"
alias nc="nc -v"
alias m=make
alias torbrowser="while read a; do export $a; done < /etc/env.d/99torbrowser && torbrowser"
alias n="git --git-dir=$HOME/projects/n --work-tree=/"
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
color_prompt=yes
if [ "$color_prompt" = yes ]; then
PS1='\[\033[00;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[35m\][\[\033[33m\]$?\[\033[35m\]]\[\033[31m\]\$\[\033[00m\] '
else
PS1='\h:\w[$?]\$ '
fi
unset color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias l='ls -lah --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
[ -f ~/.bash_aliases ] && . ~/.bash_aliases
[ -f ~/.private_source ] && . ~/.private_source
. <(locale)
for l in `locale`
do
export `cut -d= -f1 <<<$l`
done
|