export TERM=xterm



##################################################
# Directory shortcuts				 #
##################################################

alias audible='cd /mnt/us/audible'
alias back='cd $OLDPWD'
alias bin='cd /usr/bin'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias documents='cd /mnt/us/documents'
alias ebin='cd /opt/amazon/ebook/bin'
alias keystore='cd /var/local/java/keystore'
alias kindlesec='cd /mnt/us/.kindlesec'
alias launchpad='cd /mnt/us/launchpad'
alias local='cd /var/local'
alias music='cd /mnt/us/music'
alias readability='cd /usr/share/browser/readability'
alias sbin='cd /usr/sbin'



##################################################
# Information					 #
##################################################

alias cpu_hogs='ps wwaxr -o pid,stat,%cpu,time,command | head -10'			# to find CPU hogs
alias free='free -m'									# RAM and SWAP detail in MBs
alias hogc='ps -e -o %cpu,pid,ppid,user,cmd | sort -nr | head'				# display the processes that are using the most CPU time and memory
alias hogm='ps -e -o %mem,pid,ppid,user,cmd | sort -nr | head'				# display the processes that are using the most CPU time and memory
alias l?='cat ~/technical/tips/ls'
alias lc='ls -ltcr'       								# sort by and show change time, most recent last
alias ldir='ls -lhA |grep ^d'
alias ld='ls -ltr' 									# sort by date
alias lfiles='ls -lhA |grep ^-'
alias lf="ls -Alh --color | awk '{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(\" %0o \",k);print}'"	# full ls with octal+symbolic permissions
alias lgg='ls --color=always | grep --color=always -i'					# quick case-insenstive partial filename search
alias lh='ls -Al' 									# show hidden files
alias lh='ls -lAtrh' 									# sort by date and human readable
alias libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
alias li='ls -ai1|sort' 								# sort by index number
alias linecount='wc -l $1'								# count number of lines in text file
alias lk='ls -lSr'									# sort by size
alias llllll='ls -FlaXo --color=auto'							# sort the extensions alphabetically; good for winfiles
alias lllll='ls -Fla --full-time -o -Q --color=auto'					# whatever
alias llll='ls -laS --color=auto'							# sort by size
alias lll='ls -Falot --color=auto'							# sort by mod time
alias ll_='ls -l'									# long listing
alias l.='ls -d .[[:alnum:]]* 2> /dev/null || echo "No hidden file here..."'		# list only hidden files
alias l='ls -hF --color'								# quick listing
alias lm_='ls -al |more'    								# pipe through 'more'
alias ln='ln -s'
alias lr='ls -lR'									# recursice ls
alias lrt='ls -lart'									# list files with last modified at the end
alias lsam='ls -am' 									# List files horizontally
alias lsdd='ls -latr'                                 					# sort by date
alias lsd='ls -l | grep "^d"'								# list only directories
alias lsize='ls --sort=size -lhr'							# list by size
alias lsl='ls -lah'                                   					# long list, human-readable
alias ls='ls -ah'									# ls showing hidden files, human-readable
alias lsnew='ls -Alh --color=auto --time-style=+%D | grep `date +%D`'
alias lss='ls -shaxSr'                         			       			# sort by size
alias lsss='ls -lrt | grep $1'								# to see something coming into ls output: lss
alias lsx='ls -ax' 									# sort right to left rather then in columns
alias lt_='ls -alt|head -20' 								# 20, all, long listing, modification time
alias lt='ls -ltr'         								# sort by date, most recent last
alias lu='ls -ltur'        								# sort by and show access time, most recent last
alias lx='ls -lXB'									# sort by extension
alias mem_hogs_ps='ps wwaxm -o pid,stat,vsize,rss,time,command | head -10'		# to find memory hogs
alias numFiles='echo $(ls -1 | wc -l)'							# numFiles: number of (non-hidden) files in current directory
alias processbycpuusage="ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'"
alias processbymemusage='ps -e -o rss=,args= | sort -b -k1,1n | pr -TW$COLUMNS'
alias processtree='ps -e -o pid,args --forest'
alias which='type -all'



