diff options
Diffstat (limited to 'alias')
-rw-r--r-- | alias | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -24,9 +24,7 @@ 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 hg='history|grep' | ||
30 | alias rmrf='rm -rf' | 28 | alias rmrf='rm -rf' |
31 | alias rr='move_to_tmp' | 29 | alias rr='move_to_tmp' |
32 | move_to_tmp() { | 30 | move_to_tmp() { |
@@ -42,6 +40,8 @@ prompt() { | |||
42 | # package | 40 | # package |
43 | alias ai='sudo apt install' # apt install | 41 | alias ai='sudo apt install' # apt install |
44 | 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 | ||
45 | 45 | ||
46 | # cd to DIRs | 46 | # cd to DIRs |
47 | alias ..='cd ..' | 47 | alias ..='cd ..' |
@@ -76,9 +76,9 @@ wi() { | |||
76 | alias ce='crontab -e' | 76 | alias ce='crontab -e' |
77 | 77 | ||
78 | # ranger | 78 | # ranger |
79 | alias r='_ranger-cd' | 79 | alias r='_ranger_cd' |
80 | alias ranrc='vim ~/.config/ranger/rc.conf' | 80 | alias ranrc='vim ~/.config/ranger/rc.conf' |
81 | _ranger-cd() { | 81 | _ranger_cd() { |
82 | tempfile="$(mktemp -t tmp.XXXXXX)" | 82 | tempfile="$(mktemp -t tmp.XXXXXX)" |
83 | ranger --choosedir="$tempfile" "${@:-$(pwd)}" | 83 | ranger --choosedir="$tempfile" "${@:-$(pwd)}" |
84 | test -f "$tempfile" && | 84 | test -f "$tempfile" && |
@@ -104,7 +104,7 @@ gcg() { | |||
104 | } | 104 | } |
105 | alias gls='git log -S' | 105 | alias gls='git log -S' |
106 | 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 | gh-release-asset() { | 107 | gh_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" | 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" | 109 | prompt "$command" |
110 | } | 110 | } |
@@ -131,7 +131,7 @@ alias t='tig' | |||
131 | alias ts='tig status' | 131 | alias ts='tig status' |
132 | alias ta='tig --all' | 132 | alias ta='tig --all' |
133 | 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' |
134 | upload-tig() { | 134 | upload_tig() { |
135 | upload-github-release-asset.sh \ | 135 | upload-github-release-asset.sh \ |
136 | github_api_token=$(cat ~/settings/tokens/github) \ | 136 | github_api_token=$(cat ~/settings/tokens/github) \ |
137 | owner=typebrook \ | 137 | owner=typebrook \ |
@@ -147,7 +147,7 @@ alias adb-default='adb shell dumpsys package domain-preferred-apps' | |||
147 | alias adb-list='adb shell dumpsys package d' | 147 | alias adb-list='adb shell dumpsys package d' |
148 | 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/*' |
149 | 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' |
150 | adb-push() { | 150 | adb_push() { |
151 | adb push $1 /sdcard/Download | 151 | adb push $1 /sdcard/Download |
152 | } | 152 | } |
153 | 153 | ||
@@ -200,10 +200,7 @@ alias data-osm-diff="curl https://planet.openstreetmap.org/replication/minute/st | |||
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' | 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' |
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' | 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' |
202 | 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' |
203 | 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 -' |
204 | curl --silent https://www.ris.gov.tw/documents/data/5/1/RSCD0101.txt |\ | ||
205 | iconv -f BIG-5 -t UTF-8 - | ||
206 | } | ||
207 | 204 | ||
208 | # clipboard | 205 | # clipboard |
209 | alias xi='xsel -ib' | 206 | alias xi='xsel -ib' |