diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-10-23 15:35:21 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-10-23 15:35:21 +0200 |
| commit | 8690c489ff0a3469a001132803bd5f3ea6da68e3 (patch) | |
| tree | 70e49f8f50e171a9394b61556309ec8a67099a76 /accounts | |
| parent | 1499b2ce8e4fce2f5de90954a68f0bd6934e9a41 (diff) | |
| download | nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.gz nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.bz2 nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.tar.xz nixos-8690c489ff0a3469a001132803bd5f3ea6da68e3.zip | |
yggdrasil-wg: ...
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' |
