forked from atomantic/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shellaliases
85 lines (65 loc) · 3.63 KB
/
.shellaliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
#########################################
# Connectivity
#alias ssh.host ='ssh [email protected]'
#########################################
# Commands to run apps
alias run.clojure.repl='java -cp ${CLOJURE_HOME}/clojure.jar clojure.lang.Repl'
alias run.jlineclojure.repl='java -cp ${CLOJURE_HOME}/jline-0.9.91.jar:${CLOJURE_HOME}/clojure.jar jline.ConsoleRunner clojure.lang.Repl'
alias run.clojure.script='java -cp ${CLOJURE_HOME}/clojure.jar clojure.main'
#########################################
# Commands to change dirs
alias to.temp='cd ${MYTEMP}'
alias to.downloads='cd ${MYDOWNLOADS}'
alias to.dropbox='cd ~/Dropbox'
alias to.docs='cd ${MYDOCUMENTS}'
alias to.code='cd ${MYCODE}'
alias to.scratch='cd ${MYSCRATCH}'
alias to.devapps='cd ${MYDEVAPPS}'
#################################
# Simple Program Name Shortening
alias aq=aquamacs
alias g=git
#############################
# Utilities
# recursive dos2unix in current directory
alias dos2lf='dos2unix `find ./ -type f`'
# Flush the DNS on Mac
alias dnsflush='dscacheutil -flushcache'
# Copy and paste and prune the usless newline
alias pbcopynn='tr -d "\n" | pbcopy'
# Set the extended MacOS attributes on a file such that Quicklook will open it as text
alias qltext='xattr -wx com.apple.FinderInfo "54 45 58 54 21 52 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" $1'
#alias qltext2='osascript -e tell application "Finder" to set file type of ((POSIX file "$1") as alias) to "TEXT"'
# Git Scribe Commands
alias gsgp='git scribe gen pdf && open output/book.pdf'
alias gsgh='git scribe gen html && open output/book.html'
# Show network connections
# Often useful to prefix with SUDO to see more system level network usage
alias network.connections='lsof -l -i +L -R -V'
alias network.established='lsof -l -i +L -R -V | grep ESTABLISHED'
alias network.internalip="ifconfig en0 | egrep -o '([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'"
alias network.externalip='curl -s http://checkip.dyndns.org/ | sed "s/[a-zA-Z<>/ :]//g"'
# Files used, anywhere on the filesystem
alias files.usage='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep'
# Files being opened
alias files.open='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep open'
# Files in use in the Users directory
alias files.usage.user='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep Users'
# Directory listings
# LS_COLORS='no=01;37:fi=01;37:di=07;96:ln=01;36:pi=01;32:so=01;35:do=01;35:bd=01;33:cd=01;33:ex=01;31:mi=00;05;37:or=00;05;37:'
# -G Add colors to ls
# -l Long format
# -h Short size suffixes (B, K, M, G, P)
# -p Postpend slash to folders
alias ls='ls -G -h -p '
alias ll='ls -l -G -h -p '
# Restart Apache on Mac
alias apacherestart="sudo /usr/sbin/apachectl restart"
#Personal Commands
alias game.seek='txt="";for i in {1..20};do txt=$txt"$i. ";done;txt=$txt" Ready or not, here I come";say $txt'
alias dev2did='git co dev2did;grunt -f; git cam "new mobile build"; git push; git rev-parse HEAD;cd ../DisneyID_UI_Chef;git pull;cd ../DisneyID_UI;sed -i '"'"''"'"' '"'"'s/"UI_Release": "[a-z0-9]*"/"UI_Release": "'"'"'$(git rev-parse HEAD)'"'"'"/'"'"' ../DisneyID_UI_Chef/environments/did-qa/UI-Dev-Mobile.json;cd ../DisneyID_UI_Chef;git add .;git commit -m "update dev2did machine with new deployment commit";git push;cd /var/www/projects/did/DisneyID_UI'
#Git Tools
# assumes git-up is installed (gem install git-up)
# switches to 'develop' branch, updates all local branches (nicely using git-up), removes all local branches already merged into 'develop'
alias gitdev='git checkout develop; git-up; git branch --merged develop | grep -v "\* develop" | xargs -n 1 git branch -d; git branch;'