Skip to content

Instantly share code, notes, and snippets.

@keckelt
Last active September 17, 2018 08:46
Show Gist options
  • Save keckelt/881e31f2eee7a08aef3e7cc1a67055eb to your computer and use it in GitHub Desktop.
Save keckelt/881e31f2eee7a08aef3e7cc1a67055eb to your computer and use it in GitHub Desktop.
Bash Config
# Headlines: http://www.network-science.de/ascii/
# Font: big Reflection: no Adjustment: left Stretch: no Width: 80 Text: HISTORY
# _ _ _____ _____ _______ ____ _______ __
# | | | |_ _|/ ____|__ __/ __ \| __ \ \ / /
# | |__| | | | | (___ | | | | | | |__) \ \_/ /
# | __ | | | \___ \ | | | | | | _ / \ /
# | | | |_| |_ ____) | | | | |__| | | \ \ | |
# |_| |_|_____|_____/ |_| \____/|_| \_\ |_|
# Number of commands displayed by 'history' (-1=infinite)
HISTSIZE=-1
# Number of commands saved in .bash_history (-1 = infinite)
HISTFILESIZE=-1
# Enable history appending instead of overwriting. #139609
# Get commands by pressing up, even after reboot
shopt -s histappend
# _ _____ _____
# /\ | | |_ _| /\ / ____|
# / \ | | | | / \ | (___
# / /\ \ | | | | / /\ \ \___ \
# / ____ \| |____ _| |_ / ____ \ ____) |
# /_/ \_\______|_____/_/ \_\_____/
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias np='nano -w PKGBUILD'
alias more=less
alias ll='ls -lah' # ls as list, with hidden files, human readable size
alias ..='cd ..'
alias ws='cd ~/ws/'
alias hist='history 20' # short history
alias debug='./docker-compose-debug'
alias new='gnome-terminal'
shopt -s expand_aliases
# ______ _ _ _ _ _____ _______ _____ ____ _ _ _____
# | ____| | | | \ | |/ ____|__ __|_ _/ __ \| \ | |/ ____|
# | |__ | | | | \| | | | | | || | | | \| | (___
# | __| | | | | . ` | | | | | || | | | . ` |\___ \
# | | | |__| | |\ | |____ | | _| || |__| | |\ |____) |
# |_| \____/|_| \_|\_____| |_| |_____\____/|_| \_|_____/
# Countdown & stopwatch
function countdown(){
date1=$((`date +%s` + $1));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
sleep 0.1
done
notify-send "Countdown over!"
}
function stopwatch(){
date1=`date +%s`;
while true; do
echo -ne "$(date -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r";
sleep 0.1
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment