Skip to content

Instantly share code, notes, and snippets.

@simonhayward
Last active December 21, 2015 09:07
Show Gist options
  • Save simonhayward/02471cadb9270b9e3db8 to your computer and use it in GitHub Desktop.
Save simonhayward/02471cadb9270b9e3db8 to your computer and use it in GitHub Desktop.
Welcome screen .bashrc
# UTF-8
export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8
export LANGUAGE=en_GB.UTF-8
export EDITOR=/usr/bin/vim
# tailoring 'less'
#######################################################
alias more='less'
export PAGER=less
export LESSCHARSET='utf-8'
# Define a few Color's
BLACK='\e[0;30m'
BLUE='\e[0;34m'
GREEN='\e[0;32m'
CYAN='\e[0;36m'
RED='\e[0;31m'
PURPLE='\e[0;35m'
BROWN='\e[0;33m'
LIGHTGRAY='\e[0;37m'
DARKGRAY='\e[1;30m'
LIGHTBLUE='\e[1;34m'
LIGHTGREEN='\e[1;32m'
LIGHTCYAN='\e[1;36m'
LIGHTRED='\e[1;31m'
LIGHTPURPLE='\e[1;35m'
YELLOW='\e[1;33m'
WHITE='\e[1;37m'
NC='\e[0m' # No Color
# SPECIAL FUNCTIONS
#######################################################
netinfo ()
{
echo "--------------- Network Information ---------------"
/sbin/ifconfig | awk /'inet addr/ {print $2}'-
#/sbin/ifconfig | awk /'Bcast/ {print $3}'-
# /sbin/ifconfig | awk /'inet addr/ {print $4}'
# /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
echo "---------------------------------------------------"
}
spin ()
{
echo -ne "${RED}-"
echo -ne "${WHITE}\b|"
echo -ne "${BLUE}\bx"
echo -ne "${RED}\b+${NC}"
}
# Find a file with a pattern in name:
function ff() { find . -type f -iname '*'$*'*' -ls ; }
# Find a file with pattern $1 in name and Execute $2 on it:
function fe()
{ find . -type f -iname '*'${1:-}'*' -exec ${2:-file} {} \; ; }
WELCOME SCREEN
#######################################################
clear
for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} $(uname -o) ${NC}";-
for i in `seq 1 15` ; do spin; done ;echo ""
echo -e ${LIGHTBLUE}`cat /etc/lsb-release` ;
echo -e "Kernel Information: " `uname -smr`;
echo -ne "${CYAN}";netinfo;-
echo -ne "${LIGHTBLUE}Uptime: ";uptime | awk /'up/ {print $3,$4}'
for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} $(uname -nms) ${NC}"; for i in `seq 1 15` ; do spin; done ;echo "";
echo ""; echo ""
# Command mode set to vi
set -o vi
# Pythonz
[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment