This is an old revision of the document!
Table of Contents
bash
bashrc
# settings
TZ='Europe/Berlin'; export TZ
# path
export PATH="~/bin:/sbin:/usr/sbin:/usr/local/sbin:${PATH}"
export XDG_DATA_HOME=~/.config
export XDG_CACHE_HOME=~/.cache
# sys
[ -f ~/.bash_alias ] && source ~/.bash_alias
[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
# editor
set -o vi
export EDITOR="vim"
umask 022
# history
export HISTFILESIZE=10000
export HISTSIZE=10000
shopt -s histappend
export HISTCONTROL=ignoredups
export LS_OPTIONS='--color=auto'
eval `dircolors $HOME/.dircolors`
# start screen
if [[ $- = *i* && -z "$STY" ]]; then exec screen -dR chat irssi; fi
snippets
[ $1 ] || { echo -ne "\033[0m>>> usage: $0 <target>\n" >&2; exit 1; }
ip and gateway
while [ "x$INET_IPM" == "x" ]; do
i=`ip a s wlan0 | grep "inet " | grep -v "169.254" | awk '{print $2}'`
if [ "x$i" != "x" ]; then
INET_IFACE="wlan0"
INET_IPM="$i"
break; fi
i=`ip a s eth0 | grep "inet " | grep -v "169.254" | awk '{print $2}'`
if [ "x$i" != "x" ]; then
INET_IFACE="eth0"
INET_IPM="$i"
break; fi
if [ "x$INET_IPM" == "x" ]; then
[ "x$wait" != "x" ] || echo -n "waiting for ip on $INET_IFACE .."
echo -n "."
wait=now
sleep 3
fi
done
echo
INET_IP=${INET_IPM%/*}
INET_GW=`ip r | grep default | awk '{print $3}'`