Skip to content

Instantly share code, notes, and snippets.

View rakslice's full-sized avatar

rakslice rakslice

View GitHub Profile
@rakslice
rakslice / rfkillcheck
Last active August 28, 2024 09:20
An ifupdown-ng executor fragment to check if the wlan is disabled by rfkill before trying to bring it up
#!/bin/sh
# /usr/libexec/ifupdown-ng/rfkillcheck
rfkill_iface=wlan0
rfkill_file=/sys/class/rfkill/rfkill1/soft
check() {
if [ "$IFACE" = "$rfkill_iface" ] && [ "$PHASE" = "pre-up" ]; then
@rakslice
rakslice / mastodon_internal_links.js
Created August 6, 2024 05:19
Userscript to redirect mastodon remote links matching the usual pattern to the local instance
@rakslice
rakslice / remap_downshift_home_and_end.js
Created August 6, 2024 02:53
remap home and end for braindead downshift search combo box behaviour on MDN
// ==UserScript==
// @name remap home and end for downshift
// @namespace http://rakslice.net/userscripts/remap_downshift_home_and_end
// @version 2024-08-06
// @description remap home and end for braindead downshift search combo box behaviour on MDN
// @author rakslice
// @match https://developer.mozilla.org/*
// @grant none
// @require https://code.jquery.com/jquery-3.7.1.min.js
// ==/UserScript==
@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: