Skip to content

Instantly share code, notes, and snippets.

View teklynk's full-sized avatar

Ryan Jones teklynk

View GitHub Profile
@teklynk
teklynk / gist:d21f97393fac53b930ce339e0c6e24a8
Created July 29, 2026 05:56
Debian XFCE post install script example. Add your own themes, configs, wallpapers
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Extract any bundled .tar.xz archives into the current working directory
shopt -s nullglob
for archive in "$PWD"/*.tar.xz "$SCRIPT_DIR"/*.tar.xz; do
[ -e "$archive" ] || continue
echo "Extracting $(basename "$archive") into $PWD"
@teklynk
teklynk / gist:6c88b04ff4b51acad63365c9ac98fb0d
Created July 15, 2026 03:41
Bash script that opens Twitch video player and chat pop-out using your default browser. No clutter. Just re-sizable pop-out windows.
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
echo "Usage: twitch channel1 channel2 ..."
exit 1
fi
# --- Detect Default Browser ---
detect_default_browser() {
local default_browser=""
@teklynk
teklynk / gist:a1b356a58f26049abeff2af067c6010d
Created June 29, 2026 19:49
Proton Drive CLI Sync Script with Exclude List and Sync State
#!/bin/bash
# Proton Drive Incremental Sync
# Syncs ~/ProtonSync → /my-files/Sync
set -uo pipefail
DRIVE_BIN="/usr/local/bin/proton-drive"
LOCAL_DIR="$HOME/ProtonSync"
DRIVE_BASE="/my-files/Sync"
@teklynk
teklynk / gist:1be3121af8616b7f682d791d44358429
Created June 12, 2026 17:51
Batch image file convert script
#!/usr/bin/env bash
# ------------------------------------------------------------
# batch_image_convert.sh – batch‑scale images and set 72 dpi.
# Supports: HEIC, JPG/JPEG, PNG → always saved as JPG.
#
# Options:
# -d <dir> Source directory (default: current directory)
# -s <pct> Resize percentage (e.g. 25%). Default: 50%
# ------------------------------------------------------------
@teklynk
teklynk / gist:76c8b5f66a5965d229968c2d92b3e031
Created April 27, 2026 21:29
Command line script to configure wifi on a raspberry pi running raspberry pi os headless
#!/bin/bash
# Function to print colored output
print_green() { echo -e "\033[32m$1\033[0m"; }
print_red() { echo -e "\033[31m$1\033[0m"; }
print_yellow() { echo -e "\033[33m$1\033[0m"; }
echo "--- WiFi Network Scanner (Radio Activation Fix) ---"
# Enable WiFi radio via NetworkManager
#!/bin/bash
rm -rf ~/.local/share/Trash/*
# Add this as a startup script to your Linux OS
@teklynk
teklynk / gist:dd36ce973ec0ce25c496dc1b65784c1a
Created March 6, 2026 20:33
Automatically record your Owncast or other rtmp stream when you go live.
#!/bin/bash
# Configuration variables
API_URL="https://<owncast-server>/api/status"
M3U8_STREAM_URL="https://<owncast-server>/hls/0/stream.m3u8"
RECORDINGS_DIR="<path-to-store-recordings>"
FILE_NAME_PREFIX="stream_"
# Function to check if stream is online
is_stream_online() {
@teklynk
teklynk / gist:778cafd7f08bb03d8df64d066a1b01f7
Created February 16, 2026 06:28
Cloudflare serverless worker: Failover to secondary server if main server is down
export default {
async fetch(request) {
const primaryUrl = 'https://api.example.com';
const fallbackUrl = 'https://api2.example.com';
const url = new URL(request.url);
const path = url.pathname + url.search;
// Define CORS headers
const corsHeaders = {
@teklynk
teklynk / gist:d238f3b41bc2442ea6720330e3cdfd49
Last active February 8, 2026 01:43
Fallback Service Using Cloudflare Workers
export default {
async fetch(request) {
const primaryUrl = 'https://api.example.com';
const fallbackUrl = 'https://api2.example.com';
const url = new URL(request.url);
const path = url.pathname + url.search;
// Try primary
try {
#!/usr/bin/env bash
# enable / disable all UVC devices/cameras
# No arguments - auto‑toggle based on whether the uvcvideo module is loaded
# on = force load the driver
# off = force unload the driver
if [[ -z "$DISPLAY" ]]; then
export DISPLAY=:0
fi