zshrc: add putdir function
recursively HTTP PUT a whole directory if reading fails, attempt listing as directory
This commit is contained in:
parent
fcde6e924e
commit
b563c5bf69
1
.zshrc
1
.zshrc
|
@ -19,6 +19,7 @@ base58gen() { echo $(base64 /dev/urandom | tr -d "\n/+Il0O$2" | head -c ${$(($1/
|
||||||
vid() { echo "VULP$(base64 /dev/urandom | tr -d "\n/+I0Oa-z" | head -c 17)" ; }
|
vid() { echo "VULP$(base64 /dev/urandom | tr -d "\n/+I0Oa-z" | head -c 17)" ; }
|
||||||
tuch() { touch "$@" ; chmod 755 "$@" ; ${EDITOR:-vim} "$@" ; }
|
tuch() { touch "$@" ; chmod 755 "$@" ; ${EDITOR:-vim} "$@" ; }
|
||||||
rot13() { tr 'a-zA-Z' 'n-za-mN-ZA-M' ; }
|
rot13() { tr 'a-zA-Z' 'n-za-mN-ZA-M' ; }
|
||||||
|
putdir(){ find "${@:2}" | while IFS= read fname ; do curl -X PUT --data-binary "@$fname" "$1$fname" || ls -l -- "$fname" | curl -X PUT --data-binary @- "$1$fname" ; done ; }
|
||||||
meili() { curl -X POST "http://$1:7700/indexes/$2?$3" -H 'Content-Type: application/json' --data-binary @- ; }
|
meili() { curl -X POST "http://$1:7700/indexes/$2?$3" -H 'Content-Type: application/json' --data-binary @- ; }
|
||||||
meiliset() { curl -X PATCH "http://$1:7700/indexes/$2/settings" -H 'Content-Type: application/json' --data-binary @- ; }
|
meiliset() { curl -X PATCH "http://$1:7700/indexes/$2/settings" -H 'Content-Type: application/json' --data-binary @- ; }
|
||||||
meilit() { curl "http://$1:7700/tasks/$2" ; }
|
meilit() { curl "http://$1:7700/tasks/$2" ; }
|
||||||
|
|
Loading…
Reference in New Issue