diff options
author | typebrook <typebrook@gmail.com> | 2020-01-04 00:07:22 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-04 00:07:22 +0800 |
commit | eeb7d09d1cd1eb13804d11e84ed1480e38f463c3 (patch) | |
tree | 52caf7a1360f7408cd53eac9c20ddf6d68e1980f /alias | |
parent | bce3980d54e051f68a858114993b1e3901bd4122 (diff) | |
parent | 07228d5f372d171618f28a64b446759e7eeadf4a (diff) |
Merge commit '07228d5f372d171618f28a64b446759e7eeadf4a' into dev
Diffstat (limited to 'alias')
-rw-r--r-- | alias | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -24,19 +24,24 @@ vs() { | |||
24 | # shell | 24 | # shell |
25 | alias src="source $HOME/.$(basename $SHELL)rc" | 25 | alias src="source $HOME/.$(basename $SHELL)rc" |
26 | alias ll='ls -alh' | 26 | alias ll='ls -alh' |
27 | alias si='sudo snap install' # snap install | 27 | alias hg='history | grep' |
28 | alias ni='sudo npm install -g' # nodejs install | ||
29 | alias ss='sudo !!' | ||
30 | alias hg='history|grep' | ||
31 | alias rmrf='rm -rf' | 28 | alias rmrf='rm -rf' |
32 | alias rr='move_to_tmp' | 29 | alias rr='move_to_tmp' |
33 | move_to_tmp() { | 30 | move_to_tmp() { |
34 | mv $@ /tmp | 31 | mv $@ /tmp |
35 | } | 32 | } |
33 | prompt() { | ||
34 | TMPFILE=$(mktemp); echo -e $1 > $TMPFILE && \ | ||
35 | vim $TMPFILE && \ | ||
36 | sed -i '$ q; s/$/ \\/' $TMPFILE && \ | ||
37 | eval $(cat $TMPFILE | tee /dev/tty) | ||
38 | } | ||
36 | 39 | ||
37 | # package | 40 | # package |
38 | alias ai='sudo apt install' # apt install | 41 | alias ai='sudo apt install' # apt install |
39 | alias aptu='sudo apt update && sudo apt upgrade' | 42 | alias aptu='sudo apt update && sudo apt upgrade' |
43 | alias si='sudo snap install' # snap install | ||
44 | alias ni='sudo npm install -g' # nodejs install | ||
40 | 45 | ||
41 | # cd to DIRs | 46 | # cd to DIRs |
42 | alias ..='cd ..' | 47 | alias ..='cd ..' |
@@ -71,9 +76,9 @@ wi() { | |||
71 | alias ce='crontab -e' | 76 | alias ce='crontab -e' |
72 | 77 | ||
73 | # ranger | 78 | # ranger |
74 | alias r='_ranger-cd' | 79 | alias r='_ranger_cd' |
75 | alias ranrc='vim ~/.config/ranger/rc.conf' | 80 | alias ranrc='vim ~/.config/ranger/rc.conf' |
76 | _ranger-cd() { | 81 | _ranger_cd() { |
77 | tempfile="$(mktemp -t tmp.XXXXXX)" | 82 | tempfile="$(mktemp -t tmp.XXXXXX)" |
78 | ranger --choosedir="$tempfile" "${@:-$(pwd)}" | 83 | ranger --choosedir="$tempfile" "${@:-$(pwd)}" |
79 | test -f "$tempfile" && | 84 | test -f "$tempfile" && |
@@ -99,6 +104,10 @@ gcg() { | |||
99 | } | 104 | } |
100 | alias gls='git log -S' | 105 | alias gls='git log -S' |
101 | alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule | 106 | alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule |
107 | github_release_asset() { | ||
108 | command="upload-github-release-asset.sh\n github_api_token=$(cat ~/settings/tokens/github)\n owner=typebrook\n repo=tig\n tag=LATEST\n filename=$(which tig)\n overwrite=false" | ||
109 | prompt "$command" | ||
110 | } | ||
102 | 111 | ||
103 | # docker | 112 | # docker |
104 | alias dp='docker ps' | 113 | alias dp='docker ps' |
@@ -122,7 +131,7 @@ alias t='tig' | |||
122 | alias ts='tig status' | 131 | alias ts='tig status' |
123 | alias ta='tig --all' | 132 | alias ta='tig --all' |
124 | alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig' | 133 | alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig' |
125 | upload-tig() { | 134 | upload_tig() { |
126 | upload-github-release-asset.sh \ | 135 | upload-github-release-asset.sh \ |
127 | github_api_token=$(cat ~/settings/tokens/github) \ | 136 | github_api_token=$(cat ~/settings/tokens/github) \ |
128 | owner=typebrook \ | 137 | owner=typebrook \ |
@@ -138,7 +147,7 @@ alias adb-default='adb shell dumpsys package domain-preferred-apps' | |||
138 | alias adb-list='adb shell dumpsys package d' | 147 | alias adb-list='adb shell dumpsys package d' |
139 | alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*' | 148 | alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*' |
140 | alias adb-last-screenshot='adb pull /sdcard/Screenshots/`adb shell ls -t /sdcard/Screenshots/ | head -1` ~/Desktop' | 149 | alias adb-last-screenshot='adb pull /sdcard/Screenshots/`adb shell ls -t /sdcard/Screenshots/ | head -1` ~/Desktop' |
141 | adb-push() { | 150 | adb_push() { |
142 | adb push $1 /sdcard/Download | 151 | adb push $1 /sdcard/Download |
143 | } | 152 | } |
144 | 153 | ||
@@ -191,10 +200,7 @@ alias data-osm-diff="curl https://planet.openstreetmap.org/replication/minute/st | |||
191 | alias data-taiwan-town='curl -o town.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=CD02C824-45C5-48C8-B631-98B205A2E35A' | 200 | alias data-taiwan-town='curl -o town.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=CD02C824-45C5-48C8-B631-98B205A2E35A' |
192 | alias data-taiwan-village='curl -o village.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=B8AF344F-B5C6-4642-AF46-1832054399CE' | 201 | alias data-taiwan-village='curl -o village.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=B8AF344F-B5C6-4642-AF46-1832054399CE' |
193 | alias data-taiwan-poly='curl -O http://download.geofabrik.de/asia/taiwan.poly' | 202 | alias data-taiwan-poly='curl -O http://download.geofabrik.de/asia/taiwan.poly' |
194 | data-taiwan-county-code() { | 203 | alias data-taiwan-county-code='curl --silent https://www.ris.gov.tw/documents/data/5/1/RSCD0101.txt | iconv -f BIG-5 -t UTF-8 -' |
195 | curl --silent https://www.ris.gov.tw/documents/data/5/1/RSCD0101.txt |\ | ||
196 | iconv -f BIG-5 -t UTF-8 - | ||
197 | } | ||
198 | 204 | ||
199 | # clipboard | 205 | # clipboard |
200 | alias xi='xsel -ib' | 206 | alias xi='xsel -ib' |
@@ -244,13 +250,9 @@ alias cdo='cd ~/git/openmaptiles' | |||
244 | alias cdS='cd ~/git/StreetComplete' | 250 | alias cdS='cd ~/git/StreetComplete' |
245 | alias cdW='cd ~/git/geoBingAnWeb' | 251 | alias cdW='cd ~/git/geoBingAnWeb' |
246 | alias and='cd ~/git/geoBingAn.Android' | 252 | alias and='cd ~/git/geoBingAn.Android' |
247 | alias cdG='cd ~/git/git' | ||
248 | alias cdT='cd ~/git/taiwan-topo' | 253 | alias cdT='cd ~/git/taiwan-topo' |
249 | alias cdand='cd ~/git/sample' | 254 | alias cdand='cd ~/git/sample' |
250 | alias cdm='cd ~/git/sharkbig.github.io/rescue' | 255 | alias cdm='cd ~/git/sharkbig.github.io/rescue' |
251 | alias cdmw='cd ~/git/sharkbig.github.io/.github/workflows' | 256 | alias cdmw='cd ~/git/sharkbig.github.io/.github/workflows' |
252 | 257 | ||
253 | repo='git@github.com' | ||
254 | hub='https://github.com' | ||
255 | typebrook='git@github.com:typebrook' | ||
256 | GITHUB_API='https://api.github.com' | 258 | GITHUB_API='https://api.github.com' |