Skip to content

Instantly share code, notes, and snippets.

View tkodev's full-sized avatar

Tony Ko tkodev

View GitHub Profile
@tkodev
tkodev / .env
Created April 8, 2026 02:59
Servarr stack - docker compose setup
# Put your PIA vpn details here
PIA_REGION=
PIA_USERNAME=
PIA_PASSWORD=
@tkodev
tkodev / export-entries.ts
Created February 6, 2022 04:29
export-entries.ts
import { join as pathJoin, resolve as pathResolve, relative as pathRelative, extname as pathExtname } from 'path'
import glob from 'glob'
import { promisify } from 'util'
import { chunk as toChunks } from 'lodash'
import AdmZip from 'adm-zip'
import { mkdir, readFile } from 'fs'
import rimraf from 'rimraf'
import { BASE_LOCALE } from '@env'
import { encode as encodeBase64 } from 'base-64'
import { snakeCase } from 'change-case'
@tkodev
tkodev / test.md
Created February 6, 2022 01:51
test.md

find usb buses

for usb_ctrl in $(find /sys/bus/usb/devices/usb* -maxdepth 0 -type l); do pci_path="$(dirname "$(realpath "${usb_ctrl}")")"; echo "Bus $(cat "${usb_ctrl}/busnum") --> $(basename $pci_path) (IOMMU group $(basename $(realpath $pci_path/iommu_group)))"; lsusb -s "$(cat "${usb_ctrl}/busnum"):"; echo; done

find iommu groups

for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d);do echo "IOMMU group $(basename "$iommu_group")"; for device in $(\ls -1 "$iommu_group"/devices/); do if [[ -e "$iommu_group"/devices/"$device"/reset ]]; then echo -n "[RESET]"; fi; echo -n $'\t';lspci -nns "$device"; done; done Bus 1 --> 0000:00:14.0 (IOMMU group 2) Bus 001 Device 005: ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick Bus 001 Device 003: ID 0930:6544 Toshiba Corp. TransMemory-Mini / Kingston DataTraveler 2.0 Stick Bus 001 Device 009: ID 05ac:024f Apple, Inc. Air75 Bus 001 Device 011: ID 1038:1294 SteelSeries ApS Arctis