Skip to content

Instantly share code, notes, and snippets.

View flexiondotorg's full-sized avatar
❄️
Nix & NixOS

Martin Wimpress flexiondotorg

❄️
Nix & NixOS
View GitHub Profile
@flexiondotorg
flexiondotorg / twitch-metrics.sh
Last active December 16, 2021 07:00
Get Twitch channel metrics via DecAPI
#!/usr/bin/env bash
TWITCH_CHANNEL="wimpysworld"
METRICS_PATH="${HOME}/Studio/OBS/twitch-metrics"
mkdir -p "${METRICS_PATH}"
for ENDPOINT in $(wget -q https://decapi.net/twitch/ -O - | jq -r '[.endpoints[] | select(contains("CHANNEL")) | select(contains("USER") | not)] | @tsv'); do
ENDPOINT_NAME=$(echo "${ENDPOINT}" | cut -d'/' -f5)
ENDPOINT_URL="${ENDPOINT//\{CHANNEL\}/${TWITCH_CHANNEL}}"
# Get the 5 most recent followers and skip deprecated endpoints.
@flexiondotorg
flexiondotorg / streamdeck.sh
Last active September 19, 2022 13:34
Install StreamDeck Unix on Ubuntu
#!/usr/bin/env bash
if [ "$(id -u)" -ne 0 ]; then
echo "ERROR! Must be root."
exit 1
fi
export GOPATH="/tmp/go"
if [ -d "${GOPATH}" ]; then
rm -rf "${GOPATH}"
@flexiondotorg
flexiondotorg / aitums-butler.py
Last active November 3, 2021 13:31
Aitum's Butler PoC
#!/usr/bin/env python3
import argparse
import http.server
import signal
import socketserver
import subprocess
import sys
from urllib.parse import urlparse
@flexiondotorg
flexiondotorg / install_dockerslim.sh
Created September 17, 2021 14:00
DockerSlim scripted install
#!/usr/bin/env bash
function get_dockerslim() {
local DIST=""
local EXT=""
local FILENAME=""
local KERNEL=""
local MACHINE=""
local TMP_DIR=""
local URL=""
@flexiondotorg
flexiondotorg / tlp-stat.md
Created April 14, 2021 09:39
tlp-stat for USB audio suspend bug
--- TLP 1.3.1 --------------------------------------------

+++ Configured Settings:
defaults.conf L0004: TLP_ENABLE="1"
defaults.conf L0005: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0006: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0008: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_BAT="60"
@flexiondotorg
flexiondotorg / hotshot-racing-grand-prix.sh
Created December 20, 2020 23:07
Hotshot Racing Standings
#!/usr/bin/env bash
# The format of the input data file is as follows:
#
# Name, Emoji Country Flag, Space seperated race finishes
#
# For example:
#
# Wimpy,🇬🇧,1 2 3 3 4
# popey,🇬🇧,2 3 1 2 2
@flexiondotorg
flexiondotorg / Ayatana-TODO.md
Last active September 20, 2020 19:44
Migrate Ubuntu Indicators to Ayatana Indicators

Migrate to Webcamoid

  • Update seeds
  • Update and upload ubuntu-mate-meta

Migrate to Ayatana Indicators

  • Sync mate-indicators-applet from Debian unstable
  • Modify Ubuntu MATE seeds to include ayatana-indicators-* and artica-greeter
  • Update and upload ubuntu-mate-meta
@flexiondotorg
flexiondotorg / slide-shot.sh
Created January 16, 2020 23:52
Take screenshots suitably scaled for use in Ubuntu Ubiquity slideshows.
#!/usr/bin/env bash
# Grab a screen shot of a window correct scaled for use in the
# Ubuntu Ubiquity slide shows.
RES_X=896
RES_Y=702
# Get the window we want to resize
TMP_XWININFO=$(mktemp -u)
echo -e "Please select the window you\nwould like to screenshot by clicking the\nmouse in that window."
@flexiondotorg
flexiondotorg / Cinnabun.md
Created August 22, 2019 05:09
Install Cinnamon on Ubuntu mini.iso
@flexiondotorg
flexiondotorg / preseed-snaps.sh
Created July 17, 2019 09:34
Pre-seed snaps
#!/usr/bin/env bash
if [ -f build-settings.sh ]; then
source build-settings.sh
else
echo "ERROR! Could not source build-settings.sh."
exit 1
fi
SEED_DIR="/var/lib/snapd/seed"