Skip to content

Instantly share code, notes, and snippets.

@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',
@Infernio
Infernio / LICENSE
Last active February 6, 2021 17:26
Translate back and forth between ASCII and JojoCrypt
### GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@Infernio
Infernio / profile_startup_env_2.txt
Last active January 27, 2021 18:08
After inf-258-env-package
bash.py 443 _main: 2458825 function calls (2453354 primitive calls) in 2.190 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 2.249 2.249 bash\basher\__init__.py:4217(Init)
1 0.000 0.000 1.180 1.180 bash\basher\__init__.py:4260(InitData)
1 0.000 0.000 0.656 0.656 bash\bosh\__init__.py:2097(refresh)
1 0.000 0.000 0.642 0.642 bash\basher\__init__.py:3842(__init__)
1 0.001 0.001 0.605 0.605 bash\basher\__init__.py:3605(__init__)