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 | |
| # 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() { |
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; | |
| // Define CORS headers | |
| const corsHeaders = { |
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" |
NewerOlder