Skip to content

Instantly share code, notes, and snippets.

View Mimickal's full-sized avatar
🦊

Mia Moretti Mimickal

🦊
View GitHub Profile
@Mimickal
Mimickal / getLoadedChunks.java
Created March 11, 2024 06:37
Minecraft Forge 1.18 getLoadedChunks
/** For some silly reason {@link ChunkMap#getChunks} is protected, so this is the workaround. */
public static Iterable<ChunkHolder> getLoadedChunks(ServerLevel world) {
// Ironically, Reflection is probably the most portable way to do this.
try {
ChunkMap chunkMap = world.getChunkSource().chunkMap;
Method getChunks = chunkMap.getClass().getDeclaredMethod("getChunks");
getChunks.setAccessible(true);
// AFAIK there's no way to do this cast that Java thinks is safe.
// ChunkMap.getChunks() only ever returns this type, so it's safe enough.
@Mimickal
Mimickal / setup_foot_pedal.sh
Created July 21, 2023 19:16
Sets up an Infinity IN-USB-2 Foot Pedal to act as a keyboard on Debian-based Linux systems
#!/bin/bash
# Sets up an Infinity IN-USB-2 foot pedal so it behaves like a keyboard.
# This script assumes a Debian-based system.
# ID 05f3:00ff PI Engineering, Inc. VEC Footpedal
# See: https://thejeshgn.com/2022/05/03/usb-foot-pedal-or-switch-as-a-keyboard-in-linux/
RULE_FILE=/etc/udev/rules.d/10-vec-usb-footpedal.rules
HWDB_FILE=/etc/udev/hwdb.d/000-vec-usb-footpedal.hwdb
RULE_DATA=$(cat <<END
ACTION=="add|change",
@Mimickal
Mimickal / Mobile Linux Adventure 2.md
Last active June 20, 2023 04:34
Mia's second epic journey into the world of alternative mobile operating systems

Mobile Linux Adventure 2

In this document I disown Ubuntu Touch and try out Droidian, another true Linux OS for smartphones.

I will be making callbacks to part 1, so it's worth a skim if you haven't read it yet.

Droidian (a Mobian derivative)

Ubuntu Touch was an abject failure, but I still have faith in the concept. This time I will be using Droidian with the Phosh GUI. Droidian is a modification of Mobian, so I expect many things will be the same between them. Thankfully, Droidian also supports the Google Pixel 3a, so I can reuse the same phone from last time.

@Mimickal
Mimickal / Mobile Linux Adventure.md
Created April 1, 2023 22:31
Mia's epic journey into the world of alternative mobile operating systems

Mobile Linux Adventure

In this document I describe the process of installing and using Ubuntu Touch, a true Linux OS for smartphones.

Background

First, a small rant. ("Shut up, just take me to the Linux stuff")

Over the past 15 years or so, smartphones have weaseled their way into every aspect of our lives. We use them for social media, messaging, photography, online banking, and sometimes -- if we're truly unlucky -- phone calls. We also use them for 2-Factor Authentication, a form of ID arguably stronger than our actual government IDs. Phones aren't just useful, they're necessary. Government entities and big tech are well aware of this fact, and take advantage of it to harvest unprecedented amounts of data on everybody. Carriers also take advantage of this fact by bleeding customers for money at every turn. All of this is with little to no regulation or oversight.

@Mimickal
Mimickal / halomaps-archive-link.md
Last active May 30, 2023 21:42
A permanent download link for the archive of http://forum.halomaps.org
@Mimickal
Mimickal / .vimrc without plugs
Created May 20, 2022 03:06
A version of my .vimrc without the plugins
" Use a color scheme that works with flux
syntax on
colorscheme zellner
" Use a not-dumb tab size
set tabstop=4
" Show tabs as something cool
set list
set listchars=tab:>-
@Mimickal
Mimickal / gpd_win_2_pop_os_guide.md
Last active July 24, 2022 00:49
A guide for setting up Pop_OS 20.04 on the GPD Win 2

Setting up Linux (Pop_OS!) on the GPD Win 2

This is a guide for setting up Pop_OS! 20.04 LTS on the GPD Win 2. The majority of things work out of the box. For the things that don't, I have documented my setup here. Most of this stuff was found by other users, so I'm just collecting all this information in one place with the hope that it'll be helpful for others.

Things that work out of the box

  • Wifi
  • Bluetooth
  • Touch screen
  • Volume control buttons
  • Screen brightness control buttons
  • Go to sleep on lid close
@Mimickal
Mimickal / .tmux.conf 3.1b
Last active September 1, 2023 05:11
tmux config for version 3.1b
## Use ~ for prefix
set -g prefix `
bind ` send-key `
## Not stupid keys for splitting panes
bind-key - split-window -v
bind-key _ split-window -v
bind-key \\ split-window -h
bind-key | split-window -h
@Mimickal
Mimickal / .gitconfig
Created February 11, 2020 04:23
My git config with some special commands
[user]
name = Mia Moretti
email = mimickal.dev@gmail.com
[core]
editor = vim
[alias]
switch = !git checkout $(git branch -a | sed 's/remotes\\/origin\\///' | sort | uniq - | fzf)
[push]
default = current
@Mimickal
Mimickal / .bashrc
Created February 11, 2020 00:30
Bash prompt that shows git branch, if in a git directory
# Shows the git branch we're currently on, if in a git directory
function gitbranch() {
perl -e '
my $output = `git branch 2> /dev/null`;
my ($branch) = $output =~ /\* ([\S]+)/;
if ($branch) {
print "[$branch]";
}
';
}