Skip to content

Instantly share code, notes, and snippets.

@bahamas10
bahamas10 / readme.txt
Last active April 4, 2024 08:01
Home Assistant on SmartOS LX Zone
{
"alias": "hass",
"brand": "lx",
"autoboot": true,
"quota": 20,
"delegate_dataset": true,
"kernel_version": "4.3.0",
"image_uuid": "7b5981c4-1889-11e7-b4c5-3f3bdfc9b88b",
"max_physical_memory": 1024,
"nics": [
@bahamas10
bahamas10 / output.txt
Created February 14, 2024 21:19
sm64 decomp errors on m1 mac sonoma
dave - m1book darwin ~/dev/sm64 (git:master) $ gmake VERSION=us -j1
==== Build Options ====
Version: us
Microcode: f3d_old
Target: sm64.us
Compare ROM: yes
Build Matching: yes
=======================
Building general tools...
Building sm64tools...
@bahamas10
bahamas10 / 00-readme.md
Last active September 14, 2023 01:09
smartctl disk monitoring nagios check

check_smartctl_health

Run with no arguments (check all disks)

$ sudo ./check_smartctl_health
ok: all devices healthy (20 total)
$ echo $?
0
@bahamas10
bahamas10 / setInterval.bash
Last active August 7, 2023 09:04
setInterval in bash
#!/usr/bin/env bash
#
# simple bash script to simulate JavaScript's setInterval (blocking)
#
# Author: Dave Eddy <dave@daveeddy.com>
# Date: September 27, 2014
# License: MIT
setInterval() {
local func=$1
@bahamas10
bahamas10 / README.md
Created July 5, 2023 17:36
Convert a stream layout to vertical format

This script can be used to convert a stream layout to a vertical layout.

Before

Screenshot 2023-07-05 at 1 32 18 PM

After

Screenshot 2023-07-05 at 1 32 02 PM

@bahamas10
bahamas10 / 00-readme.md
Created November 28, 2022 19:15
bash background
$ ./bash-background
forked sleep in the background as pid 42335
program is running
waiting for pid 42335...
sleep exited with code 0
program has exited
@bahamas10
bahamas10 / README.md
Last active November 22, 2022 00:26
Void Linux on Raspberry Pi 4

Summary

I'm able to get a Void Linux image (32bit, raspberry pi 2 image) to boot on the raspberry pi 4. Currently, I can get it to boot and even handle upgrading via xbps-install -Su (networked over ethernet), however I can't seem to get it to see the internal wlan (wifi) device.

huge shout out to kodifies on this reddit post for helping me to get this going.

@bahamas10
bahamas10 / 00-readme.md
Created September 9, 2022 18:15
messy script to list disks on illumos with smart and serials
$ ./list-disks
sd43	PBK6S6DX	/dev/rdsk/c11t5000CCA03BB55F69d0s0
sd44	PBK3YTZX	/dev/rdsk/c11t5000CCA03BB04E0Dd0s0
sd45	PBHNTVDX	/dev/rdsk/c11t5000CCA03B5E30DDd0s0
sd46	PBK6DUKX	/dev/rdsk/c11t5000CCA03BB4C385d0s0
sd47	PBK67YGX	/dev/rdsk/c11t5000CCA03BB47A55d0s0
sd48	PBHP4V9X	/dev/rdsk/c11t5000CCA03B5ED5FDd0s0
sd49	PBHMRA6X	/dev/rdsk/c11t5000CCA03B5C3981d0s0
sd50	PBK3K0PX	/dev/rdsk/c11t5000CCA03BAF8E19d0s0
@bahamas10
bahamas10 / main.c
Created March 21, 2022 20:41
edge triggered illumos bug
#include <err.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
void write_to_event_fd(int event_fd) {
@bahamas10
bahamas10 / 00-readme.md
Last active March 21, 2022 20:26
epoll difference from illumos and linux

See the block comment in eventfd-test.c for more information:

cc eventfd-test.c -lpthread -o eventfd-test
./eventfd-test

Example output on hardware virtalized Linux:

$ ./eventfd-test
iterations: 5