-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaliases
93 lines (78 loc) · 2.58 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Git
alias sstash="git add . && git commit --allow-empty -am 'moar' && git push"
alias gaca="git add --all && git diff --cached"
alias gsi='git switch $(git branch | fzf)'
alias gbDi='git branch -D $(git branch | fzf -m)'
function gus () {
git submodule foreach 'git fetch origin && git pull origin $(git remote show origin | sed -n "/HEAD branch/s/.*: //p")'
}
# Github
function ghdiff () {
open "${$(git remote get-url origin)%.git}/compare/main..$(git branch --show-current)"
}
function ghpr () {
open "${$(git remote get-url origin)%.git}/compare/main...$(git branch --show-current)"
}
function ghpushref () {
git push -u origin "$(git branch --show-current)"
}
function ghrb () {
open "${$(git remote get-url origin)%.git}/tree/$(git branch --show-current)"
}
function fetchpr () {
git fetch origin "pull/$1/head:pull-$1" && git checkout "pull-$1"
}
# Ruby/Rails
alias rh="rbenv rehash"
alias r="bin/rails"
alias dbm="r db:migrate && r db:migrate RAILS_ENV=test"
alias dbr="r db:rollback"
alias dtp="r db:test:prepare"
alias dbreset="r db:reset"
alias dsl="r db:schema:load"
function lhm_down () {
bin/rails lhm:revert VERSION="$(bin/rails lhm:completed | tail -n1 | cut -d' ' -f1)"
}
# Apt
alias agi="sudo apt-get install"
alias agr="sudo apt-get remove"
alias as="apt-cache search"
alias agg="sudo apt-get upgrade"
alias agu="sudo apt-get update"
alias agc="sudo apt-get autoclean"
alias aga="sudo apt-get autoremove"
# Pacman
alias pacin="sudo pacman -S"
alias pacf="pacman -Ss"
alias pacrm="sudo pacman -Rns"
alias pacor="pacman -Qdt"
alias pacs="sudo pacman -Syy"
alias pacup="sudo pacman -Syu"
# dev
alias ddu="dev down && dev up"
alias ddus="dev down && dev up && dev server"
alias dduc="dev down && dev up && dev console"
# Other
alias m="man"
alias short="< ~/.aliases grep" # Quickly see aliases that I want
alias lshort="< ~/.localrc grep" # Quickly grep from the localrc
alias qgrep="< ~/.psql_history grep"
alias epath='echo $PATH | tr ":" "\n"'
alias xc='xclip -selection c'
alias xoi='xargs -0 -I{}'
alias bazs='basename -azs'
alias enc="openssl enc -aes-256-cbc -salt -pbkdf2"
alias dec="openssl enc -d -aes-256-cbc -salt -pbkdf2"
alias unrarall="basename -azs .rar *.rar | xargs -I{} -0 unrar e {}.rar"
alias fucking='sudo'
alias strip="grep -oE ''"
alias vson="vim -c'set ft=json | %!jq' -"
alias fixx='fc $(history | fzf | cut -d" " -f2)'
alias quote="pbpaste | sed 's/[[:space:]]*$//; s/^/> /' | pbcopy"
# interactive systemctl
function units () {
systemctl list-units -t service --all --plain --no-legend "$1" | sed -E 's/\s.+//g' | fzf -m
}
function procs () {
units 'proc*'
}