aboutsummaryrefslogtreecommitdiffhomepage
path: root/alias
blob: 62e023b7d4bc9a7cdff27567ae1cb9102547c661 (plain)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# My alias for bash and zsh

# config
alias al="vim $SETTING_DIR/alias && source $SETTING_DIR/alias"
eval "${shell}rc(){
  local RCFILE=$XDG_CONFIG_HOME/${shell}/.${shell}rc
  vim \$RCFILE && source \$RCFILE
}"
alias vimrc='vim ~/.vimrc'
alias tigrc="vim ~/.tigrc"
alias muttrc='vim ~/.config/mutt/muttrc'
alias gitconfig='vim ~/.gitconfig'
alias gpgconfig='vim ~/.gnupg/gpg-agent.conf'
alias sshconfig='vim ~/.ssh/config'
alias sshauth='vim ~/.ssh/authorized_keys'
alias sshknown='vim ~/.ssh/known_hosts'
alias cdconfig='cd ~/config'
alias tmuxconfig='vim ~/.tmux.conf'

# network
alias digg='dig +noall +answer +multiline'

# vim
alias v='vim'
alias vi='vim'
alias v2='vim -Nu ~/.vimrc2'
alias vl="vim -c 'norm '"
#alias vl="vim $(sed -n '/^[^#]/{p;q}' ~/.vim_mru_files)"
alias ve="vim ~/.vimrc"
alias vro='vim -R'
alias vu='vim -u NONE'
alias vq='vim ~/buffer'
alias cdv='cd ~/.vim/vim-init'
vs() { which $1 && vim $(which $1); }

# ssh
alias cdssh='cd ~/.ssh'
alias ptt='ssh ptt'
alias sshv='ssh -t vps'
ssh.tar() {
  prompt-vim "tar cf - foo | ssh vps 'cd ~/Downloads; tar xf -' \nssh vps 'tar czf - --directory=/working/path target' | tar xvzf -"
}
ssh.up() {
  set -o pipefail
  filename=${3:-`basename $1`}
  # Upload to absolution path
  if [[ $2 =~ '^/' ]]; then
    folder=${2%/}
    cat $1 | ssh vps "mkdir -p $folder; cat >${folder}/${filename}" || return 1
    echo Uploaded to ${folder}/${filename}
  # Upload to relative in ~/public/
  else
    folder='~/public/'${2%/}
    cat $1 | ssh vps "mkdir -p $folder; cat >${folder}/${filename}" || return 1
    echo https://topo.tw/p/${2%/}/${filename}
  fi
}
ssh.up.today() {
  DATE=$(date --iso-8601)
  ssh vps mkdir -p ~/public/$DATE
  ssh.up $1 $DATE
}
ssh.down() {
  ssh -t vps rm -rf -i ~/public/"$1"
}

# imap
curl.save_as_mail() {
  curl imaps://mail.topo.tw/INBOX \
      --user pham:`pass mail/pham@mail.topo.tw` \
      -T $1
}
curl.save_as_mail_attachment() {
#TEMPFILE=$(mktemp)
  trap 'rm $TEMPFILE' EXIT
  mail -a $1 -Sexpandaddr /dev/stdout | \
  curl imaps://mail.topo.tw/INBOX \
      --user pham:`pass mail/pham@mail.topo.tw` \
      -T /dev/stdin
}

# Gist
alias g='gist'
alias gl='gist last'
unalias gg &>/dev/null
alias gg='gist grep'

