summaryrefslogtreecommitdiffhomepage
path: root/alias
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-01-04 00:07:22 +0800
committertypebrook <typebrook@gmail.com>2020-01-04 00:07:22 +0800
commiteeb7d09d1cd1eb13804d11e84ed1480e38f463c3 (patch)
tree52caf7a1360f7408cd53eac9c20ddf6d68e1980f /alias
parentbce3980d54e051f68a858114993b1e3901bd4122 (diff)
parent07228d5f372d171618f28a64b446759e7eeadf4a (diff)
Merge commit '07228d5f372d171618f28a64b446759e7eeadf4a' into dev
Diffstat (limited to 'alias')
-rw-r--r--alias34
1 files changed, 18 insertions, 16 deletions
diff --git a/alias b/alias
index a930287..6b5042a 100644
--- a/alias
+++ b/alias
@@ -24,19 +24,24 @@ vs() {
24# shell 24# shell
25alias src="source $HOME/.$(basename $SHELL)rc" 25alias src="source $HOME/.$(basename $SHELL)rc"
26alias ll='ls -alh' 26alias ll='ls -alh'
27alias si='sudo snap install' # snap install 27alias hg='history | grep'
28alias ni='sudo npm install -g' # nodejs install
29alias ss='sudo !!'
30alias hg='history|grep'
31alias rmrf='rm -rf' 28alias rmrf='rm -rf'
32alias rr='move_to_tmp' 29alias rr='move_to_tmp'
33move_to_tmp() { 30move_to_tmp() {
34 mv $@ /tmp 31 mv $@ /tmp
35} 32}
33prompt() {
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
38alias ai='sudo apt install' # apt install 41alias ai='sudo apt install' # apt install
39alias aptu='sudo apt update && sudo apt upgrade' 42alias aptu='sudo apt update && sudo apt upgrade'
43alias si='sudo snap install' # snap install
44alias ni='sudo npm install -g' # nodejs install
40 45
41# cd to DIRs 46# cd to DIRs
42alias ..='cd ..' 47alias ..='cd ..'
@@ -71,9 +76,9 @@ wi() {
71alias ce='crontab -e' 76alias ce='crontab -e'
72 77
73# ranger 78# ranger
74alias r='_ranger-cd' 79alias r='_ranger_cd'
75alias ranrc='vim ~/.config/ranger/rc.conf' 80alias 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}
100alias gls='git log -S' 105alias gls='git log -S'
101alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule 106alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" " -f2)' # cd to first submodule
107github_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
104alias dp='docker ps' 113alias dp='docker ps'
@@ -122,7 +131,7 @@ alias t='tig'
122alias ts='tig status' 131alias ts='tig status'
123alias ta='tig --all' 132alias ta='tig --all'
124alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig' 133alias get-tig='curl -LO https://github.com/typebrook/tig/releases/download/tig-2.5.0/tig'
125upload-tig() { 134upload_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'
138alias adb-list='adb shell dumpsys package d' 147alias adb-list='adb shell dumpsys package d'
139alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*' 148alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*'
140alias adb-last-screenshot='adb pull /sdcard/Screenshots/`adb shell ls -t /sdcard/Screenshots/ | head -1` ~/Desktop' 149alias adb-last-screenshot='adb pull /sdcard/Screenshots/`adb shell ls -t /sdcard/Screenshots/ | head -1` ~/Desktop'
141adb-push() { 150adb_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
191alias data-taiwan-town='curl -o town.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=CD02C824-45C5-48C8-B631-98B205A2E35A' 200alias data-taiwan-town='curl -o town.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=CD02C824-45C5-48C8-B631-98B205A2E35A'
192alias data-taiwan-village='curl -o village.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=B8AF344F-B5C6-4642-AF46-1832054399CE' 201alias data-taiwan-village='curl -o village.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=B8AF344F-B5C6-4642-AF46-1832054399CE'
193alias data-taiwan-poly='curl -O http://download.geofabrik.de/asia/taiwan.poly' 202alias data-taiwan-poly='curl -O http://download.geofabrik.de/asia/taiwan.poly'
194data-taiwan-county-code() { 203alias 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
200alias xi='xsel -ib' 206alias xi='xsel -ib'
@@ -244,13 +250,9 @@ alias cdo='cd ~/git/openmaptiles'
244alias cdS='cd ~/git/StreetComplete' 250alias cdS='cd ~/git/StreetComplete'
245alias cdW='cd ~/git/geoBingAnWeb' 251alias cdW='cd ~/git/geoBingAnWeb'
246alias and='cd ~/git/geoBingAn.Android' 252alias and='cd ~/git/geoBingAn.Android'
247alias cdG='cd ~/git/git'
248alias cdT='cd ~/git/taiwan-topo' 253alias cdT='cd ~/git/taiwan-topo'
249alias cdand='cd ~/git/sample' 254alias cdand='cd ~/git/sample'
250alias cdm='cd ~/git/sharkbig.github.io/rescue' 255alias cdm='cd ~/git/sharkbig.github.io/rescue'
251alias cdmw='cd ~/git/sharkbig.github.io/.github/workflows' 256alias cdmw='cd ~/git/sharkbig.github.io/.github/workflows'
252 257
253repo='git@github.com'
254hub='https://github.com'
255typebrook='git@github.com:typebrook'
256GITHUB_API='https://api.github.com' 258GITHUB_API='https://api.github.com'