-
Notifications
You must be signed in to change notification settings - Fork 0
/
shellaliases
executable file
·203 lines (182 loc) · 6.71 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Simple program name / common args shortening
# --- --- --- --- --- --- --- ---
# --- Static analysis
# --- --- --- --- --- --- --- ---
#
#alias ls='ls --color=auto'
alias ..='cd ../'
#alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -lha'
alias la='ls -A'
alias l5='ls -lhtra | tail -5'
alias pp='ps -eLfww'
alias lessc='less -R' # Lets color escape sequences carry through to less
alias morec='more -R'
alias lesscolor='less -R'
alias morecolor='more -R'
alias st='/opt/sublime_text/sublime_text'
alias tree='tree -C'
alias web='google-chrome'
alias agi='sudo apt-get install'
alias py='python'
alias mh='mv $1 .'
alias setpy='source /Users/begler/opt/environments/37/bin/activate'
alias op='cd ~/opt'
alias p='python'
alias _="sudo"
#################################
# git
alias g='nocorrect git'
alias gra='for file in `g st | cut -d" " -f3`; do g co -- $file; done;'
# snv
alias sra='for file in `svn status | cut -d" " -f8`; do rm -rf $file; done;'
alias e='ember'
alias es='ember server'
alias esd='ember server --environment=docker'
#################################
# Utilities
#alias what.installed="(zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'"
# Cat the oracle tns file
alias show.tns='cat $ORACLE_HOME/network/admin/tnsnames.ora'
alias sql='rlwrap -c sqlplus $@'
alias hexdumpfile='od -h'
# Lists the ten most used commands.
alias history.stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head"
# 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"'
# Simple webserver for the current directory
alias serve='python -m SimpleHTTPServer'
# 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'
alias fuck='eval $(thefuck $(fc -ln -1)); history -r'
#################################
# Common Curl Commands
alias cu='curl -w "\n" -s'
alias cui='cu -i '
alias cujs='cu -H "Accept: application/json" -H "Content-Type: application/json"'
alias cujsa='cujs -H "Authorization: $JWT"'
alias cuxml='cui -H "Accept: text/xml" -H "Content-Type: text/xml"'
alias cujsLocalOrigin='cujs -H "Origin: http://localhost"'
alias gcurl='cu --header "Authorization: Bearer $(gcloud auth print-identity-token)"'
alias gcujs='cujs --header "Authorization: Bearer $(gcloud auth print-identity-token)"'
#################################
# docker
#alias docker="sudo docker"
#alias d="docker --dns=10.55.224.100"
alias d="docker"
#--dns=10.7.224.10"
# Get latest container ID
alias dl="docker ps -l -q"
# List volumes
alias dv="docker volume ls"
# Get container process
alias dps="docker ps"
# Get process included stop container
alias dpa="docker ps -a"
# Get images
alias di="docker images"
# Get container IP
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
# Run deamonized container, e.g., $dkd base /bin/echo hello
alias dkd="docker run -d -P $docker_dns"
# Run interactive container, e.g., $dki base /bin/bash
alias dki="docker run -i -t -P $docker_dns"
# Stop all containers
dstop() { docker stop $(docker ps -a -q);}
# Remove all containers
#drm() { docker rm $(docker ps -a -q); }
# Stop and Remove all containers
alias drmf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Delete all dangling images
alias drmd='docker rmi $(docker images -f "dangling=true" -q)'
# Delete all dangling volumes
#drmv() { docker volume rm $(docker volume ls -qf dangling=true); }
# Remove all images
#dri() { docker rmi $(docker images -q); }
# Dockerfile build, e.g., $dbu tcnksm/test
#dbu() { docker build -t=$1 .; }
# Show all alias related docker
#dalias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort;}
#dex() { docker exec -it $1 /bin/bash; }
# docker machine
alias dm="docker-machine"
alias dc="docker-compose"
alias dcud="docker-compose up -d"
alias dcd="docker-compose down"
alias dcu="docker-compose up"
#################################
# Vagrant Aliases
alias v="vagrant"
alias vup="vagrant up"
alias vh="vagrant halt"
alias vs="vagrant suspend"
alias vr="vagrant resume"
alias vrl="vagrant reload"
alias vssh="vagrant ssh"
alias vst="vagrant status"
alias vp="vagrant provision"
alias vdstr="vagrant destroy"
# requires vagrant-list plugin
alias vl="vagrant list"
# requires vagrant-hostmanager plugin
alias vhst="vagrant hostmanager"
#################################
# Gulp Aliases
alias gus='gulp server | ./node_modules/.bin/bunyan -o short'
alias gut='gulp test'
alias gub='gulp build'
#################################
# Gradle Aliases
alias gw='gradlew'
################################
# svn aliases
alias svn.tree.conflict='svn resolve --accept working -R'
alias svn.revert='svn revert'
alias eant='TOMCAT_HOME=/opt/tools/apache-tomcat-5.5.36 JAVA_HOME=/opt/tools/java/jdk1.7.0_79 JAVA5_HOME=/opt/tools/java/jdk1.5.0_22 ant'
alias erx.src='cd ${DEV_HOME}/mck/erx/source/'
alias cps.src='cd ${DEV_HOME}/mck/cps/cps'
alias e='ember'
alias es='ember server'
alias esd='ember server --environment=docker'
alias esb='ember server --environment=browser'
alias serve='python -m SimpleHTTPServer 8000'
alias az='azure'
alias gc='gcloud'
alias rn='react-native'
alias m='make'
alias f='flutter'
alias sls='serverless'
alias fl='bundle exec fastlane'
alias a='ansible'
alias ku='kubectl'
alias kush='kubectl run -it --rm --restart=Never busybox --image=busybox sh'
alias kn='kubens'
alias kc='kubectx'
alias he='helm'
alias mk='minikube'
alias tf='terraform'
alias jn='jupyter notebook --no-browser'
alias c='cargo'
# FnProject
alias fns='fn start -d'
alias fnd='fn --verbose deploy --all --local'
alias fnll='fn get logs cet-jira $(fn list calls cet-jira | head -1 | cut -d" " -f2)'
alias fnui='docker run -d --rm --link fnserver:api --name fnui -p 4000:4000 -e "FN_API_URL=http://api:8080" fnproject/ui'
# West / Zephyr
alias we=west
alias bzl='nocorrect bazelisk'
#alias bzl='nocorrect bazel'
alias vz='vi ~/.zshrc'
alias gr='cd $(git rev-parse --show-toplevel)'
alias tfchk='terraform init --backend=false -upgrade && terraform validate && go run github.com/abcxyz/pkg/cmd/terraform-linter@main ./'