Skip to content

Instantly share code, notes, and snippets.

View crabdancing's full-sized avatar

Ada crabdancing

  • Earth
View GitHub Profile
@crabdancing
crabdancing / fix_winit_bug.rs
Created March 31, 2021 02:13
rust winit locale fix
// On Amethyst, winit glitches out when you create the window if you're using nonstandard locale settings
// Here's a function I made to fix that issue
fn fix_winit_bug() {
let var_names = [ "LANG",
"LC_CTYPE", "LC_NUMERIC", "LC_TIME",
"LC_COLLATE", "LC_MONETARY", "LC_MESSAGES",
"LC_PAPER", "LC_NAME", "LC_ADDRESS",
"LC_TELEPHONE", "LC_MEASUREMENT", "LC_IDENTIFICATION" ];
for var_name in &var_names {
std::env::set_var(var_name, "C.utf8");
@crabdancing
crabdancing / jitsi-meet.desktop
Last active March 23, 2021 23:05
jitsi meet appimage .desktop file
[Desktop Entry]
Comment=
Exec=/home/ada/.opt/jitsi-meet/jitsi-meet-x86_64.AppImage
GenericName=Uncucked VOIP application
Icon=/home/ada/.opt/jitsi-meet/jitsi-meet.png
Name=Jitsi Meet
NoDisplay=false
StartupNotify=true
MimeType=x-scheme-handler/jitsi-meet;
#!/usr/bin/env bash
mkdir arch-install-scripts
cd arch-install-scripts
wget https://archlinux.org/packages/extra/any/arch-install-scripts/download/ -O - | unzstd | tar x
@crabdancing
crabdancing / arch-chroot.sh
Created March 13, 2021 23:40
a copy of the arch chroot script for ease of reference
#!/bin/bash
shopt -s extglob
# generated from util-linux source: libmount/src/utils.c
declare -A pseudofs_types=([anon_inodefs]=1
[autofs]=1
[bdev]=1
[bpf]=1
[binfmt_misc]=1
@crabdancing
crabdancing / disable-suspending-usbcore.service
Last active February 21, 2021 21:22
Disable suspending USB core. I use this service to fix a bug with my bluetooth on one of my laptops.
[Unit]
Description=Disable automatically suspending USB stuff to fix errors with e.g. bluetooth
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "echo -1 > /sys/module/usbcore/parameters/autosuspend"
[Install]
WantedBy=multi-user.target
@crabdancing
crabdancing / linux.arch.install.md
Last active July 17, 2022 07:51
Installing Arch Linux (2020)

intro

I decided recently that I'm done being a boomer. Most decent machines have like 16GB of RAM at minimum, so I can afford to run KDE instead of XFCE. And like everything I own has had EFI support for years. So I should probably start building my Arch Linux installs with support for that, instead of MBR crap.

The one thing I wish I could do is encrypt the boot partition, but that slows down boot time a fair bit in my experience. When you do boot encryption, GRUB has to decrypt your password (which it doesn't do very efficiently, so it takes a bit of time to unlock your key), then hands it off to initramfs to then unlock main boot partition. This obviously kinda sucks turds. You're remounting stuff over and over again. Ideally you only want it mounted once, maybe twice if you have to.

The way GRUB prompts for a password is also quite awkward -- nothing like the smooth UI you can get from an initramfs prompt. By default, if you enter the wrong password once, it just gives up and moves straight to a GRU

@crabdancing
crabdancing / Quick_EFI_fix.md
Created December 2, 2020 07:17
Quick walkthrough of fixing EFI partition on Windows, from Windows recovery terminal.

diskpart

list disk

Choose disk number that contains the target Windows install.

sel disk [number you chose]

list vol

@crabdancing
crabdancing / Makefile
Created November 9, 2020 19:29
makefile for compiling standalone C# programs with Mono
CSC = csc
TARGET = main
build: $(TARGET)
$(TARGET): $(TARGET).cs
$(CSC) $(TARGET).cs
clean:
@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"