Skip to content

Instantly share code, notes, and snippets.

View StefanWetterActiware's full-sized avatar
😀

Stefan Wetter StefanWetterActiware

😀
View GitHub Profile
@dhonx
dhonx / update_branch_list_from_remote.sh
Created November 8, 2019 07:08
Git: Update Branch List from Remote
# Source: https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches
# To update the local list of remote branches:
git remote update origin --prune
@thomasba
thomasba / colors.sh
Created May 17, 2019 12:47
Bash colors and formatting options in a bash script :)
#!/bin/bash
echo -e "\e[32;1mSet\e[0m"
echo -ne "\e[1m 1: Bold \e[0m"
echo -ne "\e[2m 2: Dim \e[0m"
echo -ne "\e[3m 3: Italic \e[0m"
echo -ne "\e[4m 4: Underlined \e[0m"
echo
echo -ne "\e[5m 5: Blink \e[0m"
echo -ne "\e[6m 6: Overline \e[0m"
@adamhotep
adamhotep / longopts2getopts.sh
Last active November 29, 2023 23:22
POSIX shell: support long options by converting them to short options
# a refinement of https://stackoverflow.com/a/5255468/519360
# see also my non-translating version at https://stackoverflow.com/a/28466267/519360
# translate long options to short
reset=true stopped=""
for opt in "$@"; do
if [ -n "$reset" ]; then
unset reset
set -- # reset the "$@" array so we can rebuild it
fi
@nestoru
nestoru / ps aux with ppid
Created December 10, 2014 21:29
ps aux with ppid
ps aux|head -1
# Returns: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ps axo user,pid,ppid,pcpu,pmem,vsz,rss,tname,stat,start,time,args|head -1
# Returns: USER PID PPID %CPU %MEM VSZ RSS TTY STAT STARTED TIME COMMAND