-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
76 lines (68 loc) · 2.01 KB
/
.aliases
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
# Expensify aliases
alias saltfab='cd ~/source/Expensify/Expensidev/Ops-Configs/saltfab; source venv3/bin/activate'
alias pfab='fab -P -z 10'
alias gab='fab -g bastion1.sjc'
alias pgab='gab -P -z 10'
alias sshtun='ssh -At -t bastion1.sjc ssh -A'
alias fhk='~/fuckHostKeys.sh'
alias misc='cd ~/source/Expensify/misc-scripts/; source venv/bin/activate'
# Git aliases and functions
alias gm='git pull origin main'
# Temporary hacks until all repos I use are switcehd to Main
#function gm() {
# default_branch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
# local existed_in_remote=$(git ls-remote --heads origin ${default_branch})
#
# if [[ -z ${existed_in_remote} ]]; then
# default_branch="main"
# else
# default_branch="master"
# fi
#
# git pull origin "$default_branch"
#}
#function gcom() {
# default_branch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
# local existed_in_remote=$(git ls-remote --heads origin ${default_branch})
#
# if [[ -z ${existed_in_remote} ]]; then
# default_branch="main"
# else
# default_branch="master"
# fi
#
# git checkout "$default_branch"
#}
alias gco='git checkout'
alias gcom='git checkout main'
alias gcob='git checkout -b'
alias gcbo='gcob'
alias gcm='git commit -m'
alias gcnm='git commit -n -m'
alias gcmn='gcnm'
alias gaa='git add .'
alias gau='git add -u'
alias gs='git status'
alias gp='git push origin'
alias gpn='gp origin --no-verify'
alias gpf='gp --force'
alias gpfn='gpn --force'
alias gpnf='gpfn'
# Bash things
alias ..='cd ..'
alias ...='cd ../..'
alias ll='ls -alhG'
function pr() {
remote=$(git remote -v | grep origin | head -1 | awk '{print $2}' | sed 's/.*:\(.*\)*/\1/' | sed 's/\.git$//')
branch=$(git rev-parse --abbrev-ref HEAD)
open "https://github.com/$remote/pull/new/$branch"
}
# create a socks proxy on port 8080 to a given host, use compression for the data.
function socks(){
ssh -D 8080 -C "$1"
}
# get info from a cert quickly
certinfo() {
openssl x509 -in "$1" -noout -text
}
alias tf='terraform'