Skip to content

Instantly share code, notes, and snippets.

@laytan
laytan / odin.py
Created April 25, 2024 17:40
LLDB script to visualise Odin slices, maps, and strings
import lldb
def is_slice_type(t, internal_dict):
return t.name.startswith("[]") or t.name.startswith("[dynamic]")
class SliceChildProvider:
def __init__(self, val, dict):
self.val = val
def num_children(self):
@laytan
laytan / main.odin
Created April 10, 2024 22:57
Stack traces using Odin instrumentation features
package main
import "core:runtime"
main :: proc() {
context.assertion_failure_proc = print_call_frames
foo()
}
@wallentx
wallentx / extract
Created August 3, 2023 23:50
Easy archive extraction
###########################
# Easy archive extraction!
###########################
extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar -I pigz -xvzf $1 ;;
*.tar.zst) tar -I "zstd -T0" -xvf $1 ;;
*.bz2) bunzip2 $1 ;;

Turn off AER logging for NVMe and event severity corrected

Motherboard: Asus Pro WS WRX80E-SAGE SE WIFI
Card: Asus HYPER M.2 X16 GEN 4 CARD
NVMe: 4x Samsung SSD 980 PRO 1TB
OS: Linux fedora 5.16.12-200.fc35.x86_64

AER, advanced error reporting logs excessively:

@sinofool
sinofool / install_unifi_8_debian_12.txt
Last active April 2, 2024 09:35
Install Unifi Controller on Debian 11 (Bullseye)
# libssl1.1, the only missing mongodb dependency.
# I prefer enable oldstable in case this get backport security patches
echo "deb http://deb.debian.org/debian bullseye main" | sudo tee /etc/apt/sources.list.d/oldstable-bullseye.list
# MongoDB 4.4, [end of life Feb 2024](https://www.mongodb.com/support-policy/lifecycles)
curl -fsSL https://pgp.mongodb.com/server-4.4.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-4.4.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg ] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update && sudo apt-get install mongodb-org-server -y
# Unifi
@floooh
floooh / zig_test_debugging_vscode.md
Last active May 3, 2024 02:00
How to debug Zig tests in VSCode

Tested on macOS:

  1. Install the CodeLLDB VSCode extension. Unlike the debugger in the C/C++ extension, this allows to set breakpoints inside Zig "test" blocks (in the MS C/C++ extension debugger, breakpoints inside test blocks will be disabled once the debugger starts for unknown reasons.
  2. When compiling the test, tell it to also emit a binary: zig test -femit-bin=zig-out/bin/my-test src/bla.zig, otherwise there will be no executable to debug.
  3. The compiled test executable expects the path to the Zig executable as first command line argument, the launch.json file needs to be setup accordingly (note the args item):
@Sunlighter
Sunlighter / README.md
Last active November 12, 2022 11:21
Installing .NET 5 in Amazon Linux 2 for ARM

Installing .NET 5 in Amazon Linux 2 for ARM64

This is a way to install .NET 5 in your home directory without modifying the system.

At the time of this writing, Amazon Linux 2 for ARM64 almost works already, but there is a problem with the ICU library. I will show this problem and how to fix it.

  1. Start Amazon Linux 2 and sign in. (I recommend an m6g.medium instance
@harold-b
harold-b / IntelGfxUbuntu20.04MacBookPro10-1.md
Last active April 6, 2024 17:49
Enable Intel Graphics on Ubuntu 20.04 on MacBook Pro Mid 2012 Retina (10,1)

How to get Intel graphics working on MacBook Pro mid 2012 (10,1) Ubuntu 20.04:

Ubuntu was intalled with the default nvidia drivers that it brought (I believe 3.90)

Clone https://github.com/0xbb/apple_set_os.efi

For details, see the README.md

Build it:

@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active May 4, 2024 00:19
Ubuntu and Debian Cloud images in Proxmox