Skip to content

Commit

Permalink
more aliases and functions, rename some files
Browse files Browse the repository at this point in the history
  • Loading branch information
markets committed Jun 27, 2014
1 parent 8219c62 commit 608be23
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 20 deletions.
48 changes: 35 additions & 13 deletions bash/bash_aliases
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
alias df='df -h' # humanize sizes
alias cp='cp -i' # confirm before overwrite
alias reload='source ~/.bash_profile'

alias q='exit'

alias please='sudo'

alias h='history'
alias hi='history | tail -20'
alias reload!='. ~/.bash_profile'
alias localip='ipconfig getifaddr en1'
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to clipboard.'"
alias hosts='more /etc/hosts'

alias c='pbcopy'
alias p='pbpaste'
alias l='ls -laGFh'
alias ..='cd ..'
alias ...='cd ../..'
alias cdd='cd -'

alias numfiles='echo $(ls -1 | wc -l)'

alias psa='ps aux'
alias psg='ps aux | grep $1'

alias ka9='killall -9'
alias k9='kill -9'

alias l='ls -laGFh'
alias ..='cd ..'
alias ...='cd ../..'
alias cdd='cd -'
alias df='df -h' # humanize sizes

alias cp='cp -i' # confirm before overwrite

alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to clipboard.'"
alias hosts='more /etc/hosts'
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"

alias week='date +%V'
alias day='date +%d'

alias chrome="open -a google\ chrome"
alias safari="open -a safari"
alias firefox="open -a firefox"
alias skype='open -a Skype'
alias mou='open -a Mou'

alias c='pbcopy'
alias p='pbpaste'

alias tf='tail -f'
alias tlog='tail -f log/development.log'
alias devlog='tail -f log/development.log'

alias post='curl -i -X POST'
alias get='curl -i -X GET'
Expand All @@ -31,7 +51,9 @@ alias gco='git checkout'
alias gd='git diff'
alias gb='git branch'
alias gs='git show'
alias gcl='git clone'

alias rb='ruby'
alias rs='rails s'
alias rc='rails c'
alias rg='rails g'
Expand Down
17 changes: 13 additions & 4 deletions bash/bash_functions
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
function ruby_version {
function ruby_version
{
rbenv version-name
}

function rails_version {
function rails_version
{
rails -v | sed 's/Rails //'
}

function git_dirty {
function git_dirty
{
local status=$(git status --porcelain 2> /dev/null)

if [[ "$status" != "" ]]; then
Expand All @@ -16,7 +19,13 @@ function git_dirty {
fi
}

function mkcd {
function mkcd
{
dir=$1;
mkdir -p $dir && cd $dir;
}

function ips
{
ifconfig | grep "inet " | awk '{ print $2 }'
}
File renamed without changes.
5 changes: 3 additions & 2 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
branch = auto
ui = true
[core]
excludesfile = ~/.gitignore_global
excludesfile = ~/.gitignore
[alias]
st = status
ci = commit
Expand All @@ -19,7 +19,8 @@
cl = clone
lg = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
last = log -1 HEAD
rh = reset --hard HEAD
tags = tag -l
remotes = remote -v
[push]
default = simple
[pull]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion script/install
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function install {

# Git stuff
ln -sf "$dotfiles_dir/git/gitconfig" ~/.gitconfig
ln -sf "$dotfiles_dir/git/gitignore_global" ~/.gitignore_global
ln -sf "$dotfiles_dir/git/gitignore" ~/.gitignore
ln -sf "$dotfiles_dir/git/gitk" ~/.gitk

# Ruby stuff
Expand Down

0 comments on commit 608be23

Please sign in to comment.