summaryrefslogtreecommitdiffstats
path: root/root/.profile
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2023-02-11 20:26:52 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2023-02-11 20:26:52 +0100
commitdb6129f94261ad487462ac0ea1c1f222188031e0 (patch)
tree4b99b1e8b3c620025626b39c026f3f011902d064 /root/.profile
parentpkgs (diff)
downloadn-db6129f94261ad487462ac0ea1c1f222188031e0.tar
n-db6129f94261ad487462ac0ea1c1f222188031e0.tar.gz
n-db6129f94261ad487462ac0ea1c1f222188031e0.tar.bz2
n-db6129f94261ad487462ac0ea1c1f222188031e0.tar.lz
n-db6129f94261ad487462ac0ea1c1f222188031e0.tar.xz
n-db6129f94261ad487462ac0ea1c1f222188031e0.tar.zst
n-db6129f94261ad487462ac0ea1c1f222188031e0.zip
Diffstat (limited to 'root/.profile')
-rw-r--r--root/.profile70
1 files changed, 70 insertions, 0 deletions
diff --git a/root/.profile b/root/.profile
new file mode 100644
index 0000000..e8f0038
--- /dev/null
+++ b/root/.profile
@@ -0,0 +1,70 @@
+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