Skip to content

Instantly share code, notes, and snippets.

@t3chguy
Created July 8, 2015 07:05
Show Gist options
  • Save t3chguy/3b7768a8843ae9bd1d9f to your computer and use it in GitHub Desktop.
Save t3chguy/3b7768a8843ae9bd1d9f to your computer and use it in GitHub Desktop.
#!/bin/bash
#!/bin/sh
[ -r /etc/lsb-release ] && . /etc/lsb-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
# Fall back to using the very slow lsb_release utility
DISTRIB_DESCRIPTION=$(lsb_release -s -d)
fi
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
secs=$((${upSeconds}%60))
mins=$((${upSeconds}/60%60))
hours=$((${upSeconds}/3600%24))
days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
IP=`hostname -I | sed 's/[^ ]* //' | tr ' ' '-'`
[[ ${MEM[4]%\%} < 80 ]] && MEMP=''
CPUZ=`grep 'model name' /proc/cpuinfo | head -1`; CPUZ=${CPUZ//(R)/®}; CPUZ=${CPUZ/ CPU/}; CPUZ=${CPUZ/0 @/@}
IFS=' '
read one five fifteen rest < /proc/loadavg
read -a MEM <<< `df -h / | tail -1`
read -a RAM <<< `free -ho | head -2 | tail -1`
read -a IP <<< `hostname -I`
#clear
/usr/bin/clear
echo ''
echo
echo ' ./+o+-'
echo ' yyyyy- -yyyyyy+' ' Web Development Guru'
echo ' ://+//////-yyyyyyo'
echo ' .++ .:/++++++/-.+sss/` ' `whoami` '@' `hostname -f`
echo ' .:++o: /++++++++/:--:/- ' `date '+%A, %d %B %Y, %T'`
echo ' o:+o+:++.`..```.-/oo+++++/ ' `uname -srmo`
echo ' .:+o:+o/. `+sssoo+/'
echo ' .++/+:+oo+o:` /sssooo. ' 'Running Processes......:' `ps ax | wc -l | tr -d ' '`
echo ' /+++//+:`oo+o /::--:. ' 'Uptime.................:' ${UPTIME}
echo ' \+/+o+++`o++o ++////. ' 'Load Averages..........:' "${one}, ${five}, ${fifteen} (1, 5, 15 min)"
echo ' .++.o+++oo+:` /dddhhh. ' 'Central Processing Unit:' ${CPUZ#*: } "*`nproc`"
echo ' .+.o+oo:. `oddhhhh+ ' 'Memory (RAM)...........:' $RAMP${RAM[2]}B '/' ${RAM[1]}B
echo ' \+.++o+o``-````.:ohdhhhhh+ ' 'IP Version 4 Addresses.:' ''${IP[0]}
echo ' `:o+++ `ohhhhhhhhyo++os: ' 'IP Version 6 Addresses.:' ''${IP[1]}
echo ' .o:`.syhhhhhhh/.oo++o` ' 'Solid State Drive Size.:' $MEMP${MEM[1]}B
echo ' /osyyyyyyo++ooo+++/ ' 'Solid State Drive Used.:' $MEMP${MEM[2]}B
echo ' ````` +oo+++o\: ' 'Solid State Drive Usage:' $MEMP${MEM[4]}
echo ' `oo++.'
echo ''
printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment