Skip to content

Instantly share code, notes, and snippets.

@sergiomtzlosa
Created February 23, 2014 11:32
Show Gist options
  • Save sergiomtzlosa/9170213 to your computer and use it in GitHub Desktop.
Save sergiomtzlosa/9170213 to your computer and use it in GitHub Desktop.
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
Decoration1="\[\e[90m\]?^?^?["
RegularUserPart="\[\e[36m\]\u"
RootUserPart="\[\e[31;5m\]\u\[\e[m\]"
Between="\[\e[90m\]@"
HostPart="\[\e[32m\]\h:"
PathPart="\[\e[93;1m\]\w"
Decoration2="\[\e[90m\]]\n?^?^?>\[\e[m\]"
case `id -u` in
0) export PS1="$Decoration1$RootUserPart$Between$HostPart$PathPart$Decoration2# ";;
*) export PS1="$Decoration1$RegularUserPart$Between$HostPart$PathPart$Decoration2$ ";;
esac
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages
read one five fifteen rest < /proc/loadavg
echo "$(tput setaf 2)
.~~. .~~. `date +"%A, %e %B %Y, %r"`
'. \ ' ' / .' `uname -srmo`$(tput setaf 1)
.~ .~~~..~. Last login.........: `lastlog -u $USER | cut -c "44-63" | sed "1 d"`
: .~.'~'.~. : Uptime.............: ${UPTIME}
~ ( ) ( ) ~ Memory.............: `cat /proc/meminfo | grep MemFree | awk {'print $2'}`kB (Free) / `cat /proc/memi$
( : '~'.~.'~' : ) Load Averages......: ${one}, ${five}, ${fifteen} (1, 5, 15 min)
~ .~ ( ) ~. ~ Running Processes..: `ps ax | wc -l | tr -d " "`
( : '~' : ) IP Addresses.......: `/sbin/ifconfig wlan0 | /bin/grep "inet addr" | /usr/bin/cut -d ":" -f 2 | /usr/$
'~ .~~~. ~' Weather Zaragoza...: `curl -s "http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=EU$
'~' Free Disk Space....: `df -Pk | grep -E '^/dev/root' | awk '{ print $4 }' | awk -F '.' '{ print $1 }'`$
Temperature CPU....: `exec -- /opt/vc/bin/vcgencmd measure_temp | cut -c "6-9"`ºC
SSH Logins.........: There are currently `who | awk -F' ' '{print $1}' | sort -u | wc -l` user(s) log$
$(tput sgr0)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment