Skip to content

Instantly share code, notes, and snippets.

View teklynk's full-sized avatar

Ryan Jones teklynk

View GitHub Profile
@teklynk
teklynk / gist:1ab826c1686a055fb9b77a10781b33d9
Created September 27, 2025 01:36
A Simple Bash Script to Toggle Audio Output on Linux Mint
#!/bin/bash
# pactl list short sinks
#61 alsa_output.usb-SteelSeries_SteelSeries_Arctis_1_Wireless-00.analog-stereo PipeWire s16le 2ch 48000Hz RUNNING
#63 alsa_output.pci-0000_00_1f.3.analog-stereo PipeWire s32le 2ch 48000Hz SUSPENDED
# Set your actual sink names here
SPEAKERS="alsa_output.pci-0000_00_1f.3.analog-stereo"
HEADSET="alsa_output.usb-SteelSeries_SteelSeries_Arctis_1_Wireless-00.analog-stereo"
@teklynk
teklynk / gist:a25e31fd40c0718c263feb95d73081c8
Created August 4, 2025 02:41
Automated Nginx, UFW, Cloudflare IP allow script
#!/bin/bash
# I use this script on a few NGINX servers that are behind Cloudflare. I use it to restrict access and to only allow access from a Cloudflare IP addresses.
# This means that clients must hit cloudflare's proxied DNS first before accessing your website, reventing clients from accessing your server via the host/server IP.
# The script downloads a list of Cloudflare IP addresses, generates a allow list file, restarts NGINX, creates firewall rules using UFW, restarts UFW.
# I run the script as a cron job on a weekly schedule.
# Add this line to your websites nginx config.
# include /etc/nginx/cloudflare_ips.conf;