# unix
alias chx='chmod +x'
alias chr='chmod +r'
alias s='sudo systemctl'
alias j='sudo journalctl -xe'
alias ju='sudo journalctl -u'
alias m='mutt'
alias gmail="mutt -F $SETTING_DIR/mutt/muttrc.gmail"
alias ntu="mutt -F $SETTING_DIR/mutt/muttrc.b97602041"
path() { echo $PATH; } # Should not use alias, because $PATH is not initialized
ps1.swap() { 
	if [ -z "$PS1_bak" ]; then PS1_bak="$PS1"
		PS1="${1:->}"
		PS1="${PS1%% } "
	else PS1="$PS1_bak" 
		unset PS1_bak
	fi 
}
fd() { echo /proc/$$/fd; ls -l /proc/$$/fd; }
port() { sudo lsof -i :$1; }
alias ports='sudo lsof -i -Pn | grep LISTEN'
.() {
  source ${@:-$HOME/.$(basename $SHELL)rc}
}
alias ll='ls -lh'
alias lla='ls -lha'
llw() { which $1 | xargs ls -alh; }
alias hg='history | grep'
trash() { mv $@ /tmp/ 2>/dev/null || rm -rf $@; }
rmrf() { rm -rf $@; }
alias rr='_move_to_tmp'
alias sound="echo -ne '\a'"
pst(){ pstree -ps ${1:-$$}; }
alias duu='du -hd 1 . | sort -hr'
name() { find . -iname "$1"; }
alias latest='find . -type f | xargs ls -ltr | tail'
cdp() {
  [[ ! -d $1 ]] && mkdir -p $1
  cd $1
}
_move_to_tmp() { mv $@ /tmp; }
prompt-vim() {
  TMPFILE=$(mktemp)
  echo -e "$@" >$TMPFILE \
  && vim $TMPFILE \
  && sed -i '$ q; s/$/ \\/' $TMPFILE \
  && eval $(<$TMPFILE tee /dev/tty)
  rm $TMPFILE
}
file.sort() {
  find $1 -type f -print0 |\
  xargs -0 ls --sort=size -lh |\
  head -20
}
file.size() {
  find $1 -type f -print0 |\
  xargs -0 ls -l |\
  awk '{ n=int(log($5)/log(2));
           if (n<10) n=10;
           size[n]++ }
       END { for (i in size) printf("%d %d\n", 2^i, size[i])
  }' |\
  sort -n |\
  awk 'function human(x) { x[1]/=1024; if (x[1]>=1024) { x[2]++; human(x) }}
  {
    a[1]=$1;
    a[2]=0;
    human(a);
    printf("%3d%s: %6d\n", a[1],substr("kMGTEPYZ",a[2]+1,1),$2)
  }'
}
highlight() { grep --color -E "$1|\$"; }
alias iso8601='date --iso-8601=minutes'


