diff options
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/gkleen@sif/zshrc | 17 |
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 | ||
402 | dichotomic_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 | |||
402 | alias '..'='cd ..' | 419 | alias '..'='cd ..' |
403 | alias -g L='| less' | 420 | alias -g L='| less' |
404 | alias -g S='&> /dev/null' | 421 | alias -g S='&> /dev/null' |