Created
February 13, 2015 21:06
-
-
Save willmendesneto/3c1c150666b02232e494 to your computer and use it in GitHub Desktop.
.aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Default Aliases | |
################################################################################ | |
# Easier navigation: .., ..., ...., ....., ~ and - | |
alias ..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias ~="cd ~" # `cd` is probably faster to type though | |
alias -- -="cd -" | |
# List only directories | |
alias listdir="ls -lF ${colorflag} | grep --color=never '^d'" | |
alias sha1='openssl sha1' | |
alias path='echo -e ${PATH//:/\\n}' | |
alias now='date +"%T"' | |
alias nowtime=now | |
alias nowdate='date +"%d-%m-%Y"' | |
# Stop after sending count ECHO_REQUEST packets # | |
alias ping='ping -c 5' | |
# Do not wait interval 1 second, go fast # | |
alias fastping='ping -c 100 -s.2' | |
alias ports='netstat -tulanp' | |
# get web server headers # | |
alias header='curl -I' | |
# find out if remote server supports gzip / mod_deflate or not # | |
alias headerc='curl -I --compress' | |
## shortcut for iptables and pass it via sudo# | |
alias ipt='sudo /sbin/iptables' | |
# display all rules # | |
alias iptlist='sudo /sbin/iptables -L -n -v --line-numbers' | |
alias iptlistin='sudo /sbin/iptables -L INPUT -n -v --line-numbers' | |
alias iptlistout='sudo /sbin/iptables -L OUTPUT -n -v --line-numbers' | |
alias iptlistfw='sudo /sbin/iptables -L FORWARD -n -v --line-numbers' | |
alias firewall=iptlist | |
## Colorize the grep command output for ease of use (good for log files)## | |
alias grep='grep --color=auto' | |
alias egrep='egrep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
# YUM Package manager alias | |
alias yumupdate='sudo yum update && sudo yum upgrade' | |
alias yumsearch='sudo yum search' | |
alias yumremove='sudo yum remove' | |
# Shortcuts | |
alias dl="cd ~/Downloads" | |
alias dt="cd ~/Desktop" | |
alias p="cd ~/projects" | |
alias g="git" | |
alias h="history" | |
alias j="jobs" | |
# IP addresses | |
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" | |
alias localip="ifconfig getifaddr en1" | |
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'" | |
# Copy my public key to the pasteboard | |
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | printf '=> Public key copied to pasteboard.\n'" | |
# Flush Directory Service cache | |
alias flush="dscacheutil -flushcache" | |
# View HTTP traffic | |
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" | |
# File size | |
alias fs="stat -f \"%z bytes\"" | |
# Recursively delete `.DS_Store` files | |
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" | |
alias xlog="sudo grep --binary-files=without-match --color -nsie '(EE)' -e '(WW)' /var/log/Xorg.0.log" | |
alias which="whence" | |
alias sd='export DISPLAY=:0.0' | |
alias cpan="perl -MCPAN -e shell" | |
alias cup='cvs -z3 update -Pd' | |
alias mv='nocorrect /bin/mv' | |
alias rm='nocorrect /bin/rm -i' | |
alias shred='nocorrect ionice -c3 /usr/bin/shred -fuz' | |
alias wipe='nocorrect ionice -c3 /usr/bin/wipe -l2 -v -x -r' | |
alias man='nocorrect man' | |
alias mkdir='nocorrect /bin/mkdir -p' | |
alias find='noglob find' | |
# Jekyll alias | |
alias jsw='jekyll serve -w' | |
# alias wget="wget -c" | |
alias lsd='ls -Fld *(-/DN)' | |
alias weather="/home/gregf/code/bin/forecast/forecast.rb" | |
alias ncmpc="ncmpc -c" | |
alias fixdbus="sudo -s dbus-uuidgen --ensure" | |
alias v="vim" | |
alias o="open" | |
alias d="devtodo -A" | |
alias s="sudo subl" | |
alias subl="sudo subl" | |
# Reload the shell (i.e. invoke as a login shell) | |
alias reloadshell="exec $SHELL -l" | |
# Concatenate and print content of files (add line numbers) | |
alias catn="cat -n" | |
# Kill all the tabs in Chrome to free up memory | |
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description | |
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" | |
alias tlog='tail -f log/development.log' | |
alias rst='touch tmp/restart.txt' | |
alias giti="vim .gitignore" | |
alias g='gthumb' | |
alias burniso='wodim -v dev=/dev/cdrw' | |
alias burndvdiso='growisofs -speed=8 -dvd-compat -Z /dev/dvdrw=$1' | |
alias biosinfo='sudo dmidecode' | |
alias f-spot='dbus-launch f-spot' | |
alias gnp="git-notpushed" | |
alias k="killall" | |
alias poweroff='sudo poweroff' | |
alias reboot='sudo reboot' | |
alias lsnoext="ls | grep -v '\.'" | |
alias ipager='k ipager; sleep 1; ipager &' | |
alias gis="git status | grep --color=always '^[^a-z]\+\(new file:\|modified:\)' | cut -d'#' -f2-" | |
alias ports='netstat --inet -pln' | |
alias subl="sudo subl" | |
alias la="ls -la" | |
alias srm="sudo rm -rf" | |
alias smkdir="sudo mkdir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment