Skip to content

Instantly share code, notes, and snippets.

View FlyingFathead's full-sized avatar
💭
Just flyin' around

Harry Horsperg FlyingFathead

💭
Just flyin' around
View GitHub Profile
@FlyingFathead
FlyingFathead / set_primary_display.sh
Last active April 18, 2023 12:08
set_primary_display.sh -- a bash script to set your primary display inside a Linux desktop environment using the terminal
#!/bin/bash
# print a terminal-wide horizontal line with '-' characters
function hr_prn(){
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
}
# Get the list of connected displays and their resolutions
DISPLAYS=($(xrandr | grep " connected" | awk '{print $1}'))
CURRENT_PRIMARY=$(xrandr --query | grep " connected primary" | awk '{print $1}')
@FlyingFathead
FlyingFathead / WebcamReload.lua
Last active June 13, 2024 08:47
OBS Studio Script: WebcamReload v1.1
-- WebcamReload v1.1
-- A simple Lua script to reload your OBS Studio video source (webcam, other UVC sources...) every x minutes.
-- From FlyingFathead (https://github.com/FlyingFathead)
-- For years, OBS has had a problem where UVC video sources (such as USB webcams) are freezing up intermittently.
-- This is "somewhat-of-a-workaround" script to reload a USB video source such as a UVC webcam to prevent freezes.
-- I've ran this in Ubuntu 22.04 & OBS Studio 29.0.2, and it's been working well with a dual webcam setup.
-- Note that you need one script per video source that needs to be reloaded.
@FlyingFathead
FlyingFathead / ubuntu-rpi-linuxmodules.sh
Last active December 6, 2021 03:42
Ubuntu Impish (21.10) Raspberry Pi4B distribution check and 'linux-modules-extra-raspi' "auto-installer" (fingers crossed!)
#!/bin/bash
# this script will download and install the 'linux-modules-extra-raspi' package if:
#
# 1. the Linux distribution is detected as Ubuntu, and
# 2. the mentioned package is not installed on the system according to dpkg.
#
# The packages are:
# On the Raspberry Pi: apt package 'linux-modules-extra[-raspi]', or:
# on x86_64 (amd64) environments, named according to the kernel that's in use.
# is required starting from Ubuntu Impish to install zram-swap
@FlyingFathead
FlyingFathead / parsers.sh
Last active May 4, 2023 08:40
text parsers for bash / gpt-2 etc training data
#!/bin/bash
# idiotproofing, "lol"
echo "bad human/entity! this isn't inteded to be run!"
tail --lines=+8 ./parsers.sh
exit 1
# ===============================================================================
# 1. SPLIT A LARGE FILE WITH GPT-2'S <|endoftext|> DELIMITER AS THE SPLIT POINT.
# ===============================================================================