Skip to content

Instantly share code, notes, and snippets.

View rakslice's full-sized avatar

rakslice rakslice

View GitHub Profile
@rakslice
rakslice / day17.cc
Last active December 18, 2023 00:40
AoC 2023 Day 17 cc
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
@rakslice
rakslice / day12.py
Created December 12, 2023 06:48
AoC 2023 Day 12 pt 2.
def contents(filename):
with open(filename, "r") as handle:
return handle.read()
memo = {}
def solver_rec(puz, scores):
key = puz, tuple(scores)
@rakslice
rakslice / day07.py
Created December 7, 2023 05:59
AOC2023 Day 7
import collections
def contents(filename):
with open(filename, "r") as handle:
return handle.read()
def bin_cards(hand, part):
p = collections.Counter()
@rakslice
rakslice / archive.is_bookmarklet.js
Created August 29, 2023 21:39
archive.is bookmarklet
javascript: (() => { var prefix="https://archive.is/newest/"; var wlh = window.location.href; if (!wlh.startsWith(prefix) && (!wlh.startsWith("https://archive.ph/"))) { window.location.href = prefix + wlh.split("?",1)[0]; } })();
@rakslice
rakslice / sol-idle
Last active July 21, 2023 07:03
idle hlt monkey patch for old solaris x86
#!/bin/sh
set -e
set -x
# idle hlt monkey patch for old solaris x86
# based on ian northeast's alt.solaris.x86 post from 2003
# https://groups.google.com/g/alt.solaris.x86/c/eCi8GKouFqg/m/jCnUnhhN7X4J
readval() # Usage: readval {adb address and verb} {type modifier}
{
@rakslice
rakslice / fujitsu_scroll.sh
Last active June 20, 2023 04:21
A script to put together and build fujitsu_scroll modified psmouse module on alpine
#!/bin/bash
set -e
# A script to put together and build fujitsu_scroll modified psmouse module on alpine
if [ ! -d ~/src/aports ]; then
echo "error: you need an aports checkout to get the current kernel source"
exit 1
fi
@rakslice
rakslice / keybase.md
Created November 12, 2022 00:18
keybase.md

Keybase proof

I hereby claim:

  • I am rakslice on github.
  • I am rakslice (https://keybase.io/rakslice) on keybase.
  • I have a public key ASACiA-FYhY0uojbWCxD_w0FSyhFBoqliQQ7Zn95XIXiGwo

To claim this, I am signing this object:

@rakslice
rakslice / B2s.i386-y2k.fragment
Created June 12, 2022 23:14
A fragment for AIX PS/2 1.3's /etc/init.dir/B2s.i386 to set the system time from the hardware clock correctly
#This section replaces date `cat /dev/clock`
# Combines the two suggestions from http://ohlandl.ipv7.net/AIX_1-3/AIX_Set_Date.html
TMPDATE=`cat /dev/clock`
date `echo "$TMPDATE"\
| awk '{printf("12312000.00%s",substr($0,0,2));}'`
date `echo "$TMPDATE"\
| awk '{printf("%s",substr($0,3,11));}'`
@rakslice
rakslice / alpine_linux_lts_5_10_72_1_hp_stream_7.diff
Last active March 20, 2024 22:37
Alpine kernel config changes for HP Stream 7 5709 bay trail tablet (serdev for rtl8723bs bluetooth, axp288 power control & monitoring)
diff --git a/main/linux-lts/APKBUILD b/main/linux-lts/APKBUILD
index fd0941cb33..20cd747404 100644
--- a/main/linux-lts/APKBUILD
+++ b/main/linux-lts/APKBUILD
@@ -238,7 +238,7 @@ cbe85cf34e8420c91d2276c2d2aa0ab5023af68e57a1fa613f073f16a76766c67f585eda71c28f23
16b2d5b0255b37075ba894fc797673d633395907ce0b93400c5a8bd05b512b5cd040b91000fa41f9240d42afc664a69206597d1e3f754a1aa64b9be21a67f5c6 ampere-mt-jade.patch
7b23c573a058c1a88f40ad0f4413d98150accf4485db2db8117fbd4b5561825b0ceeb886421a32daa4620cf06866f0547f8fe0eb8f5a50403ebca8eab1cebc64 config-lts.aarch64
0bd67a64a5cf791a065945fa4c59a9bab783bc3974008c400b74527323d78c8936269f0868ad52ebb557d3ed53e4f4f7458beafc07ba2f0c4dc73cdd681ecb7f config-lts.armv7
-05239a12b2cf373774d5aaf237fb0a02c648c63f6ae7f294b2bc7eb314bfa5b12db1665fc9098c0e65b0c681578786adf803d9ffb7a3dce3985fae257528995a config-lts.x86
+cc90643ddf1451d0ab71358dc20fb6cd76df6d5cf146a74e9c0423e12549221ac1b29c342026c1c914d993e99bcf39769787fc485d70959cf740157b502ed8fa config-lts.x86
@rakslice
rakslice / touchpad_rotation.py
Created September 24, 2021 06:48
A script to watch dbus for kde monitor configuration changes, and update given xinput touchscreen rotation for monitor rotation
#!/usr/bin/python3
import dbus
import sys
import subprocess
from gi.repository import GLib
from dbus.mainloop.glib import DBusGMainLoop