summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-01-31 19:09:36 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-01-31 19:09:36 +0900
commit167c599d3e40aebd10b5f0eb54fa95e7220f4564 (patch)
tree5ed401604ac408c059e0930257a59a72a8319a1a
parent70c159035de74eb47fd0a590658e12866033c527 (diff)
modified transmission-daemon/settings.json, modified .ssh/config, created bin/ghswh
-rw-r--r--ar/.config/transmission-daemon/settings.json15
-rwxr-xr-xar/.local/bin/ghswh82
-rw-r--r--global/.ssh/config2
3 files changed, 96 insertions, 3 deletions
diff --git a/ar/.config/transmission-daemon/settings.json b/ar/.config/transmission-daemon/settings.json
index 1712475..d4f6f3f 100644
--- a/ar/.config/transmission-daemon/settings.json
+++ b/ar/.config/transmission-daemon/settings.json
@@ -36,14 +36,21 @@
"peer-port-random-on-start": false,
"peer-socket-tos": "le",
"pex-enabled": true,
+ "pidfile": "",
"port-forwarding-enabled": true,
"preallocation": 1,
+ "preferred_transports": [
+ "utp",
+ "tcp"
+ ],
"prefetch-enabled": true,
+ "proxy_url": null,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
- "ratio-limit": 2,
+ "ratio-limit": 2.0,
"ratio-limit-enabled": false,
"rename-partial-files": false,
+ "reqq": 2000,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
@@ -65,13 +72,17 @@
"script-torrent-done-seeding-filename": "",
"seed-queue-enabled": true,
"seed-queue-size": 0,
+ "sequential_download": false,
+ "sleep-per-seconds-during-verify": 100,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 0,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
+ "start_paused": false,
"tcp-enabled": true,
"torrent-added-verify-mode": "fast",
+ "torrent_complete_verify_enabled": false,
"trash-can-enabled": true,
"trash-original-torrent-files": true,
"umask": "022",
@@ -80,4 +91,4 @@
"watch-dir": "/home/si/Torrents",
"watch-dir-enabled": true,
"watch-dir-force-generic": false
-}
+} \ No newline at end of file
diff --git a/ar/.local/bin/ghswh b/ar/.local/bin/ghswh
new file mode 100755
index 0000000..3faec48
--- /dev/null
+++ b/ar/.local/bin/ghswh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# POSIX compliant script to switch GitHub CLI accounts using fzf
+
+set -e
+
+# Check if gh is installed
+if ! command -v gh >/dev/null 2>&1; then
+ printf "Error: gh (GitHub CLI) is not installed\n" >&2
+ exit 1
+fi
+
+# Check if fzf is installed
+if ! command -v fzf >/dev/null 2>&1; then
+ printf "Error: fzf is not installed\n" >&2
+ exit 1
+fi
+
+# Get authentication status and parse accounts with active status
+# Parse the full status output to get hostname, username, login status, and active status
+status_output=$(gh auth status 2>&1)
+
+# Use awk to parse multi-line account information and get both active and inactive accounts
+parsed_data=$(printf "%s\n" "$status_output" | awk '
+ /Logged in to|Failed to log in to/ {
+ # Extract hostname and username
+ match($0, /(Logged in to|Failed to log in to) ([^ ]+) account ([^ ]+)/, arr)
+ hostname = arr[2]
+ username = arr[3]
+ logged_status = (arr[1] == "Logged in to" ? "✓" : "✗")
+ account_key = username "@" hostname
+ accounts[account_key] = logged_status
+ account_order[++order_count] = account_key
+ }
+ /Active account: true/ {
+ # Mark the previous account as active
+ if (account_key != "") {
+ active_account = account_key
+ }
+ }
+ END {
+ # Print active account on first line
+ print "ACTIVE:" active_account
+ # Print other accounts
+ for (i = 1; i <= order_count; i++) {
+ key = account_order[i]
+ # Skip the active account
+ if (key == active_account) continue
+ status = accounts[key]
+ print key " [" status "]"
+ }
+ }
+')
+
+# Extract active account and other accounts
+current_account=$(printf "%s\n" "$parsed_data" | grep "^ACTIVE:" | cut -d: -f2)
+display_accounts=$(printf "%s\n" "$parsed_data" | grep -v "^ACTIVE:")
+
+if [ -z "$display_accounts" ]; then
+ printf "No other accounts found. You are already on the only account.\n" >&2
+ exit 1
+fi
+
+# Use fzf to select account with current account in header
+selected=$(printf "%s\n" "$display_accounts" | fzf --prompt="Switch to: " --header="*$current_account" --height=40% --border --reverse)
+
+if [ -z "$selected" ]; then
+ printf "No account selected\n" >&2
+ exit 1
+fi
+
+# Extract hostname and username from selection
+# Remove status indicator: "username@hostname [✓]" -> "username@hostname"
+selected_clean=$(printf "%s" "$selected" | sed 's/ \[.*\]//')
+hostname=$(printf "%s" "$selected_clean" | cut -d'@' -f2)
+username=$(printf "%s" "$selected_clean" | cut -d'@' -f1)
+
+printf "Switching to %s on %s...\n" "$username" "$hostname"
+
+# Switch to selected account using gh auth switch
+gh auth switch --hostname "$hostname" --user "$username"
+
+printf "Successfully switched to %s@%s\n" "$username" "$hostname"
diff --git a/global/.ssh/config b/global/.ssh/config
index a5d8850..efd7937 100644
--- a/global/.ssh/config
+++ b/global/.ssh/config
@@ -23,7 +23,7 @@ Host epc-portal
IdentityFile ~/.ssh/keys/evcp-LightsailDefaultKey-ap-northeast-2.pem
Host s-onlyone
- HostName 15.165.19.26
+ HostName 3.36.65.18
User ec2-user
IdentityFile ~/.ssh/keys/evcp-LightsailDefaultKey-ap-northeast-2.pem