Skip to content

Instantly share code, notes, and snippets.

View sortofsleepy's full-sized avatar

Joe sortofsleepy

View GitHub Profile
@sortofsleepy
sortofsleepy / incus.md
Last active December 28, 2025 13:13
Setup notes for Incus on CachyOS

Launching a new instance

incus launch <image> <instance name> 
  • Note you may need to add --config security.nesting=true if using containers(possibly VMs too)

NFTables

@sortofsleepy
sortofsleepy / linux-wifi-solve.md
Last active December 13, 2025 17:14
Ensuring that 6ghz band is enabled in Linux

For reference this was tested on a ASRock A620i AM5 board which should come with a MediaTek MT7922 Wi-Fi 6E wifi card.

Problem: If you're running into slower than expected speeds it just might be due to the 6ghz band being just flat out disabled in the initial install of Linux! Not sure about other distros but at least in CachyOS it is.

Solution:

  1. Create /etc/modprobe.d/cfg80211.conf with: options cfg80211 ieee80211_regdom=US(I'm in the US, look up the region code for your country)
  2. Install/update: wireless-regdb (possibly also crda)
  3. Reboot
  4. Verify with iw reg get, it should show country . You may need to installiw first if it's not already installed with your distro.
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
config.color_scheme = 'Aci (Gogh)'
config.enable_scroll_bar = true
config.initial_cols = 120
config.initial_rows = 30
@sortofsleepy
sortofsleepy / git.md
Created March 1, 2025 16:19
workaround for jujutsu libssh2 and git

Workaround for the following error

Error: failed to authenticate SSH session: Unable to extract public key from private key file: Wron
g passphrase or invalid/unrecognized private key file format; class=Ssh (23)

jj-vcs/jj#5228

@sortofsleepy
sortofsleepy / gist:8f82495c91b7b1740149003d6aa20bc2
Last active March 19, 2025 13:13
ffmpeg command to convert files suitable for Davinci Resolve on Linux
ffmpeg -i <input> -c:v dnxhd -profile:v dnxhr_hq -c:a pcm_s16le <output>.mov
@sortofsleepy
sortofsleepy / archnotes.md
Last active October 17, 2024 03:08
Arch installation notes

Notes on installing Arch

  • This is based on the offical wiki
  • This will install Arch, KDE and Grub.
  • This is just a minimal example with no real special customizations. The point is to remove some of the extra info the typical user likely won't need to worry about (yet)
  • This assumes you've alrady downloaded the Arch iso.
  • Some things may look a bit different for you; trying this on a Hyper-V virtual machine in Windows first.
  • Secure boot will need to be disabled during install. On Hyper-V I'm not sure what the right way is to re-enable but if you're doing an actual install, these are the provided notes

All in all, despite what you may have heard, installing Arch isn't actually that bad as long as you have a basic understanding of the terminal, there's just a lot of things to do to get a basic setup working which you should "hopefully" have at the end of thi

@sortofsleepy
sortofsleepy / timer.rs
Last active October 14, 2024 11:40
setInterval-like behavior in Rust
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
#[derive(Clone)]
struct Cube {
i: Arc<Mutex<i32>>,
}
impl Cube {
@sortofsleepy
sortofsleepy / scale.js
Last active September 23, 2024 13:09
Basic Image scaling
function scaleImage(img, ctx, targetWidth, targetHeight) {
const widthRatio = targetWidth / img.width;
const heightRatio = targetHeight / img.height;
const scale = Math.max(widthRatio, heightRatio);
let finalWidth = img.width * scale;
let finalHeight = img.height * scale;
// calcualte overlap, if any, between final width and contianer with
@sortofsleepy
sortofsleepy / spritesheet.glsl
Created September 10, 2024 21:51
glsl spritesheet helper
// A helper to sample a section of a texture. useful for things like spritesheets.
// texCoord - uvs of the surface you're rendering to
// imageSize - the size of the patch you want to sample
// fulLTextureSize - the full dimensions of the texture you're sampling from
// imageCoord - the x/y value of the section to sample from.
// Sourced from @Gabor on Disccord in the @creativecode server.
vec2 sample_section(
vec2 texCoord,
vec2 imageSize,
@sortofsleepy
sortofsleepy / refs.glsl
Last active August 20, 2024 13:27
Vulkan Buffer Reference basics
// ... version, etc
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
struct SceneDataTable {
uint64_t vertices;
};
layout(buffer_reference, scalar) buffer Vertices { vec4 v[]; };