i got loads of stuff, most i got from the internet and maybe changed a bit.
here's a clock
Code:
# clock - A bash clock that can run in your terminal window.
clock ()
{
while true;do clear;echo "===========";date +"%r";echo "===========";sleep 1;done
}
network info
Code:
netinfo ()
{
echo "--------------- Network Information ---------------"
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
/sbin/ifconfig | awk /'inet addr/ {print $4}'
# /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
echo "---------------------------------------------------"
}
define a word
Code:
# Define a word - USAGE: define dog
define ()
{
lynx -dump "http://www.google.com/search?hl=en&q=define%3A+${1}&btnG=Google+Search" | grep -m 3 -w "*" | sed 's/;/ -/g' | cut -d- -f1 > /tmp/templookup.txt
if [[ -s /tmp/templookup.txt ]] ;then
until ! read response
do
echo "${response}"
done < /tmp/templookup.txt
else
echo "Sorry $USER, I can't find the term \"${1} \""
fi
\rm -f /tmp/templookup.txt
}
here's a find function
Code:
function ff { find . -name $@ -print; }
here's a welcome message for when i open my terminal
Code:
clear
echo -ne "${LIGHTGREEN}" "Hello, $USER. today is, "; date
echo -e "${WHITE}"; cal ;
echo -ne "${CYAN}";
echo -ne "${LIGHTPURPLE}Sysinfo:";uptime ;echo ""
here are some colour definitions for the above message
Code:
# Define a few Colours
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
some aliases
Code:
# screenshots
alias screenshot='import -window root ~/Desktop/`date +%Y%m%d%H%M`.png'
# System info
alias cpuu="ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'"
alias memu='ps -e -o rss=,args= | sort -b -k1,1n | pr -TW$COLUMNS'
alias pg='ps aux | grep' #requires an argument
# interactive
alias cp='cp -vi'
alias mv='mv -vi'
alias rm='mv --target-directory=$HOME/.Trash/'
# Directory navigation aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# display facts of the day
alias today='grep -h -d skip `date +%m/%d` /usr/share/calendar/*'
# network
alias net1='watch --interval=2 "sudo netstat -apn -l -A inet"'
alias net2='watch --interval=2 "sudo netstat -anp --inet --inet6"'
alias net3='sudo lsof -i'
alias net4='watch --interval=2 "sudo netstat -p -e --inet --numeric-hosts"'
alias net5='watch --interval=2 "sudo netstat -tulpan"'
alias net6='sudo netstat -tulpan'
alias net7='watch --interval=2 "sudo netstat -utapen"'
alias net8='watch --interval=2 "sudo netstat -ano -l -A inet"'
alias netl='sudo nmap -sT -O localhost'
alias ping='ping -c 10'
alias currports='wine /home/iceni60/Desktop/Desktop_Folder/Network_Tools/currports/cports.exe'
alias winwhois='wine /home/iceni60/Desktop/Desktop_Folder/Network_Tools/win32whois_0_9_13/win32whois.exe'
alias xnews='wine /home/iceni60/Desktop/Desktop_Folder/Network_Tools/XNews/XNEWS.EXE'
alias whois='whois -H'
# listings
alias ls='ls --color=auto'
alias lh='ls -lah' # human readable (sizes) long and all ;-)
alias lls='ls -l -h -g -F --color=auto'
alias lc='ls -aCF'
alias lsam='ls -am' # List files horizontally
alias lr='ls -lR' # recursive
alias lsx='ls -ax' # sort right to left rather then in columns
alias lss='ls -shaxSr' # sort by size
alias lt='ls -latr' # sort by date
alias lm='ls -al |more' # pipe through 'more'
# scripts
alias calc='sh /home/iceni60/scripts/calc.sh'
alias whatsmyip='/home/iceni60/scripts/whatsmyip.sh'
alias unpack='/home/iceni60/scripts/unpack2dir.sh'
# chmod and permissions commands
alias mx='chmod a+x'
alias 000='chmod 000'
alias 644='chmod 644'
alias 755='chmod 755'
alias perm='stat --printf "%a %n \n "' # requires a file name e.g. perm file
# weather
alias weather='/home/iceni60/scripts/conky_scripts/weather.sh UKXX0085'
# Music
alias ncmpc='ncmpc -cm'
i added the scripts for the weather, whatsmyip, unpack and calculator. probably no one will use them, but if i ever lose everything i can come to this thread lol
MD5 794730399e2acdf0e5983f90a53632cf scripts.tar.gz
Bookmarks