Skip to content

Instantly share code, notes, and snippets.

@ivyl
Created August 14, 2011 00:07
Show Gist options
  • Save ivyl/1144394 to your computer and use it in GitHub Desktop.
Save ivyl/1144394 to your computer and use it in GitHub Desktop.
MOTD Debian goodie
#!/bin/bash
NAME=servergroupnameororganization
URL1=http://test.com
URL2=http://example.com
UPTIME=`cat /proc/uptime |grep -E -o '^[0-9]*'`
UPTIME_SEC=$((UPTIME%60))
UPTIME=$((UPTIME/60))
UPTIME_MIN=$((UPTIME%60))
UPTIME=$((UPTIME/60))
UPTIME_H=$((UPTIME%24))
UPTIME_DAYS=$((UPTIME/24))
MEMTOTAL=`cat /proc/meminfo | grep MemTotal | grep -o '[0-9]*'`
MEMTOTAL_MB=$((MEMTOTAL/1024))
MEMFREE=`cat /proc/meminfo | grep MemFree | grep -o '[0-9]*'`
MEMFREE_MB=$((MEMFREE/1024))
MEMUSED=$((MEMTOTAL-MEMFREE))
MEMUSED_MB=$((MEMUSED/1024))
LOAD=`cat /proc/loadavg | grep -o '^\S* \S* \S*'`
echo -e "\e[0m\e[37m "
echo -e "\e[0;1;31m \e[31m_sudZUZ#Z#XZo=_ "
echo -e "\e[0;1;31m \e[31m_jmZZ2!!~---~!!X##wa \e[1;30m$NAME"
echo -e "\e[0;1;31m \e[31m.<wdP~~ \e[31m-!YZL, "
echo -e "\e[0;1;31m \e[31m.mX2' \e[31m_%aaa__ \e[31mXZ[. \e[1;37mhostname: \e[1;30m$HOSTNAME"
echo -e "\e[0;1;31m \e[31moZ[ \e[31m_jdXY!~?S#wa \e[31m]Xb; \e[1;37muptime: \e[1;33m$UPTIME_DAYS days $UPTIME_H h "
echo -e "\e[0;1;31m \e[31m_#e' \e[31m.]X2( \e[31m~Xw| \e[31m)XXc "
echo -e "\e[0;1;31m\e[31m.2Z' \e[31m]X[. \e[31mxY| \e[31m]oZ( \e[1;37mmemory used: \e[1;32m$MEMUSED_MB MB \e[1;37m/ \e[1;31m$MEMTOTAL_MB MB"
echo -e "\e[0;1;31m\e[31m.2#; \e[31m)3k; \e[31m_s!~ \e[31mjXf' "
echo -e "\e[0;1;31m \e[31m1Z> \e[31m-]Xb/ \e[31m~ \e[31m__#2( \e[1;37mload: \e[1;34m$LOAD"
echo -e "\e[0;1;31m \e[31m-Zo; \e[31m+!4ZwaaaauZZXY' "
echo -e "\e[0;1;31m \e[31m*#[, \e[31m~-?!!!!!!-~ "
echo -e "\e[0;1;31m \e[31mXUb;. "
echo -e "\e[0;1;31m \e[31m)YXL,, "
echo -e "\e[0;1;31m \e[31m+3#bc, \e[1;37m$URL1"
echo -e "\e[0;1;31m \e[31m-)SSL,, \e[1;37m$URL2"
echo -e "\e[0;1;31m \e[31m~~~~~ "
echo -e "\e[0m\e[255D"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment