Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
@bahamas10
bahamas10 / Cargo.toml
Last active March 21, 2022 20:14
illumos LX (void linux) rustup hang - tokio hang bug
[package]
name = "tokio-test"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1.17.0", features = ["full"] }
@bahamas10
bahamas10 / 00-readme.md
Created March 12, 2022 20:48
illumos LX (void linux) rustup hangs

Rust fails to install via rustup - the process hangs when trying to download files.

Quick Fix

The simple fix is:

RUSTUP_USE_CURL=1 ./rustup-init

This will tell rustup-init to use curl instead of reqwest.

@bahamas10
bahamas10 / output.txt
Created January 26, 2022 02:32
void linux in LX rustup hangs
dave - jackett linux ~ $ strace -f ./rustup-init
execve("./rustup-init", ["./rustup-init"], 0x7fffffeff208 /* 47 vars */) = 0
brk(NULL) = 0x1000
uname({sysname="Linux", nodename="jackett.rapture.com", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/tls/x86_64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls/x86_64", 0x7fffffefe2f0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/tls/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls", 0x7fffffefe2f0) = -1 ENOENT (No such file or directory)