Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
My personal .bashrc file
#------------------------------------------////
# Aliases:
#------------------------------------------////
## make ls list by size
##alias ls='du -s */* | sort -n'
alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
alias tunes='rhythmbox'
alias ports='netstat -nape --inet'
alias debtoots='opera -newpage http://www.debiantutorials.org &'
alias dtadmin='opera -newpage XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
alias forum=' opera -newpage http://www.debiantutorials.org/talkitup/index.php &'
alias stats=' opera -newpage http://xxxxxxxxxxxxxxxxxxxxxxx'
alias steves='ssh -p XXXXXX XXXXXXXXXXXX'
alias 150='ssh -l founder -p XXXXXX XXXXXXXXXXXX'
alias madcarters='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias pungent-judy='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias linux-impressions='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias debianathome='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias geek-feed='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias mcorgadmin='ssh -p XXXXXX XXXXXXXXXXXX -l UNAME'
alias ping='ping -c 4'
alias ns='netstat -alnp --protocol=inet'
alias search='aptitude search'
alias show='aptitude show'
alias ls='ls -aF' # --color=always'
alias la='ls -Al'
alias lx='ls -lXB'
alias lk='ls -lSr'
alias lc='ls -lcr'
alias lu='ls -lur'
alias lr='ls -lR'
alias lt='ls -ltr'
alias lm='ls -al | more'
#alias rm='rm -i'
#------------------------------------------////
# Functions and Scripts:
#------------------------------------------////
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth
set -o vi # ATENTION !!! now your bash use vim style. coment if you dont know how to use vim
##WOOT!
localnet ()
{
/sbin/ifconfig | awk /'inet / {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
}
function diskusage
{
# du -hsx * | sort -rh | head -10
df -h
# du -hsx * | sort -r | head -10
}
myip ()
{
lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
}
function dd
{
echo "Please!! dont do that !!"
}
upinfo ()
{
echo -ne "${green}$HOSTNAME ${red}uptime is ${cyan} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
function mkcd
{
local final_dir=""
for i in $@
do
[ ! -d "$i" ] && mkdir -pv "$i"
final_dir="$i"
done
cd "$final_dir"
}
# List all file every time when you enter in a directory
function cd()
{
if [ -n "$1" ]; then
builtin cd "$@" && ls -g
else
builtin cd ~ && ls -g
fi
}
weather ()
{
declare -a WEATHERARRAY
WEATHERARRAY=( `lynx -dump "http://www.google.com/search?hl=en&lr=&client=firefox-a&rls=org.mozilla_en-US_official&q=weather+${1}&btnG=Search" | grep -A 5 -m 1 "Weather for" | sed 's;\[26\]Add to iGoogle\[27\]IMG;;g'`)
echo ${WEATHERARRAY[@]}
}
function googl
{
search=""
echo "$1"
for term in $*; do
search="$search%20$term"
done
lynx "http://google.com/search?q=$search" #for startpage results try "https://startpage.com/do/search/?q=$search"
}
encrypt ()
{
gpg -ac --no-options "$1"
}
decrypt ()
{
gpg --no-options "$1"
}
extract()
{
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.tar.Z) tar xzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.jar) unzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*) echo "'$1' cannot be extracted." ;;
esac
else
echo "'$1' is not a file."
fi
}
# Setup pronpt colors em fields
export PS1="\[\e[00;32m\]\H\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[00;31m\]\u\[\e[0m\]\[\e[00;37m\]:[\[\e[0m\]\[\e[00;36m\]\w\[\e[0m\]\[\e[00;37m\]]\n->\[\e[0m\] "
export DERBY_INSTALL=/Users/edgardleal/app/derby/db-derby-10.11.1.1-bin
export CLASSPATH=/Users/edgardleal/app/derby/db-derby-10.11.1.1-bin/lib/derby.jar:/Users/edgardleal/app/derby/db-derby-10.11.1.1-bin/lib/derbytools.jar:.
export DERBY_HOME=/Users/edgardleal/app/derby/db-derby-10.11.1.1-bin
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
export EDITOR="vim"
##
# Your previous /Users/edgardleal/.profile file was backed up as /Users/edgardleal/.profile.macports-saved_2014-12-13_at_23:29:18
##
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# MacPorts Installer addition on 2014-12-13_at_23:29:18: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment