This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# remount-circuitpy.sh -- remount a FAT disk, usually CIRCUITPY, so it works | |
# | |
# Works around bug where macOS 14.x causes file corruption on small FAT | |
# filesystems. The remount apparently causes older kernel FAT driver | |
# to be loaded. see https://github.com/adafruit/circuitpython/issues/8449 | |
# | |
# Original author: Tod Kurt @todbot | |
DISKNAME=${1:-CIRCUITPY} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
process_binary() { | |
local binary="$1" | |
echo "[*] Processing $binary..." | |
# Find all linked libraries from the Homebrew prefix | |
local libraries=( | |
$(otool -L "$binary" | grep '/usr/local/opt/' | awk '{print $1}') | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def deBruijn(n, k): | |
''' | |
An implementation of the FKM algorithm for generating the de Bruijn | |
sequence containing all k-ary strings of length n, as described in | |
"Combinatorial Generation" by Frank Ruskey. | |
''' | |
a = [ 0 ] * (n + 1) | |
def gen(t, p): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://github.com/flathub/com.nordpass.NordPass by @FakeShemp | |
# wget https://raw.githubusercontent.com/flathub/com.nordpass.NordPass/e93574f94b4387917fb8d5b0fb725660b2b01817/gcc10.diff | |
# wget https://raw.githubusercontent.com/flathub/com.nordpass.NordPass/e93574f94b4387917fb8d5b0fb725660b2b01817/xz_support.patch | |
# flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08 org.electronjs.Electron2.BaseApp//22.08 | |
# sudo flatpak-builder --install --force-clean build-dir dev.foxglove.Studio.yaml | |
# flatpak run dev.foxglove.Studio | |
app-id: dev.foxglove.Studio | |
base: org.electronjs.Electron2.BaseApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
LINUX_META_PKG='linux-meta' | |
LINUX_PKG='linux-image-unsigned-"$KERNEL_ABI_VERSION"-generic' | |
# Enable apt source repositories | |
sed -i '/^deb /{n; s/^# deb-src/deb-src/;}' /etc/apt/sources.list | |
apt update | |
apt install -y dpkg-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
I asked ChatGPT (GPT-4) to write some Z3 code that tries to generate a string | |
that roughly matches the letter frequency distribution of normal English text. | |
It got the implementation _very_ close on the first try. However, Z3 is not able | |
to make progress on the problem. | |
''' | |
from z3 import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
This file implements a wrapper API over the Triton Inference Server client API. | |
The wrapper API makes it easier to work with models that require pre- or post- | |
processing of their inptus and outputs, like image classification models: | |
model = Model(triton, 'feline_breed') | |
model.input = ImageInput(scaling=ScalingMode.INCEPTION) | |
model.output = ClassificationOutput(classes=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import socket | |
import struct | |
def send_obj(s, obj): | |
# JSON-encoded object with a length prefix (32-bit, big endian, signed?) | |
encoded = json.dumps(obj).encode() | |
s.send(struct.pack('!l', len(encoded)) + encoded) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Only in debootstrap/bin: chvt | |
Only in debootstrap/bin: cpio | |
Only in debootstrap/bin: dumpkeys | |
Only in debootstrap/bin: fgconsole | |
Only in debootstrap/bin: ip | |
Only in debootstrap/bin: journalctl | |
Only in debootstrap/bin: kbd_mode | |
Only in debootstrap/bin: kmod | |
Only in debootstrap/bin: less | |
Only in debootstrap/bin: lessecho |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:buster | |
# Install system dependencies | |
RUN apt update \ | |
&& apt install -y \ | |
supervisor \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY supervisord.conf /etc/supervisor/supervisord.conf |
NewerOlder