summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/zshrc
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-10-23 15:35:21 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-10-23 15:35:21 +0200
commit8690c489ff0a3469a001132803bd5f3ea6da68e3 (patch)
tree70e49f8f50e171a9394b61556309ec8a67099a76 /accounts/gkleen@sif/zshrc
parent1499b2ce8e4fce2f5de90954a68f0bd6934e9a41 (diff)
downloadnixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar
nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.gz
nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.bz2
nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.xz
nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.zip
yggdrasil-wg: ...
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'