##################################################
# Information (clock and date stuff)		 #
##################################################

alias am-pm='date +"%p"'								# AM/PM (ex. AM)
alias bdate2="date +'%a %Y-%m-%d %H:%M:%S %z'"						# date command (ex. Sun 2011-01-23 05:39:26 -0500)
alias bdate3='date "+%Y-%m-%d %A    %T %Z"'						# date command (ex. 2011-01-23 Sunday    05:39:23 EST)
alias bdate="date '+%a, %b %d %Y %T %Z'"						# date command (ex. Sun, Jan 23 2011 05:39:13 EST)
alias date_='TZ=$TZ-72 date +%d.%m.%Y'							# solaris: get current date + 72 hours
alias day='date +%A'									# day of the week (ex. Saturday)
alias DAY='date "+%A" | tr '[a-z]' '[A-Z]''						# day (text) (ex. SATURDAY)
alias day#='date +%d'									# date (numeric) (ex. 22)
alias daysleft='echo "There are $(($(date +%j -d"Dec 31, $(date +%Y)")-$(date +%j))) left in year $(date +%Y)."'	# how many days until the end of the year
alias epochdaysleft="perl -e 'printf qq{%d\n}, time/86400;'"				# perl one-liner to determine number of days since the Unix epoch
alias epochtime='date +%s'								# report number of seconds since the Epoch (ex. 1295779549)
alias month='date +%B'									# month (ex. January)
alias MONTH='date "+%B" | tr '[a-z]' '[A-Z]''						# month (text) (ex. JANUARY)
alias mytime='date +%H:%M:%S'								# shows just the current time (ex. 05:46:05)
alias stamp='date "+%Y%m%d%a%H%M"'							# timestamp (ex. 20110123Sun0545)
alias time2='date +"%I:%M"'								# time (hours:minutes) (ex. 05:13)
alias time3='date +"%l:%M %p"'								# time (ex. 5:13 AM)
alias time4='date +"%H:%M"'								# time (hours:minutes) (ex. 05:13)
alias timestamp='date "+%Y%m%dT%H%M%S"'							# timestamp (ex. 20110123T054906)
alias today='date +"%A, %B %-d, %Y"'							# date command (ex. Sunday, January 23, 2011)
alias weeknum='date +%V'								# perl one-liner to get the current week number (ex. 03)



##################################################
# Miscellaneous					 #
##################################################

alias about='cd /mnt/us/myts/ && cat about.txt && cd /mnt/us/'					# opens 'about.txt' text file
alias mc='cd /mnt/us/local/terminal/ && ./mc && cd /mnt/us/'					# run Midnight Commander File Browser
alias refont='cp -f /mnt/us/launchpad/reader.pref /mnt/us/system/com.amazon.ebook.booklet.reader/ && echo "Please restart for the changes to take effect"'											# change font back to 'alt' font in /mnt/us/fonts



##################################################
# Miscellaneous Fun				 #
##################################################

alias einsteiny='A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";'						# numbers guessing game
alias freechess='telnet fics.freechess.org 5000'						# connects to a telnet server for free internet chess
alias funknet='telnet the-funk.net 7000'							# access to Funk.net
alias futurama='curl -Is slashdot.org | sed -n '5p' | sed 's/^X-//''				# get Futurama quotations from slashdot.org servers
alias insults='wget http://www.randominsults.net -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;";'
alias starwars='telnet towel.blinkenlights.nl'							# the famous starwars ASCII version from telnet



##################################################
# Run the Midnight Commander automatically	 #
##################################################

###### if you uncomment (remove '#' below) 'mc', will autostart when you load myts
# mc



##################################################
# Run the 'about' alias	automatically		 #
##################################################

about
