Skip to content

Instantly share code, notes, and snippets.

View researcx's full-sized avatar
💼
Looking for work

Keira T. researcx

💼
Looking for work
View GitHub Profile

Embeddable dynamic images:

PHP:

NGINX line:

location /example.png {
	include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
@researcx
researcx / flist-formatter.py
Created March 27, 2024 21:49
export f-list preferences to plain/readable html
import sys
from bs4 import BeautifulSoup
# usage: python3 flist-formatter.py character-page.html > output.html
file_read = sys.argv[1]
sections = ["Character_FetishlistFave", "Character_FetishlistYes", "Character_FetishlistMaybe", "Character_FetishlistNo"]
with open(file_read, 'r') as f:
@researcx
researcx / config_audio.md
Last active February 16, 2024 17:36
Linux System-wide Audio Tuning [24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer]

24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer

High-quality sampling

ALSA

echo 'defaults.pcm.rate_converter "speexrate_best"' | tee -a .asoundrc
sudo alsactl restore

PulseAudio

sudo echo 'default-sample-format = s24le' | sudo tee -a /etc/pulse/daemon.conf
sudo echo 'default-sample-rate = 192000' | sudo tee -a /etc/pulse/daemon.conf
import json, shlex, sys
from subprocess import Popen
caption = sys.argv[1]
image_caption = ""
if len(sys.argv) == 4:
image_caption = sys.argv[3]
social_media = sys.argv[2].split(',')
is_image = False
@researcx
researcx / base-weechat-matrix-bitlbee-setup.txt
Created February 1, 2020 23:44
Basics on how to install weechat and (optionally) weechat-matrix and/or bitlbee on Arch Linux
## This is the basics on how to install weechat and (optionally) weechat-matrix and/or bitlbee on Arch Linux
# This does not explain how to set up anything beyond that!
# Refer to https://gist.github.com/unendingPattern/26558dfbfd9417157f20b7c236f28f05 (weechat)
# and https://www.bitlbee.org/user-guide.html#quickstart (bitlbee)
# and https://github.com/poljar/weechat-matrix#configuration (weechat-matrix)
# for further information.
## Not using Arch Linux on your main system? Running a server with LXD containers?
# Create and launch a shell into an Arch Linux LXD container:
@researcx
researcx / weatherscript.sh
Created September 25, 2023 12:48
adjust cpu frequency based on time and weather
#!/bin/bash
LAT=53.3963308
LON=-1.5155923
JSON=$(curl -s "https://api.open-meteo.com/v1/forecast?latitude=$LAT&longitude=$LON&current_weather=true")
WEATHERCODE=$(echo $JSON | jq -r '.current_weather.weathercode') # WMO weather interpretation code
IS_DAY=$(echo $JSON | jq -r '.current_weather.is_day') # 1 if the current time step has daylight, 0 at night.
#echo -e "\033[1;33mDBG: IS_DAY=$IS_DAY\033[0m"
#echo -e "\033[1;33mDBG: WEATHERCODE=$WEATHERCODE\033[0m" # 0 for clear sky, 1 for mainly clear, 2 for partly cloudy (see https://open-meteo.com/en/docs#weathervariables)
@researcx
researcx / Auto Filename.md
Last active July 24, 2023 08:31
Automator imageboard style filenames rename Finder Quick Action

Automator -> New Quick Action

Workflow receives current files or folders in any application

Image: Documents

Get Selected Finder Items

Run Shell Script Shell: /bin/zsh - Pass Input: as arguments

@researcx
researcx / void-linux-install.sh
Last active July 14, 2023 21:10
Minimal instructions for installing Void Linux on MBR + Legacy BIOS
# Obtain the latest Void Linux base live ISO from:
# https://voidlinux.org/download/ (plain musl version)
# Write it to a USB drive:
# sudo dd bs=4M if=void-live-x86_64-musl-20181111.iso of=/dev/sdb status=progress oflag=sync
# Switch to bash (easier to use while installing)
bash
# Set UK keymap
@researcx
researcx / statuscheck.js
Created July 2, 2023 15:03
javascript check for live site mirrors and redirect to an archive.today archive if none available
var cachebuster = Math.round(new Date().getTime() / 1000);
var check_file = "static/files/.thumbnails/Imagedump/7cbe510033142eb7943d5b21ca251759fee64292f9f4e86eda9fd4c793343621-150.png?v=" + cachebuster;
var sites = {"https://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.tor.pm/": "false",
"https://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion.re/": "false",
"https://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion.pet/": "false",
"http://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion.ws/": "false",
"http://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion.to/": "false",
"https://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion.foundation/": "false"};
var archive = ["https://archive.is/newest/http://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7ad.onion/",
"https://archive.today/newest/http://7ug46mpbiaurogeospr3vx5kh4ad7bkiduqv7nyvtlm5awkdsve2z7a
@researcx
researcx / proxmox-backup.sh
Last active May 31, 2023 19:20
proxmox containers backup
#!/bin/bash -l
# set -x
# make sure you have zip installed
# running: /path/to/proxmox-backup.sh [0/1]
# use 0 for debugging, 1 to run
# gist.github.com/researcx
# configuration
backups_folder="/Backups/Pi/$hostname" # needs to exist