Skip to content

Instantly share code, notes, and snippets.

View skull-squadron's full-sized avatar
💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s

🏴‍☠️ skull-squadron

💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s
  • (stealth)
  • ATX
  • 09:46 (UTC -07:00)
View GitHub Profile
@skull-squadron
skull-squadron / sketch.ino
Created February 28, 2025 08:57
Keyestudio 4wd BT Car Lesson 17 Bluetooth Multifunctional Car KS0559
// *******************************************************************************
// Adapted from https://docs.keyestudio.com/projects/KS0559/en/latest/Arduino/arduino.html
/*
Keyestudio 4wd BT Car
Lesson 17
Bluetooth Multifunctional Car
http://www.keyestudio.com
*/
#define HAS_LED // Comment out if the LED module is not attached to D9
@skull-squadron
skull-squadron / ddg_bangs.rb
Last active February 7, 2025 13:17 — forked from nogweii/ddg_bangs.rb
get a list of all of duckduckgo's bangs in a programmatic manner, useful for scripting
# frozen_string_literal: true
require 'cgi'
require 'json'
require 'open-uri'
require 'yaml'
UA = 'Ruby script to read the full list of bangs/2.0 ; https://gist.github.com/skull-squadron/f53c38c678045660a36a5fcd1f50196a'
module Flow
@skull-squadron
skull-squadron / fix-aafire-aalib-gentoo.patch
Created October 29, 2024 02:36
Patch to make aafire from aalib to stablize frame rate
--- a/src/aafire.c
+++ b/src/aafire.c
@@ -2,4 +2,5 @@
#include <stdlib.h> /* exit() */
+#include <time.h>
#include "aalib.h"
#define XSIZ aa_imgwidth(context)
@@ -135,14 +136,29 @@ drawfire (void)
aa_scrheight (context));
@skull-squadron
skull-squadron / silence-ruby-3.3.5-rdoc-psych-warning.bash
Last active October 28, 2024 10:58
HACK Fix ruby 3.3.5 annoyance
#!/usr/bin/env bash
set -eEuo pipefail
# https://stackoverflow.com/questions/79015158/why-is-gem-clean-reporting-multiple-ambiguous-references-to-the-default-psych
# https://stackoverflow.com/q/79015158
targets() {
find "$(gem env home)"/specifications/default -name 'rdoc-*.gemspec'
}
@skull-squadron
skull-squadron / count-files.c
Created October 18, 2024 11:21
count files (works on macOS and Linux)
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __APPLE__
#include <sys/syslimits.h>
#endif
#include <sys/types.h>
int count(char *path, size_t n) {
@skull-squadron
skull-squadron / configure-colorizer
Created September 13, 2024 10:11
Autotools (automake/autoconf/m4) ./configure script colorizer
#!/usr/bin/env bash
set -Eeuo pipefail
[ -t 1 ] || exec cat
r=$'\e[91m' g=$'\e[92m' y=$'\e[93m' reset=$'\e[0m'
exec perl -pe "s/\.\. (?!yes$|no$)(.+)/.. ${y}\\1${reset}/i;s/\.\. (no)$/.. ${r}\\1${reset}/i;s/\.\. (yes)$/.. ${g}\\1${reset}/i"
@skull-squadron
skull-squadron / texlive-build-synthentic-packages.sh
Last active September 6, 2024 18:56 — forked from tesch1/texlive17.spec.sh
Creates a phantom RPM for EL (CentOS/Fedora/RHEL/Oracle) that "provides" all known TeX Live packages, so other packages will cooperate with a local TeX Live installation
#/usr/bin/env bash
set -Eeuo pipefail
REV=2024
SPECFILE=
trap 'e=$?; trap - EXIT; [ -z "$SPECFILE" ] || rm -rf "$SPECFILE"; exit $e' EXIT
SPECFILE="$(mktemp)"
cat >"$SPECFILE" <<HEADER
Name: texlive-FAKE
@skull-squadron
skull-squadron / collide.rb
Created July 5, 2024 08:02
Find a TOTP collision
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'openssl'
class Base32
ALPHABET = (('A'..'Z').to_a + ('2'..'7').to_a).map(&:freeze).freeze
PADDING_CHAR = '='
BITS_PER_BYTE = 8
@skull-squadron
skull-squadron / README.md
Created May 31, 2024 05:52
How to un/install an RPM without running scriplets

dnf --setopt=tsflags=noscripts install ...

@skull-squadron
skull-squadron / reinstall.md
Created May 31, 2024 02:13
Reinstall all packages on Linuxes

How to reinstall packages

DNF-/RPM-based

rpm -qa --qf '%{NAME}\n' | xargs dnf reinstall -y

APT-/DEB-based

TBD