Skip to content

Instantly share code, notes, and snippets.

metaquanta / gist_dark_mode.js
Created Jan 17, 2021
Fix GitHub Gist's dark mode
View gist_dark_mode.js
// ==UserScript==
// @name dark mode -
// @namespace Violentmonkey Scripts
// @match*
// @grant none
// @version 1.0
// @author
// @description 1/15/2021: Gist deserves the same dark mode as GitHub.
// ==/UserScript==
document.firstElementChild.setAttribute("data-color-mode", "dark");
metaquanta /
Created Dec 13, 2020
How to SyscallFilter a systemd unit
# $1 is the command to audit (it will be run)
echo "my pid: $$"
# Log all chidren of this shell
auditctl -a always,exit -S all -F ppid=$$
View inline_date_converter.ts
#!/bin/env -S deno -q run
import yargs from ''
function readStdin(): AsyncIterable<string> {
return {
[Symbol.asyncIterator]: async function* () {
const buffer = new Uint8Array(1024);
const decoder = new TextDecoder();
metaquanta /
Last active Nov 26, 2020
Playing Debian maintainer
metaquanta /
Last active Nov 20, 2020
Install Tails to local disk

In this example I'm installing Tails to the internal storage of an ASUS Chromebook C302 with mrchromebox's EFI firmware. The steps should be the same for any Tails-supported EFI computer. My internal disk is mmcblk0 and its first partition is mmcblk0p1 and my Tails USB drive is sda and its first partition is sda1. Yours may differ, so substitue appropriately.

The Tails installer doesn't seem to want to install to internal storage even though mine's recognized as an SD card.

  1. Boot Tails as normal but set a root password in "Additional Settings".

  2. Launch "Root Terminal".

  3. Create partitions on internal storage with the same geometry as the Tails partitions.

metaquanta / autobacklight
Created Oct 17, 2020
Adjust backlight throughout the day to correspond to the location of the sun
View autobacklight
# /usr/local/bin/autobacklight
now_s=$(date +%s)
noon_s=$(date -d "${SOLAR_NOON}" +%s)
View hilbertcurve.ts
import { AffineTransform } from "./math/2d/AffineTransform";
import { M } from "./math/2d/M";
import { V } from "./math/2d/V";
const R = [
M(1, 0, 0, 1),
M(0, 1, 1, 0),
M(0, 1, 1, 0),
M(-1, 0, 0, -1),
metaquanta /
Created Aug 16, 2020
External monitor mode switching for HiDPI chromebook
# Favor internal HiDPI
# 0: +*eDP-1 3200/293x1800/165+3840+600 eDP-1
# 1: +DP-2 3840/546x2400/352+0+0 DP-2
#xrandr \
# --fb 7040x2400 \
# --output eDP-1 --mode 3200x1800 --pos 3840x600 \
# --output DP-2 --scale 2x2 --mode 1920x1200 --pos 0x0
View gist:f7e53c150e3544b5323ef624990487ec
metaquanta / mozilla-firefox-developer-edition.desktop
Last active Aug 11, 2019
firefox desktop file ( ~/.local/share/applications/.. )
View mozilla-firefox-developer-edition.desktop
[Desktop Entry]
Name=Firefox Quantum: Developer Edition
GenericName=Web Browser
Exec=/home/m/.opt/firefox/firefox-bin %u
# From firefox-esr.desktop