# pacman
alias pac='sudo pacman -S' # pacman install
alias psy='sudo pacman -Syy'
alias ys='yay -S'
alias pqs='pacman -Qs'
alias pqi='pacman -Qi'
alias ysi='yay -Si'
alias pss='pacman -Ss'
alias yss='yay -Ss'
alias pqi='pacman -Qi'
alias pql='pacman -Qlq'
pqlb() { 
    pacman -Qlq $1 | grep bin
}
alias yql='yay -Ql'
alias pf='pacman -F'
alias yf='yay -F'
alias pfl='pacman -Fl'
alias pqe='pacman -Qqe'
alias pR='sudo pacman -R'
psi() {
  [[ $(pacman -Qqe $1) != '' ]] 2>/dev/null && echo -e "$(tput setaf 13)[Installed]$(tput sgr0)"
  pacman -Si $1
}
pkgbuild() { git clone https://aur.archlinux.org/$1.git; }

# cd to DIRs
alias ..='cd ..'
alias ld='cd -' # last directory
cdg() { 
  target=$(sed 's# #/#g' <<<"$@")
  cd ~/git/$target || cd ~/git 
}
alias cda='mkdir -p ~/data && cd ~/data'
alias cdd='cd ~/Downloads'
alias cdconfig='cd ~/.config'
alias cdD='cd ~/Documents'
alias cdP='cd ~/Pictures'
alias cdpu='cd ~/public'
alias cdV='cd ~/Videos'
alias cdM='cd ~/Music'

# blog
alias cdb='cd ~/blog'
vp() { 
  [[ $HOST = vultr ]] || PREFIX='ssh -qt vps'

  filename="${1%.md}.md"
  post=$(eval $PREFIX find ~/blog/content -name $filename | head -1 | sed 's/\r//')

  if [ -z "$post" ]; then
    echo "sh -c 'cd ~/blog && hugo new posts/$filename'" | eval ${PREFIX}
    post="~/blog/content/posts/$filename"
  fi

  shift
  if [[ $HOST = vultr ]]; then
    vim $@ "$post"
  else
    # Copy from vps
    tmpfile=$(mktemp --suffix .md)
    scp vps:"$post" $tmpfile

    # Edit locally
    vim $tmpfile --cmd "autocmd BufWritePost $tmpfile silent! :!setsid scp % vps:$post &"  && \
    cat $tmpfile | ssh vps "cd ~/blog && cat >$post && git add $post && git commit -m 'Update with vim'" && \
    rm $tmpfile
  fi
}

# git
unalias gc &> /dev/null # override zsh plugin alias
gc() { git clone $1 && cd $(basename ${1%.git}); }
gc1() { git clone --depth=1 $1 && cd $(basename $1); }
gcv() { gc vps:$1; }
alias gls='git log -S'
alias cdgg='cd $(git rev-parse --show-toplevel)'
alias cdgw='cdgg && cd .github/workflows'
alias cdgs='cd $(git submodule status | sed "s/^.//" | cut -d" "  -f2)' # cd to first submodule
alias ch="/home/pham/helper/tools/git/check-repos.sh"

# github
export GITHUB_API='https://api.github.com'
export GITHUB_API_TOKEN="~/.ssh/tokens/github 2>/dev/null)"
alias hub="GITHUB_TOKEN=$GITHUB_API_TOKEN hub"
github() {
  xdg-open https://github.com/$1/$2
}
github_api() {
  curl --header "Authorization: token $GITHUB_API_TOKEN" $GITHUB_API/$@
}
gcg() {
  local user=$1; local repo=$2; shift; shift
  git clone git@github.com:$user/$repo.git $@ && cd $(basename $repo)
}
release() {
  command="github-release.sh\n  github_api_token=$GITHUB_API_TOKEN\n  repo=typebrook/mapstew\n  tag=daily-taiwan-pbf\n  type=asset\n  filename=taiwan-latest.osm.pbf\n  action=upload|overwrite|rename|delete\n  extra="
  prompt "$command"
}
github.asset() {
  curl -LO https://github.com/$1/$2/releases/download/$3/$4
}
github.raw() {
  curl -O https://raw.githubusercontent.com/$1/$2/$3
}

# tig
alias cdt='cd ~/git/tig'
alias t='tig'
alias ts='tig status'
alias ta='tig --all'
upload_tig() {
  github-release.sh \
    github_api_token=$GITHUB_API_TOKEN \
    repo=typebrook/tig \
    tag=LATEST \
    type=asset \
    filename=$(which tig)
    action=overwrite
}

# about custom settings
cdh() { cd $SETTING_DIR/$@; }
alias chh="tig -C $SETTING_DIR status"

# about beancount
alias cdB='cd $HOME/bean'
alias bean='vim $HOME/bean/main.bean'
alias b='bean'

# about vimwiki
alias cdl='cd ~/log'
alias chw='tig -C ~/log'
ww() { entry="${1:-guideline}"; vim ~/log/${entry%%.md}.md; }
wg() { grep -r "$@" --color --exclude-dir={logseq,.git} ~/log; }
wi() { cat ~/log/${1%%.md}.md; }
alias dia='diary'
alias dias='diary specify'
alias diaa='diary print'
alias diat='diary today'

# crontab
alias ce='crontab -e'
alias cl='crontab -l'

# lf
alias r='_lf_cd'
alias l='_lf_cd'
_lf_cd() {
  tempfile=$(mktemp -t tmp.XXXXXX)
  lf --last-dir-path $tempfile

  test -f "$tempfile" && \
  cd -- "$(cat "$tempfile")" && \
  rm -f -- "$tempfile"
}

# disk
alias df='df -h'

# docker
alias dk='docker'
alias dc='docker-compose'
alias dis='docker images'
alias dps='docker ps'
alias dpsa='docker ps -a'
docker.sh() { docker run --rm -it --entrypoint /bin/sh $@; }
docker.bash() { docker run --rm -it --entrypoint /bin/bash $@; }
docker.tags() { curl -s -S "https://registry.hub.docker.com/v2/repositories/$@/tags/" | tee /dev/tty | jq '.results[]["name"]' | sort; }

# Android
alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_'
alias adb.view='adb shell am start -a android.intent.action.VIEW -d' 
alias adb.default='adb shell dumpsys package domain-preferred-apps'
alias adb.list='adb shell dumpsys package d'
alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*'
alias adb.screenshot='DIR=/sdcard/Pictures/Screenshots/; adb pull $DIR/`adb shell ls -t $DIR | head -1` .'
alias adb.camera='DIR=/sdcard/DCIM/Camera; adb pull $DIR/`adb shell ls -t $DIR | head -1` .'
alias adb.camera='DIR=/sdcard/DCIM/Camera; adb pull $DIR/`adb shell ls -t $DIR | head -1` .'
alias adb.input='adb shell input text'
adb.push() { 
  adb push $1 /sdcard/Download 
}

# curl
alias co='curl -O'
alias curl.code='curl -o /dev/null --silent -Iw "%{http_code}"'

# python
alias pip3='python3 -m pip'

# gdal
alias oo='ogr2ogr'
alias oi='ogrinfo -al -so'

# sample file
alias sample.text='curl http://metaphorpsum.com/paragraphs/3/5'
alias sample.gpx='curl -O https://docs.mapbox.com/help/data/run.gpx'
alias sample.geojson='curl -O https://docs.mapbox.com/help/data/stations.geojson'
alias sample.gpkg='curl -O http://www.geopackage.org/data/sample1_1.gpkg'
alias sample.shapefile='curl -O https://docs.mapbox.com/help/data/stations.zip && unzip stations.zip'
alias sample.geotiff='curl -O https://docs.mapbox.com/help/data/landsat.tif'
alias sample.csv='curl -O https://docs.mapbox.com/help/data/airports.csv'
alias sample.svg='curl -O https://docs.mapbox.com/help/data/bicycle-24.svg'
alias sample.mbtiles='curl -O https://docs.mapbox.com/help/data/trails.mbtiles'
alias sample.kml='curl -O https://docs.mapbox.com/help/data/farmers_markets.kml'
alias sample.osm='curl https://api.openstreetmap.org/api/0.6/node/3428095932'
alias sample.poly='curl -O http://download.geofabrik.de/asia/taiwan.poly'
alias sample.gpkg='curl -O http://www.geopackage.org/data/sample1_1.gpkg'
alias sample.mvt='curl -O https://demotiles.maplibre.org/tiles/5/25/14.pbf'
alias sample.lorem='curl -o lorem http://metaphorpsum.com/paragraphs/4/16'
alias proto.mvt='curl -O https://raw.githubusercontent.com/mapbox/vector-tile-spec/master/2.1/vector_tile.proto'
alias proto.osm='curl -O https://raw.githubusercontent.com/openstreetmap/OSM-binary/master/src/osmformat.proto'
alias proto.geobuf='curl -O https://raw.githubusercontent.com/mapbox/geobuf/master/geobuf.proto'
alias data.ical='curl -LO http://www.google.com/calendar/ical/zh-tw.taiwan%23holiday%40group.v.calendar.google.com/public/basic.ics'
taiwan_dem() {
  <<<"http://dtm.moi.gov.tw/不分幅_全台及澎湖.zip" perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg' |\
  xargs curl -Lo taiwan_dem.zip
  unzip -p taiwan_dem.zip dem_20m.tif >20m.tif
}

# data file
alias taiwan='curl -O http://download.geofabrik.de/asia/taiwan-latest.osm.pbf'
alias data.rudymap='curl -O https://raw.githubusercontent.com/alpha-rudy/taiwan-topo/master/styles/mapsforge_style/MOI_OSM.xml'
alias data.rudymap_ele='curl -O http://moi.kcwu.csie.org/osm_elevations/ele_taiwan_10_50_100_500_marker-2019.7.o5m'
data.osm_diff_min() {
  curl https://planet.openstreetmap.org/replication/minute/state.txt \
  | sed -n 2p | cut -d'=' -f2 | sed -r 's#(.{1})(.{3})#00\1/\2#' \
  | xargs -I{} echo 'https://planet.openstreetmap.org/replication/minute/{}'.osc.gz \
  | xargs curl -O
}
data.osm_diff_hour() {
  curl https://planet.openstreetmap.org/replication/hour/state.txt \
  | sed -n 2p | cut -d'=' -f2 | sed -r 's#(.{2})(.{3})#000/0\1/\2#' \
  | xargs -I{} echo 'https://planet.openstreetmap.org/replication/hour/{}'.osc.gz \
  | xargs curl -O
}
# https://data.gov.tw/dataset/7441
alias data.taiwan_town='curl -o town.zip -L  https://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=CD02C824-45C5-48C8-B631-98B205A2E35A'
alias data.taiwan_village='curl -o village.zip -L http://data.moi.gov.tw/MoiOD/System/DownloadFile.aspx\?DATA\=B8AF344F-B5C6-4642-AF46-1832054399CE'
alias data.taiwan_poly='curl -O http://download.geofabrik.de/asia/taiwan.poly'
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 -'

# clipboard
alias xi='xsel -ib'
alias xii='`fc -ln -1` | head -1 | xsel -ib'
alias xo='xsel -ob'
alias xl='history | tail -1 | grep -oP "^\s*[0-9]+\s\s\K.*" | xsel -ib && echo Copied to clipboard && xsel -ob'

# image
image.vertical() { 
  suffix=${1##*.}
  convert "$@" -append $(basename -s .$suffix $1)-$(basename -s .$suffix ${@: -1}).${format:-$suffix}
}
image.horizontal() { 
  ext=${1##*.}
  convert "$@" +append output.$ext
}
image.from_data_url() {
  [[ $1 == '' ]] && echo File name needed && return 1
  xsel -ob | sed -E 's/^.+,//' | base64 -d >$1
  identify $1
}
image.upload() {
  local month=$(date +%Y-%m)
  local filename=${2:-$(date +"%d_%Hh%Mm%Ss").${1##*.}}
  local fpath='$HOME/data/s3.photos/'$month
  cat $1 | ssh vps "mkdir -p $fpath && cat >$fpath/$filename" && \
  echo https://topo.tw/photos/$month/$filename || \
  echo Fail to upload
}
image.text() {
  convert \
    -size 230x130 \
    -background lightblue \
    -font Noto-Sans-Bold \
    -pointsize 25 \
    -fill black \
    -gravity Center \
    caption:"${1:=foo}" \
    -flatten \
    "${2:=foo}".jpg
}

# Reset clock
date-reset() {
  sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
}
alias clock-reset='hwclock --systohc'

# misc
alias foo='echo bar > foo && echo File foo is created && ls -lh foo'
alias bar='echo foo > bar && echo File bar is created && ls -lh bar'
token() {
  cd $SETTING_DIR/tokens && [[ -e $1 ]] && cat $1 || ls -l
}
unalias gr &>/dev/null
gr() { 
  grep -IR $1 .  
}
alias wcl='wc -l'
alias findn='find . -iname'
alias x='xdg-open'
alias yl='youtube-dl'
alias yla='youtube-dl -x --audio-format mp3'
alias editor='select-editor'
alias hp='http-prompt'
alias clocg='cloc --vcs=git'
alias tma='tmux a'
alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm'
alias we='weechat'
alias p8='ping -c 3 8.8.8.8'
pbf() {
  protoc --decode_raw
}
mvt_decode() {
  if [[ ! -t 0 ]]; then
    tmp=$(mktemp)
    cat >$tmp
  else
    tmp=$1
  fi
  mvt_decode.py $tmp | tr \' \" | sed 's/True/true/g' | jq .
}
big52utf8() { 
  iconv -f BIG-5 -t UTF-8 
}
utf82big5() { 
  iconv -t BIG-5 -f UTF-8 
}
urlencode() {
  perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg'
  # Alternative:
  # curl -Gso /dev/null -w %{url_effective} --data-urlencode @- ""
}
bak() {
  cp $1 $1.bak
}
wrap2geojson() { jq -s '{ type: "FeatureCollection", features: . }'; }
alias cdtrash='cd ~/.local/share/Trash'
trash() { mv $@ ~/.local/share/Trash; }
alias ge='graph-easy --boxart'

# task
alias tk='task'
alias tka='task annotate'
alias tkc='task context'
alias tkcn='task context none'
alias tkch='task context home'
alias tkd='task done'
alias tkm='task modify'
alias tkn='task next'
alias tk10='task limit:10 \( status:completed or status:deleted \) rc.report.all.sort:end- all | tee >(sed -n 4p | cut -d" " -f5 | tee >(xargs -i echo Copied {}) | xsel -ib ) '
tkw(){ task $1 mod wait:${2##wait:}; }
alias tkrc='vim ~/.taskrc'
alias cdtk='cd ~/.task'
alias chtk='tig -C ~/.task status'
alias tt='taskwarrior-tui'

# pass
alias chp='tig -C ~/.password-store'
alias cdpass='cd ~/.password-store'
alias chpass='tig -C ~/.password-store'
alias p='pass'
alias pc='pass -c'
alias pe='pass edit'
alias pgn='pass generate --in-place --clip'
alias pgc='pass generate --clip'
words() {
    cat /usr/share/dict/usa | egrep "^[a-z]{4,8}$" | shuf | head -40 | xargs -n${1:-2}
}

# Nginx
alias vgx='sudo vim /etc/nginx/sites-enabled/vps && sudo nginx -t && sudo systemctl reload nginx'
alias cdngx='cd /etc/nginx'

# tmp
alias cdS='cd ~/git/StreetComplete'
alias cdm='cd ~/git/mapstew'
alias cdma='cd ~/git/mapstew-android'
alias cdT='cd ~/git/tilemaker'
alias stew='cd ~/git/mapstew'
alias vc='vultr-cli'
alias xkb='cd $SETTING_DIR && make xkb'
alias thsr='curl -L google.com >/tmp/foo.html && xdg-open /tmp/foo.html'
#hugo(){
#    docker run --rm \
#        -u `id -u`:`id -g` \
#        -v `pwd`:/src \
#        $EXTRA \
#        klakegg/hugo \
#        $@
#}
todo() { cd ~/log && grep -R ' TODO ' --exclude-dir=logseq/; }
fix() { which $1 && grep -Po 'FIXME.*' $(which $1); }
alias ffmpeg='ffmpeg -hide_banner'
alias md='reveal'
alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}'

TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305'
TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312'
TAIPEI_BBOX='121.346,24.926,121.676,25.209'
TAIPEI_BBOX_V='24.926,121.346,25.209,121.676'