diff options
author | Hsieh Chin Fan <typebrook@gmail.com> | 2021-08-07 00:23:16 +0800 |
---|---|---|
committer | Hsieh Chin Fan <typebrook@gmail.com> | 2021-08-07 00:23:16 +0800 |
commit | ad78fb0b6fad07cdfcb5141b395ad373f77a0ff1 (patch) | |
tree | 48132d947e9407bea2f8becde0a77a321992da66 | |
parent | 2bf1e79fb707157fe676fb406f95e14cd09ad70e (diff) | |
parent | 3c534bf7141b01fcd15101bedb599f32214f6a91 (diff) |
Merge remote-tracking branch 'origin/dev' into dev
-rw-r--r-- | alias | 3 | ||||
-rwxr-xr-x | tools/misc/transfer.sh | 22 |
2 files changed, 24 insertions, 1 deletions
@@ -219,6 +219,8 @@ alias ptt='ssh bbsu@ptt.cc' | |||
219 | alias topo='ssh topo.tw' | 219 | alias topo='ssh topo.tw' |
220 | alias geothings-test='ssh geothings@test.geothings.tw' | 220 | alias geothings-test='ssh geothings@test.geothings.tw' |
221 | alias demo='ssh -i ~/.ssh/ec2-nlsc-tileservice.pem ubuntu@demo.geosurvey.io' | 221 | alias demo='ssh -i ~/.ssh/ec2-nlsc-tileservice.pem ubuntu@demo.geosurvey.io' |
222 | alias demo2='ssh -i ~/.ssh/ec2-nlsc-tileservice.pem ubuntu@dev.geosurvey.io' | ||
223 | alias cool='ssh pham@10.0.0.2' | ||
222 | 224 | ||
223 | # Android | 225 | # Android |
224 | alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_' | 226 | alias debug='./gradlew app:installDebug && adb shell am start -n com.geothings.geobingan/.MainActivity_' |
@@ -367,7 +369,6 @@ alias cdtrash='cd ~/.local/share/Trash' | |||
367 | trash() { | 369 | trash() { |
368 | mv $@ ~/.local/share/Trash | 370 | mv $@ ~/.local/share/Trash |
369 | } | 371 | } |
370 | transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name"|tee /dev/null;fi;} | ||
371 | 372 | ||
372 | # task | 373 | # task |
373 | alias tk='task' | 374 | alias tk='task' |
diff --git a/tools/misc/transfer.sh b/tools/misc/transfer.sh new file mode 100755 index 0000000..41fa6c9 --- /dev/null +++ b/tools/misc/transfer.sh | |||
@@ -0,0 +1,22 @@ | |||
1 | #! /bin/env sh | ||
2 | |||
3 | if [ $# -eq 0 ];then | ||
4 | echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2; | ||
5 | return 1; | ||
6 | fi; | ||
7 | if tty -s; then | ||
8 | file="$1"; file_name=$(basename "$file"); | ||
9 | if [ ! -e "$file" ]; then | ||
10 | echo "$file: No such file or directory">&2; | ||
11 | return 1; | ||
12 | fi; | ||
13 | if [ -d "$file" ];then | ||
14 | file_name="$file_name.zip" ,; | ||
15 | (cd "$file" && zip -r -q - .) | curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name" | tee /dev/null,; | ||
16 | else | ||
17 | cat "$file" | curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name" | tee /dev/null; | ||
18 | fi; | ||
19 | else | ||
20 | file_name=$1; | ||
21 | curl --progress-bar --upload-file "-" "https://topo.tw/up/$file_name" | tee /dev/null; | ||
22 | fi; | ||