Skip to content

Instantly share code, notes, and snippets.

See Darkadia profile

Game name Status
Bowser’s Fury Credits *
Donkey Kong Country Credits
Donkey Kong Country 2 Credits
Donkey Kong Country 3 Credits
Donkey Kong Country: Tropical Freeze Credits
Mario vs Donkey Kong Credits+
@Tatsh
Tatsh / proxy.py
Created April 3, 2024 22:47 — forked from brianglass/proxy.py
Django Channels Websocket Proxy
import asyncio
import logging
import websockets
from channels.exceptions import DenyConnection
from channels.generic.websocket import AsyncWebsocketConsumer
from django.utils.functional import cached_property
logger = logging.getLogger(__name__)
@Tatsh
Tatsh / delall-icloud-photos.py
Last active December 17, 2023 03:40
Use pyicloud to delete all photos from iCloud (may need to be run multiple times)
#!/usr/bin/env python
from __future__ import print_function
import json
import sys
from authentication import authenticate
from future.moves.urllib.parse import urlencode
if __name__ == '__main__':
username = sys.argv[1]
@Tatsh
Tatsh / argparse-dir-arg.py
Last active November 11, 2023 22:34
Check if a directory argument is writeable or readable.
from os.path import isdir, realpath
import argparse
import os
class ReadableDirectoryAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
prospective_dir = values
if not isdir(prospective_dir):
raise argparse.ArgumentTypeError('%s is not a valid directory' % (
@Tatsh
Tatsh / merge-dependabot-prs.sh
Last active October 25, 2023 11:24
merge-dependabot-prs
#!/usr/bin/env bash
get-repos() {
gh repo list --limit 9999 --jq '.[].nameWithOwner' --json nameWithOwner --no-archived &&
while IFS=$'\n' read -r org; do
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/orgs/${org}/repos" --jq '.[].full_name'
done < <(gh org list)
from struct import pack
from typing import Literal
def make_font_entry(
field: Literal['CaptionFont', 'IconFont', 'MenuFont', 'MessageFont',
'SmCaptionFont', 'StatusFont'],
name: str,
*,
char_set: Literal[0, 1, 2, 0x4d, 0x80, 0x81, 0x82, 0x86, 0x88, 0xa1,
import itertools
args = ('-march=rocketlake -mabm --param=l1-cache-line-size=64 '
'--param=l1-cache-size=48 --param=l2-cache-size=16384').split(' ')
def mabm(o: str):
if o.startswith('-mabm'):
return 'maz'
return o.replace('-', '')
@Tatsh
Tatsh / README.md
Last active February 10, 2023 04:47

NOTE: Requires a backup of your old Chrome configuration directory.

The intent of this script is to save time by not having to reconfigure your extensions when you sign in with a clean Chrome config, and to transfer general things like cookies so you do not have to sign into everything again. This also copies flags you have enabled in chrome://flags.

After deleting your old configuration from the normal location (e.g. ~/.config/google-chrome-beta), open Chrome and sign in. Do this for every profile as necessary. You need to determine which profile directory ('Default' or 'Profile X') belongs to whom in both the old config and the new. Then you can use this script.

Example usages:

./reconstruct-chrome-profile.sh ./old-chrome-config-backup Default Default
@Tatsh
Tatsh / Full Bass + Treble.json
Created August 4, 2022 10:57
Full Bass + Treble based on Clementine's preset
{
"output": {
"blocklist": [],
"equalizer": {
"bypass": false,
"input-gain": 0.0,
"left": {
"band0": {
"frequency": 60.0,
"gain": 4.2,
@Tatsh
Tatsh / step1.sh
Last active May 24, 2022 02:49
Dual boot with secure boot enabled. Install app-crypt/efitools
#!/usr/bin/env bash
set -e
rm -fR ~/keystuff/{esl,key,crt,auth,der}
mkdir -p ~/keystuff/{esl,key,crt,auth,der}
cd ~/keystuff
for i in PK KEK db dbx; do
efi-readvar -v "$i" -o "esl/old_${i}.esl"
done
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$(hostname) platform key/" -keyout key/PK.key -out crt/PK.crt -days 36500 -nodes -sha256
openssl req -new -x509 -newkey rsa:2048 -subj "/CN=$(hostname) key-exchange-key/" -keyout key/KEK.key -out crt/KEK.crt -days 36500 -nodes -sha256