Skip to content

Instantly share code, notes, and snippets.

@kmdm
kmdm / esphome_ble_config.yaml
Last active January 11, 2025 20:58
esphome, esp32 ble tracker and Home Assistant mqtt_room sensors
# MQTT broker configuration
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_username
password: !secret mqtt_password
discovery: False # Only if you use the HA API usually
id: mqtt_client
# Define the room for this ESP32 node
substitutions:
@mkhon
mkhon / zfs_revert.py
Last active August 13, 2024 04:10
This is the original zfs_revert-0.1.py script by Martin Vool <[email protected]> for reverting ZFS transactions by destroying uberblocks, adapted for FreeBSD od (multiple spaces in output).
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Script for reverting ZFS changes by destroying uberblocks
#Author: Martin Vool
#E-mail: [email protected]
#Version: 0.1
#Date: 16 November 2009
@WebFreak001
WebFreak001 / valve-index-linux.md
Last active December 25, 2024 06:25
Getting my Valve Index to run flawlessly on ArchLinux with i3wm

Getting my Valve Index to run flawlessly on ArchLinux with i3wm

I've bought the Valve Index VR headset and wanted to play on Linux. I had done a lot of tinkering with my Linux Machine up to this point so quite a few things on the headset initially had issues working alright.

I have listed all of the problems I encountered on ArchLinux with Valve Index and Steam VR in this post and how I managed to solve nearly all of them.

When I first plugged in my headset, turned on the controllers and started

# This script will create steam shortcuts for all lutris games and add them to the "lutris" category
import os
import shutil
import vdf # from https://pypi.org/project/vdf/
from lutris import pga
import lutris.util.resources as rs
shortcut_path = "/home/buxel/.local/share/Steam/userdata/67626145/config/shortcuts.vdf"
steam_tag = "Lutris"
@sebmarkbage
sebmarkbage / WhyReact.md
Created September 4, 2019 20:33
Why is React doing this?

I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.

I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.

"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr

@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active April 13, 2025 21:25
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@HenningTimm
HenningTimm / rust_mem_profiling.md
Last active February 17, 2025 03:46
Memory profiling Rust code with heaptrack in 2019
@AndrewFarley
AndrewFarley / Gitlab Squasher
Created February 5, 2019 21:21
This simple Python code force squashes, if you call this via a webhook automatically via gitlab, then "magic" all merges will squash
import os
import flask
import requests
BASE_URL = 'https://YOURGITLABURL/api/v4'
TOKEN = 'YOURADMINAPITOKEN'
app = flask.Flask(__name__)
@leptos-null
leptos-null / YouTube_Music_Client.md
Last active April 12, 2024 03:31
Writing an iOS YouTube Music client

Writing an iOS YouTube Music client

I’ve been using YouTube Music as my main music streaming service for almost a year and a half. The iOS client is great- I’ve never had a single complaint. It’s potentially one of the most bug free apps I’ve ever used, it has an extremely friendly, and simple, graphical interface, and the service itself is great.

I was curious how the client worked in terms of networking, and while curiosity may treat cats poorly, it lands researchers in black sites can provide a lot of insight.

Step 0

The first thing I do when reverse engineering a client is monitor HTTP requests while the application starts up, and when doing the tasks interested in. On a jailbroken iOS device, I use FLEX by FlipBoard.

@danmikita
danmikita / init.vim
Created November 16, 2018 19:16
File preview with FZF, RG, Bat, and Devicons
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
" Files + devicons