Skip to content

Instantly share code, notes, and snippets.

@Infernio
Infernio / shantaefix.kwinrule
Last active July 9, 2024 16:40
Fix for fullscreen behavior in Shantae: Risky's Revenge - Director's Cut on KDE
[Settings for steam_app_277890]
Description=Settings for steam_app_277890
fullscreen=true
fullscreenrule=2
size=2560,1440
sizerule=2
wmclass=steam_app_277890
wmclassmatch=1
@Infernio
Infernio / bees_skip.sh
Last active June 28, 2024 16:28
Vim command to skip bees when it gets stuck searching and deduplicating for certain games forever (e.g. this happens with Granblue Fantasy Relink for me)
# Put the UUID of the btrfs filesystem on which bees is stuck here.
sudo systemctl stop beesd@PUT_UUID_HERE.service
# Use the right BEESHOME here.
vim $BEESHOME/beescrawl.dat
# In Vim, run the following command:
# :%s/min_transid \(\d\+\) max_transid \(\d\+\)/min_transid \2 max_transid \2/g
# Same as before, put the right UUID here.
sudo systemctl start beesd@PUT_UUID_HERE.service
# If everything worked correctly, bees should start and drop down to 0% CPU usage after a few seconds.
@Infernio
Infernio / xedit
Created May 14, 2023 13:32
Python script I use for launching xEdit on Linux via protontricks
#!/bin/python
import os
import subprocess
import sys
# Map xEdit game ID to Steam App ID
GAMES = {
'tes3': 22320,
'tes4': 22330,
'tes5': 72850,
@Infernio
Infernio / find_duplicates.py
Created April 7, 2023 14:09
Small script to find duplicate files in the core/override folder for Dragon Age: Origins & Dragon Age II
#!/bin/python
# find_duplicates.py
# License: MIT
#
# Small script to find duplicate files in the core/override folder for Dragon Age: Origins & Dragon Age II.
# Note that this does *not* scan .erf files, only loose files.
#
# To use it, run it with the path to your core/override folder.
import os
import sys
@Infernio
Infernio / fix_dao_dlc.py
Last active April 22, 2023 21:33
Linux/Proton alternative to 'DLC Transfer To Awakening Patch (UPDATED)' for Dragon Age: Origins by silencer711
#!/bin/python
# fix_dao_dlc.py
# License: MIT
#
# Linux/Proton alternative to 'DLC Transfer To Awakening Patch (UPDATED)' for Dragon Age: Origins by silencer711, written in Python.
# See https://www.nexusmods.com/dragonage/mods/5354 for the original.
# Original license: 'THIS MOD IS FREELY DISTRIBUTED, AND I GIVE PERMISSION TO ANYONE TO DO ANYTHING WITH IT :)', which I'm interpreting as basically CC0.
#
# WARNING: I tested this on my game and it seems to work, with the exception that some of my imported DLC items are now missing their name.
# They work fine, appear correctly on the character and give the right stats, but their names are blank when equipped and become the internal IDs when unequipped.
Download link: https://mega.nz/file/VslTTQhB#S1CxVuMz2fDyi6fgwbQ7zSRF-jF5CuEfXGMlis5a3Hs
Retrieved from https://web.archive.org/web/20201107011823/https://www.youtube.com/watch?v=MLjAuKBVNvY
@Infernio
Infernio / wb_loc.txt
Last active May 28, 2023 21:05
Wrye Bash lines of code (LOC) and .py file count over time
ver | lang | |#files| | blank| |comment| | code
-------+--------+---------------------+------+------+------+------+-------+-----+-------
v288 | Python | | 12 | | 3472 | | 7528 | | 58512
v289 | Python | | 12 | | 3476 | | 7525 | | 58654
v290 | Python | | 12 | | 3476 | | 7525 | | 58654
v291 | Python | | 14 | | 4138 | | 8128 | | 48002
v291.1 | Python | | 14 | | 4142 | | 8135 | | 48077
v292 | Python | | 14 | | 4416 | | 8640 | | 51582
v293 | Python | | 14 | | 4425 | | 8668 | | 52481
v294 | Python | | 13 | | 4447 | | 8804 | | 53169
@Infernio
Infernio / rev_interview.py
Last active November 24, 2022 19:35
Aphyr's "Reversing the technical interview" in Python
# Original: https://aphyr.com/posts/340-reversing-the-technical-interview
# Because when the interviewer went “Could you just show me, you know, a regular list? Like in Python?”,
# my first thought was "Buddy, this monstrosity could be conjured in Python too".
def cons(h, t):
return lambda b: h if b else t
def nth(l, n):
if not l: return None
elif n == 0: return l(True)
@Infernio
Infernio / ao3_deleted_bookmarks.txt
Last active February 6, 2023 19:32
Archived versions of fics that I had bookmarked on AO3 that later got deleted
A Pride in the Castle by 8bitBrute, KatLovesLink
https://web.archive.org/web/20220121103703/https://archiveofourown.org/works/32149876?view_adult=true
@Infernio
Infernio / gen_wangxian_tags.py
Created December 30, 2021 11:47
Sexy times with Wangxian tag generator - generate a list of freeform tags from the STWW tag list. Replacement for https://aroceu.com/generators/sexytimes
#!/usr/bin/python3
import random
import sys
# All freeform tags, as taken from the last archive
# https://web.archive.org/web/20210220095145/https://archiveofourown.org/works/20963498/
tags = [
'21st Century',
'69 (Sex Position)',
'A Chinese Ghost Story',