This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fix stutter issues in games? | |
| # Note that disabling split lock mitigation may introduce security risks, particularly in multi-tenant environments, as it could allow malicious processes to perform denial-of-service attacks. | |
| sudo sysctl kernel.split_lock_mitigate=0 | |
| # Make the setting persist on boot | |
| echo "kernel.split_lock_mitigate=0" | sudo tee /etc/sysctl.d/50-split-lock.conf | |
| sudo sysctl -p /etc/sysctl.d/50-split-lock.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Requires HTTrack to scrape the site and generate html files and assets. | |
| # sudo apt install httrack | |
| # Run ./static_site.sh from the command line. | |
| # Define source and destination paths and domain name | |
| httrackpath=/usr/bin/httrack | |
| domain=example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Example Usage: | |
| # ./yt-dlp-music.sh mp3 https://music.youtube.com/playlist?list=OLAK5uy_nsxFbHsI16bmvO4j8X3mrwMhsORFIOZ1w | |
| output_dir="$HOME/Music" | |
| # YT-DLP (YouTube Downloader) | |
| sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp | |
| sudo chmod a+rx /usr/local/bin/yt-dlp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Name of the Flatpak application | |
| FLATPAK_APP="com.plexamp.Plexamp" | |
| # Check if the app is currently running | |
| if flatpak ps --columns=application | grep -q "^${FLATPAK_APP}$"; then | |
| # If it's running then kill it | |
| flatpak kill "$FLATPAK_APP" | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Dependencies | |
| # YT-DLP (YouTube Downloader) | |
| # sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp | |
| # sudo chmod a+rx /usr/local/bin/yt-dlp | |
| # ffmpeg: Install via apt (apt install ffmpeg) | |
| # mpv: Install via apt (apt install mpv) | |
| # Example: ./stream_record.sh -mpv https://listen.batstationrad.io/hls/1/stream.m3u8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| convert_file() { | |
| local input_file="$1" | |
| local filename=$(basename "$input_file") | |
| local output_dir="$HOME/Videos/converted" | |
| local output_file="$output_dir/${filename%.*}.mp4" | |
| # Create the output directory if it doesn't exist | |
| mkdir -p "$output_dir" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Export your bookmarks from a chromium based browser as a html file | |
| # Use the exported html bookmarks file as the <input_file> | |
| # Run the script | |
| # The script will use cURL to check if a link is dead. It will attempt a check 5 times before removing the link. | |
| #!/bin/bash | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 -f <input_file>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check the current status of WiFi using nmcli | |
| status=$(nmcli -t -f WIFI g) | |
| if [ "$status" = "enabled" ]; then | |
| # WiFi is currently on, so turn it off | |
| echo "Turning WiFi off..." | |
| nmcli radio wifi off | |
| play /usr/share/mint-artwork/sounds/unplug.oga |
NewerOlder