Skip to content

Instantly share code, notes, and snippets.

View kelvie's full-sized avatar

Kelvie Wong kelvie

  • Vancouver, B.C., Canada
View GitHub Profile
@kelvie
kelvie / addBase.scad
Created July 30, 2020 02:52
Add a chamfered base to an arbitrary shape in openscad
$eps=0.01;
// min feature size
$fs=0.025;
// angle to render as a single feature in a circle
$fa=3;
// Adds a base to avoid elephant's foot on SLA prints
// when printing Z=0 face downward
// inset defaults to height, layers create a graduation
// Optionally take a 2d base as the second child to avoid a
@kelvie
kelvie / brogue-ce.nix
Last active June 21, 2021 02:45 — forked from benob/brogue-ce.nix
nix package for brogue community edition, with terminal support
#{ fetchurl, SDL2, SDL2_image makeDesktopItem }:
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "brogue-ce";
version = "1.9.3";
src = fetchFromGitHub {
owner = "tmewett";
repo = "BrogueCE";
@kelvie
kelvie / nec_util.h
Created July 31, 2021 17:42
lookup table for converting NEC commands/addresses to the esphome32 remote_transmitter.transmit_nec format
#ifndef UTIL_H
#define UTIL_H
int nec_format(unsigned char b) {
static const int nec_code_table[256] = {
0x00ff, 0x807f, 0x40bf, 0xc03f, 0x20df, 0xa05f, 0x609f, 0xe01f, 0x10ef,
0x906f, 0x50af, 0xd02f, 0x30cf, 0xb04f, 0x708f, 0xf00f, 0x08f7, 0x8877,
0x48b7, 0xc837, 0x28d7, 0xa857, 0x6897, 0xe817, 0x18e7, 0x9867, 0x58a7,
0xd827, 0x38c7, 0xb847, 0x7887, 0xf807, 0x04fb, 0x847b, 0x44bb, 0xc43b,
0x24db, 0xa45b, 0x649b, 0xe41b, 0x14eb, 0x946b, 0x54ab, 0xd42b, 0x34cb,
@kelvie
kelvie / gigabyte-osd-sidekick-reversing.org
Last active December 30, 2022 23:49
reversing notes on gigabyte osd sidekick control of m328

OSD sidekick reversing

Summary

It uses the HID device:

0bda:1100 Realtek Semiconductor Corp. HID Device
@kelvie
kelvie / block-eac.sh
Created February 26, 2022 00:19
Script to block EAC phonehomes temporarily to run elden ring
#!/bin/bash
set -euo pipefail
# Script to temporarily block EAC acesss so Elden Ring can start up
# from dig modules-cdn.eac-prod.on.epicgames.com -- this might be different for
# you
iprange=18.65.229.0/24
sleeptime=10
@kelvie
kelvie / 0001-Add-a-lockdown_hibernate-parameter.patch
Created October 2, 2022 23:39
Enable hibernate during lockdown
From e4db4f07e77feb1c126e7afbf441e9eae34b4e57 Mon Sep 17 00:00:00 2001
From: Kelvie Wong <kelvie@kelvie.ca>
Date: Sun, 2 Oct 2022 13:23:25 -0700
Subject: [PATCH] Add a lockdown_hibernate parameter
This allows the user to tell the kernel that they know better (namely,
they secured their swap properly), and that it can enable hibernation.
Signed-off-by: Kelvie Wong <kelvie@kelvie.ca>
---
@kelvie
kelvie / archwiki-visited-purple.user.js
Created February 22, 2023 04:00
Make archwiki links purple again
// ==UserScript==
// @name Change color of visited links on ArchWiki
// @namespace
// @version 1.0
// @description Changes the color of visited links on wiki.archlinux.org
// @author Kelvie
// @match https://wiki.archlinux.org/*
// @grant GM_addStyle
// ==/UserScript==
@kelvie
kelvie / 2021-10-02-gigabyte-osd-sidekick-reversing.org
Created June 19, 2023 21:58
gigabyte sidekick reversing notes

OSD sidekick reversing

Summary

It uses the HID device:

0bda:1100 Realtek Semiconductor Corp. HID Device
@kelvie
kelvie / fw-amd-13-power-compare.sh
Created January 4, 2024 00:33
compare rapl and battery charge info on Framework AMD 13 (2023 edition)
#!/bin/bash
#
# Comparing the two sources of energy usage on a framework 13 AMD edition
# tempdir=$(mktemp -d)
# cleanup() {
# rm -rf "$tempdir"
# }
@kelvie
kelvie / palnames_v1.json
Last active January 26, 2024 05:09
Pal names in Japanese and English. パルワールドのパル名(英語⇔日本語)
[
{
"id": "1",
"en": "lamball",
"ja": "モコロン"
},
{
"id": "2",
"en": "cattiva",
"ja": "ツッパニャン"