Various scripts that I maintain
utils scripts
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

rawrsync: new script

+78
+18
README.md
··· 2 2 3 3 Various scripts that I maintain. 4 4 5 + ## rawrsync 6 + Easily sync or deploy projects over rsync. Intended to somewhat replicate CLion's Deployment feature for use with other IDEs. 7 + 8 + Configure with `.rawrsync.toml` in your project root. For example: 9 + ```toml 10 + [org-server-23] 11 + user = "username" 12 + address = "org-server-23.tailnet-name.ts.net" 13 + path = "/home/username/deployment/project/" # Destination path on the server 14 + 15 + [vr-desktop] 16 + user = "username" 17 + address = "vr-desktop.tailnet-name.ts.net" 18 + path = "/home/username/vr/project" 19 + ``` 20 + 21 + See `--help` for usage. 22 + 5 23 ## adb-auto-connect 6 24 Automatically find and connect to an Android device with Wireless Debugging over the local network. 7 25
+60
scripts/rawrsync.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2026 MatrixFurry <matrix@matrixfurry.com> 4 + 5 + use std log 6 + 7 + const config_path: path = ".rawrsync.toml" 8 + 9 + # Intended to somewhat replicate CLion's Deployment feature for use with other IDEs 10 + def main [ 11 + select?: string # Select a configuration by name 12 + --continuous (-c) # Sync on file change 13 + ] { 14 + if not ($config_path | path exists) { 15 + log critical $"Could not find configuration file in current directory \(($config_path)\)" 16 + return 1 17 + } 18 + 19 + let src: path = pwd | path expand 20 + 21 + let config = open $config_path | transpose name data 22 + 23 + let dest: record<user, address, path> = if ($config | length) == 1 { 24 + $config | get 0.data 25 + } else if ($select | is-not-empty) { 26 + let selected_entry = $config | where name == $select 27 + 28 + if ($selected_entry | length) < 1 { 29 + log critical $"Could not find selected configuration \"($select)\"" 30 + return 1 31 + } 32 + 33 + $selected_entry | get 0.data 34 + } else { 35 + $config 36 + | input list -d name "Sync to..." 37 + | get data 38 + } 39 + 40 + if $continuous { 41 + # TODO: only run rsync on changed files 42 + watch --verbose $src {|| sync $src $dest} 43 + } else { 44 + sync $src $dest 45 + } 46 + } 47 + 48 + def sync [ 49 + src: path 50 + dest: record<user, address, path> 51 + ] { 52 + rsync ...[ 53 + -zar # Compress, archive (preserve permissions etc.), recursive 54 + --exclude=.svn --exclude=.cvs --exclude=.DS_Store --exclude=.git --exclude=.hg --exclude=*.hprof --exclude=*.pyc 55 + $src 56 + $"($dest.user)@($dest.address)://($dest.path)" 57 + ] 58 + } 59 + 60 +