Skip to content

Instantly share code, notes, and snippets.

@lightrush
lightrush / 100-qudelix.rules
Created October 9, 2023 22:35
Qudelix 5K udev rule for Chrome app connection over USB
SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", MODE="0660", GROUP="plugdev", TAG+="uaccess"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", , GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
@lightrush
lightrush / README.md
Last active March 5, 2022 22:34
Framework Storage Expansion Card (SEC) 1TB vs WD SN850 1TB in a Pluggable NVMe-to-USB enclosure

Framework Storage Expansion Card (SEC) 1TB vs WD SN850 1TB in a Pluggable NVMe-to-USB enclosure

Tests

4k-random-write

fio --name=write_iops --size=10G \
--time_based --runtime=60s --ramp_time=2s --ioengine=libaio --direct=1 \
--verify=0 --bs=4K --iodepth=64 --rw=randwrite --group_reporting=1
@lightrush
lightrush / denoise
Last active March 2, 2022 23:32
Mic echo cancellation and noise suppression with PulseAudio and RNNoise
#!/bin/sh
# Usage:
# 1. Select the input (mic) and output (sound card) you want to eliminate echo
# and denoise in your sound settings as default input and output devices.
# 2. Run `denoise`.
#
# This process can be repeated without restarting PulseAudio. Just repeat the steps.
@lightrush
lightrush / killswitch.bat
Created July 10, 2021 18:27 — forked from whoamiTM/killswitch.bat
VPN Kill Switch For Windows | Terminal User Interface | route.exe
@echo off
:: GetAdmin
:-------------------------------------
:: Verify permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
:: On Error No Admin
if '%errorlevel%' NEQ '0' (
echo Getting administrative privileges...
@lightrush
lightrush / README.md
Last active January 29, 2023 23:03
Build images with modified set of packages using OpenWrt's Docker-based Image Builder

Build images with modified set of packages using OpenWrt's Docker-based Image Builder

Possibly the simplest and quickest way to build an image with a modified set of packages is using OpenWrt's Docker imagebuilder container.

Make some workspace dir

mkdir -p openwrt/bin
cd openwrt
@lightrush
lightrush / README.md
Created May 25, 2019 00:26
Filter port forwarding rules based on domain name on OpenWrt
/etc/config/dhcp:

...
# Tell DNSmasq to add IP addressess resolved for the listed domains in the ipset
config dnsmasq
	...
        list ipset '/my.domain.name.com/another.domain.org/ipsetname'
...
@lightrush
lightrush / README.md
Last active September 2, 2023 22:57
Normalize volume level with PulseAudio

Normalize volume level with PulseAudio and simultaneous output

This should work conceptually on any Linux OS with PulseAudio but these particular instructions are for Ubuntu. There are two major reasons for using simultaneous output. The first is self-evident - we can output to say a bluetooth headset and wired headphones at the same time to enable two people to watch a movie with headphones on a single computer. The second reason is a sort of a convenience for setup. We know the simultaneous sink name so the default.pa config would work without modification so long as simultaneous output is enabled. If we were to set this up without that, we'd have to customize the config with our specific device sink name. That's totally doable but personally I always setup simultaneous output. That's why I haven't described the alternative in this gist.

@lightrush
lightrush / README.md
Created November 3, 2017 05:18
X11vnc Systemd Unit File

X11vnc Systemd Unit File

This Systemd unit file starts X11VNC on boot

  1. Set VNC password: sudo x11vnc -storepasswd [YOUR VNC PASSWORD] /etc/x11vnc.passwd
  2. Install Systemd Unit File
sudo cp [path to]/vnc.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vnc.service
@lightrush
lightrush / README.md
Last active July 24, 2023 11:53
Setup Plex with Docker

Setup Plex with Docker

Docker run script and Systemd unit files for setting up Plex using the official image by Plex Inc

Fill in the blanks in plex-docker-run.sh, plex-docker.service, optionally mount-remote-volume.service and save them. Then:

sudo [Path to]/plex-docker-run.sh
sudo cp [Path to]/plex-docker.service /etc/systemd/system/
sudo cp [Path to]/network-internet.service /etc/systemd/system/
# Optionally
background.js:161 MetaMask initialization complete.
background.js:65853 POST https://mainnet.infura.io/metamask 502 ()
RpcSource.handleRequest @ background.js:65853
next @ background.js:58483
HookedWalletSubprovider.handleRequest @ background.js:66600
next @ background.js:58483
handleRequest @ background.js:66887
next @ background.js:58483
FilterSubprovider.handleRequest @ background.js:65981
next @ background.js:58483