From d385f4ad4cca206a9e0f6ed7902c11627f1c616a Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Fri, 4 Sep 2026 12:38:11 -0500 Subject: [PATCH] chore: merge domains and openwrt-sftp branches (selected content) - Add openwrt_scripts/install_sftp.sh (OpenWrt SFTP server setup) - Update mac-scripts/tile-windows to simplified version from domains branch - Expand domains/bypass_sites.txt with additional Instagram/Facebook domains (deduplicated; removed duplicate entries) Co-authored-by: Jarvis --- domains/bypass_sites.txt | 28 +++---- mac-scripts/tile-windows/README.md | 2 - .../tile-windows/tile-windows.applescript | 41 ++--------- openwrt_scripts/install_sftp.sh | 73 +++++++++++++++++++ 4 files changed, 91 insertions(+), 53 deletions(-) create mode 100644 openwrt_scripts/install_sftp.sh diff --git a/domains/bypass_sites.txt b/domains/bypass_sites.txt index 8d3b70c..c22dce9 100644 --- a/domains/bypass_sites.txt +++ b/domains/bypass_sites.txt @@ -63,22 +63,6 @@ hotscope.tv imgur.com imgur.io instagram.com -www.instagram.com -i.instagram.com -api.instagram.com -graph.instagram.com -help.instagram.com -about.instagram.com -business.instagram.com -creators.instagram.com -accountscenter.instagram.com -static.cdninstagram.com -scontent.cdninstagram.com -*.instagram.com -*.cdninstagram.com -*.fbcdn.net -*.facebook.com -*.fbsbx.com jtvnw.net kick.com licdn.com @@ -254,4 +238,14 @@ www.adultfriendfinder.com ashleymadison.com www.ashleymadison.com web.libera.com -librea.com \ No newline at end of file +www.instagram.com +i.instagram.com +api.instagram.com +graph.instagram.com +help.instagram.com +about.instagram.com +business.instagram.com +creators.instagram.com +accountscenter.instagram.com +static.cdninstagram.com +scontent.cdninstagram.com diff --git a/mac-scripts/tile-windows/README.md b/mac-scripts/tile-windows/README.md index 72ff859..1faece5 100644 --- a/mac-scripts/tile-windows/README.md +++ b/mac-scripts/tile-windows/README.md @@ -19,8 +19,6 @@ brew install --cask hammerspoon ``` Open Hammerspoon and **grant Accessibility permission** in System Settings → Privacy & Security → Accessibility. -> **Note:** The clickable `.app` searches these known `hs` binary locations automatically: `/opt/homebrew/bin/hs`, `/usr/local/bin/hs`, `/opt/local/bin/hs`, and the Hammerspoon Caskroom path. This is necessary because AppleScript's `do shell script` runs with a minimal PATH that doesn't include your interactive shell's PATH. - ### 2. Install the config ```bash # Back up existing config if you have one diff --git a/mac-scripts/tile-windows/tile-windows.applescript b/mac-scripts/tile-windows/tile-windows.applescript index c81d5fd..bb1e336 100644 --- a/mac-scripts/tile-windows/tile-windows.applescript +++ b/mac-scripts/tile-windows/tile-windows.applescript @@ -4,50 +4,23 @@ -- -- REQUIREMENTS: -- 1. Hammerspoon must be installed and running (https://hammerspoon.org) --- 2. This file's companion hammerspoon-init.lua must be loaded in ~/.hammerspoon/init.lua +-- 2. This file's companion init.lua must be loaded in ~/.hammerspoon/init.lua -- 3. In Hammerspoon → Preferences → "Enable CLI (IPC Server)" must be checked --- (this registers the `hs` command so this script can invoke it) +-- (this registers the `hs` command on your PATH) -- -- BUILD INSTRUCTIONS (creates a double-clickable .app): -- Open Script Editor.app → File → Open... navigate to this file. -- Or use osacompile from Terminal: -- osacompile -o ~/Applications/Tile\ Windows.app tile-windows.applescript -- Then double-click "Tile Windows.app" in Finder/Dock to run it. --- --- NOTE: `do shell script` in AppleScript runs with a minimal PATH, --- so we search known install locations for the `hs` binary. - -property hsBinaryPaths : { ¬ - "/opt/homebrew/bin/hs", ¬ - "/usr/local/bin/hs", ¬ - "/opt/local/bin/hs", ¬ - "/opt/homebrew/Caskroom/hammerspoon/latest/Hammerspoon.app/Contents/Resources/hs" ¬ -} - -on findHsBinary() - repeat with p in hsBinaryPaths - try - do shell script "test -x " & quoted form of p - return p - end try - end repeat - return "" -end findHsBinary - -set hsPath to findHsBinary() - -if hsPath is "" then - display notification "Hammerspoon CLI (hs) not found. Install Hammerspoon and enable IPC Server in Preferences." with title "Tile Windows" subtitle "❌" - return -end if try - do shell script quoted form of hsPath & " -c 'tileTwoWindows()'" + set resultText to do shell script "/opt/homebrew/bin/hs -c 'tileTwoWindows()'" on error errMsg number errNum - -- If the IPC call fails, it likely means Hammerspoon isn't running - display notification "Could not reach Hammerspoon. Make sure Hammerspoon is running and IPC Server is enabled." with title "Tile Windows" subtitle "❌" - return + -- If the IPC call fails, fall back to a friendly notification + display notification "Could not reach Hammerspoon IPC. Make sure Hammerspoon is running and IPC Server is enabled." with title "Tile Windows" subtitle "❌" + return end try --- Brief visual confirmation +-- Optional: brief visual confirmation display notification "Windows tiled ✓" with title "Tile Windows" diff --git a/openwrt_scripts/install_sftp.sh b/openwrt_scripts/install_sftp.sh new file mode 100644 index 0000000..78cad69 --- /dev/null +++ b/openwrt_scripts/install_sftp.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# Install and enable SFTP on OpenWrt using Dropbear. +# Run as root: sh install-sftp.sh + +set -eu + +log() { + printf '%s\n' "[sftp] $*" +} + +if [ "$(id -u)" -ne 0 ]; then + printf '%s\n' "ERROR: run this script as root." >&2 + exit 1 +fi + +if ! command -v opkg >/dev/null 2>&1; then + printf '%s\n' "ERROR: opkg was not found; this does not appear to be OpenWrt." >&2 + exit 1 +fi + +log "Updating package lists" +opkg update + +if opkg list-installed 2>/dev/null | + grep -q '^openssh-sftp-server '; then + log "openssh-sftp-server is already installed" +else + log "Installing openssh-sftp-server" + opkg install openssh-sftp-server +fi + +if [ ! -x /etc/init.d/dropbear ]; then + printf '%s\n' "ERROR: Dropbear init script was not found." >&2 + exit 1 +fi + +log "Enabling Dropbear at boot" +/etc/init.d/dropbear enable + +log "Restarting Dropbear" +/etc/init.d/dropbear restart + +SFTP_SERVER="" + +for candidate in \ + /usr/libexec/sftp-server \ + /usr/lib/sftp-server \ + /usr/lib/openssh/sftp-server +do + if [ -x "$candidate" ]; then + SFTP_SERVER="$candidate" + break + fi +done + +if [ -z "$SFTP_SERVER" ]; then + printf '%s\n' \ + "ERROR: SFTP server binary was not found after installation." >&2 + opkg files openssh-sftp-server 2>/dev/null || true + exit 1 +fi + +log "SFTP server found at: $SFTP_SERVER" +log "SFTP installation completed" + +printf '\n' +printf '%s\n' "Connect with:" +printf '%s\n' " sftp root@" +printf '%s\n' "Example:" +printf '%s\n' " sftp root@192.168.8.1" +printf '\n' +printf '%s\n' \ + "For security, use SFTP from the LAN or VPN only." \ No newline at end of file