Skip to content

Instantly share code, notes, and snippets.

Slots Tool

I'm running TrueNAS-SCALE-23.10.0.1 on an old Supermicro motherboard in a Genesys S208B-TWIN-ITX-12G chassis. This chassis has hot swappable 3.5" SAS drive bays oriented in two rows of four drives. My storage drives are connected through an LSI Broadcom SAS 9300-8i HBA. My HBA does not support the LOCATE feature, so I cannot blink LEDs to locate hard drives to replace.

In order to quickly associate which hard drive in TrueNAS corresponds to what physical slot it is stored in I wrote a script. This script uses the description column of TrueNAS's Storage Disks table to label what slot a particular drive is installed in. One caveat with this script is I must run it after every reboot or after I install/remove a hard drive, so running sudo slots is now at the beginning of my disk repalcement workflows.

Installation

Copy slots.sh (attached below) to /usr/local/sbin/slots and then run sudo chmod +x /usr/local/sbin/slots. Afterward you will be able to use the tool anywhere by running `sudo

@Robpol86
Robpol86 / ppd.yml
Created April 20, 2022 20:32
fromJson trick for GitHub Actions
name: Parallel Poetry Discovery
on:
push: {branches-ignore: ["**"]}
env:
COMMENT_PFX: "# RPOOLEY "
jobs:
@Robpol86
Robpol86 / gist:6d56e715cb755f06a0984e8cb4ee5e56
Created November 11, 2021 20:15
find /sys/devices/platform -type f
/sys/devices/platform/DIAG_CMD.0/power/control
/sys/devices/platform/DIAG_CMD.0/power/runtime_active_time
/sys/devices/platform/DIAG_CMD.0/power/autosuspend_delay_ms
/sys/devices/platform/DIAG_CMD.0/power/runtime_status
/sys/devices/platform/DIAG_CMD.0/power/runtime_suspended_time
/sys/devices/platform/DIAG_CMD.0/driver_override
/sys/devices/platform/DIAG_CMD.0/modalias
/sys/devices/platform/DIAG_CMD.0/uevent
/sys/devices/platform/SVC00000009:00000002.1/power/control
/sys/devices/platform/SVC00000009:00000002.1/power/runtime_active_time
/*
Designed for makemkvcon running inside a Docker container writing MKV files to /output.
The problem:
makemkvcon creates MKV files with the maximum of 0644 file mode. The current umask limits the maximum file mode, but
does not itself increase permissions (only decreases). This means when a user has a umask of 0002 and touches a new
file, it will have permissions of 664. However when makemkvcon runs MKV files will have permissions of 644.
The solution:
This code compiles into a shared object which is loaded at the beginning of makemkvcon's execution. This will
@Robpol86
Robpol86 / timelapse.md
Created November 30, 2016 03:39 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@Robpol86
Robpol86 / output.txt
Created November 9, 2015 05:43
GoPro Hero3 Black Edition Linux Kernel Failure
(binwalk)support@moops gopro-linux (master) $ git remote -v
origin https://github.com/evilwombat/gopro-linux.git (fetch)
origin https://github.com/evilwombat/gopro-linux.git (push)
(binwalk)support@moops gopro-linux (master) $ git status
# On branch master
nothing to commit, working directory clean
(binwalk)support@moops gopro-linux (master) $ diff .config arch/arm/configs/hero3black-standalone_kernel_defconfig
4c4
< # Sun Nov 8 17:56:15 2015
---
@Robpol86
Robpol86 / git
Last active October 3, 2016 17:23
Setup git.
# Moved to https://github.com/Robpol86/dotfiles/blob/master/bashrc
@Robpol86
Robpol86 / Setup_Debian.md
Last active September 16, 2023 18:48
This is how I setup Debian.

Debian/RasPiOS Setup

Steps written for debian-10.7.0-amd64 and 2020-08-20-raspios-buster-arm64-lite at the time of this writing.

Post-Install: Debian

su -
apt-get update && apt-get install -y sudo
usermod -aG sudo robpol86
@Robpol86
Robpol86 / Install_Fedora.md
Last active August 22, 2020 02:57
This is how I setup my Fedora (or RHEL/CentOS) boxes.

Fedora Server Setup

Steps updated for Fedora Server 28 64-bit DVD ISO.

Installation Options

  • Software selection: Fedora Custom Operating System
    • No add-ons checked.
  • Network & Host Name: Set Hostname
@Robpol86
Robpol86 / SystemSetup_Wii.md
Last active November 24, 2021 12:48
Documenting the way I setup my Nintendo Wii.

System Setup: Wii

This is currently incomplete! I did not document all the IOS changes I've done.

I have a 2008 Nintendo Wii, which will have a 2 GB SD (not SDHC) card that holds ProjectM and Homebrew software, and a 32 GB USB flash drive housing my purchased ripped games on the bottom-most USB port. This guide will assume both flash devices are newly formatted with the SD card being FAT16 and FAT32 for the USB drive.

Install Homebrew Software