From 391be9df437fac531d05a0a16fae19148bf4bd30 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:50:49 -0700 Subject: [PATCH] tail --- users/tao/nushell/extras/tailscale.nu | 22 +++++++++++----------- users/vy/nushell/extras/stuff.nu | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/users/tao/nushell/extras/tailscale.nu b/users/tao/nushell/extras/tailscale.nu index ec504c7..1578e1f 100644 --- a/users/tao/nushell/extras/tailscale.nu +++ b/users/tao/nushell/extras/tailscale.nu @@ -13,7 +13,7 @@ def check-mullvad [] { } # switch to a specific exit node, or none -def tse [exit_node: string = ""] { +def te [exit_node: string = ""] { if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) { print "stop summoning first!" return false @@ -30,7 +30,7 @@ def tse [exit_node: string = ""] { } # list all mullvad exit nodes -def tsx [] { +def tx [] { tailscale exit-node list | lines | drop 4 @@ -43,7 +43,7 @@ tailscale exit-node list # sort mullvad exit nodes by fastest ping def tsp [] { -tsx +tx | where COUNTRY == USA | par-each { insert ping { @@ -66,15 +66,15 @@ tsx } # switch to a random mullvad exit node -def tsr [] { - tsx +def tr [] { + tx | get (random int 0..($in | length)) - | tse $in.IP + | te $in.IP | return $in } -alias ts = tailscale -alias tss = tailscale status -alias tsu = tailscale up -alias tsd = tailscale down -alias tsa = tailscale exit-node suggest +alias t = tailscale +alias ts = tailscale status +alias tu = tailscale up +alias td = tailscale down +alias ta = tailscale exit-node suggest diff --git a/users/vy/nushell/extras/stuff.nu b/users/vy/nushell/extras/stuff.nu index d9534ea..28433a6 100644 --- a/users/vy/nushell/extras/stuff.nu +++ b/users/vy/nushell/extras/stuff.nu @@ -39,7 +39,7 @@ def "config stuff" [] { hx ~/projects/NOflake/users/tao/nushell/stuff.nu } def deluge-gtk [] { - tsr + tr deluge-gtk } alias deluge = deluge-gtk