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 | |
# Script to create an OpenWrt LXC container in Proxmox | |
# Downloads from openwrt.org with latest stable or snapshot version, detects bridges/devices, IDs, configures network, sets optional password | |
# Pre-configures WAN/LAN in UCI, includes summary and confirmation, optional LuCI install for snapshots with apk | |
# Default resource values | |
DEFAULT_MEMORY="256" # MB | |
DEFAULT_CORES="2" # CPU cores | |
DEFAULT_STORAGE="0.5" # GB |
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 | |
# | |
# Jeff Geerling's super-rudimentary fan controller script for the CM4. | |
# | |
# Use: | |
# 1. Download this script to a path like `/opt/cm4-fan.sh` | |
# 2. Run it with: `nohup bash /opt/cm4-fan.sh` | |
# 3. Profit! | |
# | |
# You should wrap it in a systemd unit file if you want it to persist and come |
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 -x | |
# make_arm64_rpi_kernel_debs.sh | |
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by: | |
# sudo rpi-update | |
# This runs on an arm64 host with arm64 compilation tools... | |
# or with some sort of cross-compilation setup. | |
# Debs are put in $workdir/build | |
# | |
# This will NOT work in Raspbian unless you have an arm64 compilation | |
# environment setup. Appears to work on |
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 python3 | |
import numpy as np | |
import cv2 as cv | |
from matplotlib import pyplot as plt | |
import sys | |
imagename = sys.argv[1] | |
imgcol = cv.imread(imagename) |
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 | |
# resets keyboard; kills all running instances of xcape | |
reset_kbd () { | |
local xcape_cnt=$(pgrep xcape | wc -l) | |
echo " - reset_kbd" | |
echo " - killing $xcape_cnt instances of xcape" | |
setxkbmap -layout us |
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 | |
# update | |
apt -y update | |
apt -y upgrade | |
apt -y dist-upgrade | |
# 5.2 mainline kernel | |
cd /tmp | |
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2-rc6/linux-headers-5.2.0-050200rc6_5.2.0-050200rc6.201906222033_all.deb |
Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:
Considerations to take when live streaming:
The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:
-
Set the buffer size (
-bufsize:v
) equal to the target bitrate (-b:v
). You want to ensure that you're encoding in CBR mode. -
Set up the encoders as shown: