#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/remote . ~/.zsh/swamp . ~/.zsh/update . ~/public_html/conf/.zsh/git WEBPAGE_DS="https://dataswamp.org/~$(whoami)" ssh-pub () { ssh-agent sh -c 'ssh-add; ssh-add -L' } # https://stackoverflow.com/a/35784688 create-socket () { local name=$1 python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('./${name}')" } ssh-find () { ps -e | grep ssh } ssh-restart () { echo -n "old: " ssh-find sudo service ssh restart echo -n "new: " ssh-find } check-online () { local try_time=3 local test_every=0.1 local url=http://www.google.com while (! wget -q -O /dev/null --no-cache $url); do sleep $test_every try_time-=$test_every (( $slept_time < 0 )) && return 1 done return 0 } alias online=check-online get-ds () { wget $WEBPAGE_DS/$1 } get () { echo $@ | tr ' ' '\n' | parallel wget -nv --no-cache {} } cos () { git-update-dir bad git-update-file wrap-search zsh-update emake swamp-cos }