Up.
This commit is contained in:
3
home/dot_zim/modules/jl-helper/README.md
Normal file
3
home/dot_zim/modules/jl-helper/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
jl-helper
|
||||
=======
|
||||
|
||||
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
|
||||
62
home/dot_zim/modules/jl-helper/init.zsh
Normal file
62
home/dot_zim/modules/jl-helper/init.zsh
Normal file
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Personal aliases
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Admin
|
||||
#
|
||||
|
||||
alias udvrld='sudo udevadm control --reload-rules && sudo udevadm trigger'
|
||||
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
|
||||
alias vim='lvim' # redirect vim to nvim
|
||||
|
||||
|
||||
#
|
||||
# Mail, internet
|
||||
#
|
||||
|
||||
alias mutt='neomutt -f ${HOME}/Mail/jeff.lance@mala.fr/inbox/'
|
||||
alias neomutt='neomutt -f ${HOME}/Mail/jeff.lance@mala.fr/inbox/'
|
||||
|
||||
|
||||
#
|
||||
# Utilities
|
||||
#
|
||||
|
||||
alias ip='ip -c' # ip address
|
||||
# alias ls='lsd' # pretty ls
|
||||
alias md='mkdir -p' # mkdir alias
|
||||
alias open='xdg-open' # open files
|
||||
alias pips='pip_search' # pip search tool
|
||||
alias rs='rsync -Pavzl' # rsync shortcut
|
||||
alias t='tmux' # tmux
|
||||
alias ta='t a -t' # tmux attach to a session
|
||||
alias tls='t ls' # tmux list sessions
|
||||
alias tn='t n -t' # tmux new session
|
||||
alias tvs='transcode-video --scan' #
|
||||
alias xcolor='xcolor | xclip -i' # xcolor
|
||||
alias yd='yt-dlp' # yt-dlp best download
|
||||
|
||||
|
||||
#
|
||||
# Shortcuts
|
||||
#
|
||||
|
||||
hash -d crs="${HOME}/Cours" # cours
|
||||
hash -d doc="${HOME}/Documents" # documents
|
||||
hash -d dot="${HOME}/dotfiles" # dotfiles
|
||||
|
||||
|
||||
#
|
||||
# Environment
|
||||
#
|
||||
|
||||
# interactive comments
|
||||
setopt interactivecomments
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
Reference in New Issue
Block a user