Skip to content

Instantly share code, notes, and snippets.

View crabdancing's full-sized avatar

Ada crabdancing

  • Earth
View GitHub Profile
@crabdancing
crabdancing / scan_player_inventories.py
Created October 17, 2020 12:01
NBT inventory scanner
#!/usr/bin/env python3
# Copyleft (C) Alexandria Pettit 2020
# Bit of trash code to automatically scan a collection of minecraft world directories
# for a NBT item in all player inventories.
# Pretty simple :)
import nbtlib
from pathlib import Path
@crabdancing
crabdancing / minecraft.sh
Created October 17, 2020 08:54
little wrapper script I wrote for a dear friend :)
#!/usr/bin/env bash
# Copyleft (C) Alexandria Pettit 2020
# Simple wrapper script to help with launching multiple minecraft servers
if [ $# -eq 0 ]; then
echo "Arg missing! usage: minecraft.sh [instance]"
exit 1
fi
target="/srv/minecraft/$1"
@crabdancing
crabdancing / redstone_mod_ideas.md
Created May 18, 2020 03:19
Redstone Mod Ideas

Simple vanilla-styled redstone mod for adding basic tools. Tools added:

  • Filter hopper -- a hopper designed to filter items passively.

    • Crafted using a hopper and a sieve. Can only filter out one item at a time, meaning that more complex filters requires chaining them together.
  • Redstone clock -- a one-block sized redstone clock that continuously generates a pulse.

  • Autodropper -- a dropper that runs continuously.

    • Crafted using a dorpper and a redstone clock.
@crabdancing
crabdancing / dell_keyboard_backlight.py
Created November 27, 2019 01:20
Some example code for controlling keyboard backlight on Dell laptops via sysfs and pathlib
#!/usr/bin/env python3
from pathlib import Path
import time
sysfs_path = Path('/sys/devices/platform/dell-laptop/leds/dell::kbd_backlight/brightness')
for i in range(4):
print(i)
time.sleep(1)
# write 0 to turn off backlight
/* Copyleft (C) Alexandria Pettit 2019, GNU GPLv3
* Very basic example code for using the LedControl library to
* display crude multi-panel scanning animation on a MAX7219 monochrome dot matrix.
*
* Requires: https://github.com/wayoda/LedControl/
*/
#include "LedControl.h"
// Delay between frame updates
@crabdancing
crabdancing / linode-dns-autoconfig.py
Created February 16, 2019 21:23
Some snippits for rapidly configuring Linode nameserver records
#!/usr/bin/env python3
import json, subprocess as sp
import yaml
config = yaml.load(open("config.yml"))
ipv4 = config['ipv4']
ipv6 = config['ipv6']
soa_email = config['soa_email']
domain_type = config['domain_type']

Keybase proof

I hereby claim:

  • I am alxpettit on github.
  • I am alxptt (https://keybase.io/alxptt) on keybase.
  • I have a public key ASD1ZFR2GR_NWE_N5r_qCxF0QbvCiWcDXwDtp-WSO6VOIAo

To claim this, I am signing this object:

@crabdancing
crabdancing / random_walk.nxc
Created November 15, 2018 23:47
Random Walk
# Copyleft (C) Alexandria Pettit GNU GPLv3
# Very very crude random walk program.
# For use with NXT-powered robots with standard motor to port wiring.
task main()
{
while (true) {
switch (Random(3)) {
case 0:
OnFwd(OUT_C, 100);
@crabdancing
crabdancing / handler.pl
Created November 15, 2018 08:14
ACPID handler script
#!/usr/bin/env perl
# Copyleft (C) Alexandria Pettit GNU GPLv3
# This is a little utility designed for Dell E6*** series laptops, with setups that use 'slock'.
# Its use case is that specific because I designed it specifically for my laptop.
# So this is really more of a personal dotfile thing than a program.
use strict;
use warnings;
@crabdancing
crabdancing / minecraft.sh
Created August 3, 2018 23:43
Minecraft Launcher alternative with no bullshit calling home
#!/usr/bin/env bash
# Copyleft (C) Alexandria Pettit
# GNU GPL v3
# This is a script to load Minecraft on Linux machines without using Mojang's crappy launcher.
# It is currently pretty much unusable for anyone but me, but I'm going to hopefully fix that soon!
# it'll require quite a lot of reverse engineering however.
# TODO: figure out how to better dynamicize .jar lib loading