Up.
This commit is contained in:
5
home/dot_zim/modules/jl-helper/functions/cpv
Normal file
5
home/dot_zim/modules/jl-helper/functions/cpv
Normal file
@@ -0,0 +1,5 @@
|
||||
cpv() {
|
||||
rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@"
|
||||
}
|
||||
|
||||
compdef _files cpv
|
||||
9
home/dot_zim/modules/jl-helper/functions/dip
Normal file
9
home/dot_zim/modules/jl-helper/functions/dip
Normal file
@@ -0,0 +1,9 @@
|
||||
# vim:et sts=2 sw=2 ft=zsh
|
||||
#
|
||||
# Display ip of the docker container passed as arg
|
||||
#
|
||||
|
||||
|
||||
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${1}
|
||||
|
||||
compdef _files dip
|
||||
10
home/dot_zim/modules/jl-helper/functions/gi
Normal file
10
home/dot_zim/modules/jl-helper/functions/gi
Normal file
@@ -0,0 +1,10 @@
|
||||
# vim:et sts=2 sw=2 ft=zsh
|
||||
#
|
||||
# Get .gitignore from distant api
|
||||
#
|
||||
|
||||
function gi() {
|
||||
curl -sLw "\n" https://www.toptal.com/developers/gitignore/api/"$@" ;
|
||||
}
|
||||
|
||||
compdef _files gi
|
||||
23
home/dot_zim/modules/jl-helper/functions/gip
Normal file
23
home/dot_zim/modules/jl-helper/functions/gip
Normal file
@@ -0,0 +1,23 @@
|
||||
# vim:et sts=2 sw=2 ft=zsh
|
||||
#
|
||||
# Display public ip information
|
||||
#
|
||||
|
||||
URL="ipinfo.io?token=$(pass _api_keys/ipinfo_perso-0)"
|
||||
|
||||
case "${1}" in
|
||||
(-a)
|
||||
curl --silent -L ${URL} > /dev/null | jq ;;
|
||||
(-c)
|
||||
curl --silent -L ${URL} > /dev/null | jq '.city';;
|
||||
(-C)
|
||||
curl --silent -L ${URL} > /dev/null | jq '.country';;
|
||||
(-i)
|
||||
curl --silent -L ${URL} > /dev/null | jq '.ip';;
|
||||
(-r)
|
||||
curl --silent -L ${URL} > /dev/null | jq '.region';;
|
||||
(*)
|
||||
curl --silent -L ${URL} > /dev/null | jq ;;
|
||||
esac
|
||||
|
||||
compdef _files gip
|
||||
6
home/dot_zim/modules/jl-helper/functions/shrinkpdf
Normal file
6
home/dot_zim/modules/jl-helper/functions/shrinkpdf
Normal file
@@ -0,0 +1,6 @@
|
||||
shrinkpdf() {
|
||||
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$(basename -s .pdf ${1})_shrink.pdf" "${1}"
|
||||
}
|
||||
|
||||
compdef _files shrinkpdf
|
||||
|
||||
12
home/dot_zim/modules/jl-helper/functions/update_auth_sock
Normal file
12
home/dot_zim/modules/jl-helper/functions/update_auth_sock
Normal file
@@ -0,0 +1,12 @@
|
||||
update_auth_sock() {
|
||||
local socket_path="$(tmux show-environment | sed -n 's/^SSH_AUTH_SOCK=//p')"
|
||||
|
||||
if ! [[ "$socket_path" ]]; then
|
||||
echo 'no socket path' >&2
|
||||
return 1
|
||||
else
|
||||
export SSH_AUTH_SOCK="$socket_path"
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _files update_auth_sock
|
||||
Reference in New Issue
Block a user