···1+Scripts
2+=======
3+4+Various scripts and Nushell modules that I maintain or use.
5+6+# Nushell Modules
7+8+## Nebula
9+Wrapper to make setting up new hosts in a nebula network easier.
10+11+12+# Scripts
13+14+## Nushell
15+16+### ADB Auto Connect
17+Automatically find and connect to an Android device with Wireless Debugging over the local network.
18+19+You'll need to create a file at `~/.config/adb-auto-connect.nuon` with the MAC Addresses you want to search for. For example:
20+```json
21+[
22+ "ff:ff:ff:ff:ff:ff",
23+ "aa:aa:aa:aa:aa:aa"
24+]
25+```
26+27+### Auto Benchmark
28+Set up and run a Blender benchmark on the specified device, then automatically compare your results to the results on [Blender Open Data](https://opendata.blender.org/).
29+30+### ln-bin
31+Quickly symlink executable files to `~/.local/bin/`
32+33+### yt-rss
34+Get an RSS feed for the specified YouTube channel.
35+36+## Bash
37+38+### oscavmgr-launch
39+Slightly modified version of Galister's oscavmgr start script. Launches oscavmgr and VrcAdvert together.
+15
bash/oscavmgr-launch.sh
···000000000000000
···1+#!/usr/bin/env bash
2+3+# stop VrcAdvert after OscAvMgr quits
4+trap 'jobs -p | xargs kill' EXIT
5+6+VrcAdvert OscAvMgr 9402 9002 --tracking &
7+8+# If using WiVRn
9+oscavmgr openxr
10+11+## If using ALVR
12+#oscavmgr alvr
13+14+## If using Project Babble and/or EyeTrackVR
15+#oscavmgr babble
+33
nushell/adb-auto-connect.nu
···000000000000000000000000000000000
···1+#!/usr/bin/nu
2+3+const mac = open "~/.config/adb-auto-connect.nuon"
4+5+def main [] {
6+ let connected = (adb devices -l | lines | skip | drop | length) > 0
7+8+ if $connected {
9+ print "Already Connected"
10+ } else {
11+ let ip = ip neigh
12+ | lines
13+ | parse "{ip} {type} {device} lladdr {mac} {status}"
14+ | where mac in $mac
15+ | get ip.0
16+17+ let port = nmap -p 37000-65000 --open --max-retries 1 --min-rate 500000 -T5 -oX - $ip
18+ | lines
19+ | skip 4
20+ | str join "\n"
21+ | from xml
22+ | get content
23+ | where tag == host
24+ | get content.0
25+ | where tag == ports
26+ | get content.0
27+ | where tag == port
28+ | get attributes.portid.0
29+30+ adb connect $"($ip):($port)"
31+ }
32+33+}