summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/zshrc')
-rw-r--r--accounts/gkleen@sif/zshrc17
1 files changed, 17 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc
index 9fe88163..bcdc662a 100644
--- a/accounts/gkleen@sif/zshrc
+++ b/accounts/gkleen@sif/zshrc
@@ -399,6 +399,23 @@ ssh-installer() {
399 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/gkleen@sif.midgard.yggdrasil $@ 399 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/gkleen@sif.midgard.yggdrasil $@
400} 400}
401 401
402dichotomic_search() {
403 min=$1; shift
404 max=$1; shift
405
406 while [[ $min -lt $max ]]; do
407 # Compute the mean between min and max, rounded up to the superior unit
408 current=$(( (min + max + 1 ) / 2 ))
409 if $@ $current; then
410 min=$current
411 else
412 max=$((current - 1))
413 fi
414 done
415
416 echo $min
417}
418
402alias '..'='cd ..' 419alias '..'='cd ..'
403alias -g L='| less' 420alias -g L='| less'
404alias -g S='&> /dev/null' 421alias -g S='&> /dev/null'