-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.aliases
186 lines (157 loc) · 4.97 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
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
# shellcheck shell=sh
export CLICOLOR=1
alias nano=vim
alias e=vim
alias g=git
alias y=yadm
alias dc=docker-compose
alias dtop='docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest'
alias dockerip="docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
alias containerip=dockerip
if [ -x `command -v brew` ]; then
alias b=brew
fi
# ls tings
if [ -x "$(command -v colorls)" ]; then
alias ls='colorls'
elif [ -x "$(command -v gls)" ]; then
alias ls='gls -GpF --color=auto'
else
alias ls='ls -GpF'
fi
alias la='ls -A'
alias ll='ls -l'
alias lala='ls -la'
alias l='ls'
# verbosity tings
alias \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -iv" \
rd="rm -r" \
mkdir="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner"
# cd tings
alias \
cd..='cd ..' \
cd,,=cd.. \
..='cd ..' \
...='cd ../..' \
....='cd ../../..' \
.....='cd ../../../..' \
......='cd ../../../../..'
# utilities and dat
alias foldersizesort='du -sh * |sort -h'
alias chmodxx='chmod +x'
alias ccat='pygmentize -g'
alias grep='grep --color=always'
alias EXIT=exit
alias cls=clear
alias sudo='sudo '
gc () {
# git clone to the right place
cd ~/git-clones &&
git clone "$1" &&
cd -- "$(basename "$1" .git)"
}
if [ -x "$(command -v github-desktop)" ]; then
github () {
github-desktop open "$1" & disown
}
fi
alias dev='github . && code .'
# make 'open' work on loonix
system_type=$(uname -s)
if ! [ "$system_type" = "Darwin" ]; then
alias open='xdg-open'
fi
# if i've got a brewed vim use it
if [ -f "/usr/local/bin/vim" ]; then
alias vim="/usr/local/bin/vim"
fi
# ssh aliases
alias sshengsoc='ssh u1716149@engsoc.warwick.ac.uk'
alias getip="curl icanhazip.com"
alias maps='telnet mapscii.me'
alias pastebinit='pastebinit -P -a god'
# backup aliases
alias bk='_(){ cp $1 $1.bk; }; _'
alias backup='_(){ D=$(date +%d-%m-%Y); cp $@ $@-$D.bk;echo "copied to $@-$D.bk"; }; _'
# compile and run alias for c compiles to temp for run compiles to directory for compile
alias compile='_(){ gcc $1.c -o $1; ./$1 }; _'
alias run='_(){ gcc $1.c -o /tmp/$1; /tmp/$1 }; _'
# sudoify commands
alias netdiscover='sudo netdiscover'
alias apachectl='sudo apachectl'
alias apt='sudo apt'
alias snap='sudo snap'
alias gdebi='sudo gdebi'
if [[ -x "$(command -v brew)" && -x "$(command -v pacapt)" ]]; then
alias pacman=pacapt
alias p=pacman
elif [[ ! -x $(command -v pacman) ]]; then
alias pacman=pacapt
alias pacman='sudo pacapt'
alias p='sudo pacapt'
else
alias pacman='sudo pacman'
alias p='sudo pacman'
fi
# make gpg work
# https://unix.stackexchange.com/questions/257061/
# gentoo-linux-gpg-encrypts-properly-a-file-passed-
# through-parameter-but-throws-i/257065#257065
GPG_TTY=$(tty)
export GPG_TTY
# make hist files go to cache no clog muh homedir
export PYTHONHISTFILE=$HOME/.cache/.python_history
export NODE_REPL_HISTORY=$HOME/.cache/.node_repl_history
export REDISCLI_HISTFILE=$HOME/.cache/.rediscli_history
export USQL_HISTORY=$HOME/.cache/.usql_history
export SDCV_HISTFILE=$HOME/.cache/.sdcv_history
export SQLITE_HISTORY=$HOME/.cache/.sqlite_history
export GRADLE_USER_HOME=$HOME/.cache/gradle
export ANDROID_SDK_HOME=$HOME/.cache/android
export ANDROID_AVD_HOME=$HOME/.cache/androidavd
#export VSCODE_EXTENSIONS=$HOME/.config/vscode
export LESSHISTFILE='-'
export npm_config_devdir=$HOME/.cache/node-gyp
alias wget="wget --hsts-file ~/.cache/wget-hsts"
export PYLINTHOME=$HOME/.cache/pylint.d
export SPICETIFY_CONFIG=$HOME/.config/spacetify
# app specific tings
alias yt="youtube-dl --add-metadata -i" \
alias yta="yt -x -f bestaudio/best" \
alias youtube-dl="youtube-dl --add-metadata -i -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4"
alias synergyoff='launchctl unload /Library/LaunchAgents/com.symless.synergy.synergy-service.plist'
alias synergyon='launchctl load /Library/LaunchAgents/com.symless.synergy.synergy-service.plist'
alias sl='open ~/git-clones/sl_on_touchbar/sl_on_touchbar.app'
alias nothankyouadobe="sudo -H killall ACCFinderSync \"Core Sync\" AdobeCRDaemon \"Adobe Creative\" \
AdobeIPCBroker node \"Adobe Desktop Service\" \"Adobe Crash Reporter\";sudo -H rm -rf \
\"/Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist\" \
\"/Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist\" \
\"/Library/LaunchDaemons/com.adobe.*.plist\""
# nvm configs
# use function for big fast shell ting
function nvm {
if [[ -z $NVM_DIR ]]; then
export NVM_DIR="$HOME/git-clones/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi
nvm "$@"
}
# function node {
# if [ ! -x `command -v node` ]; then
# nvm use default
# fi
# node "$@"
# }
# function npm {
# if [ ! -x `command -v npm` ]; then
# nvm use default
# fi
# npm "$@"
# }
PATH=$PATH:~/Library/Android/sdk/ndk/21.3.6528147
source ~/.local/share/yadm/pull.sh