Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@echo off
diskpart /s make-partitions.txt
dism /Apply-Image /ImageFile:E:\sources\install.wim /Index:1 /ApplyDir:W:\
bcdboot W:\Windows /s S: /f UEFI
From 9ed72ef140d40bc1ccea5911b38fa78e7faea160 Mon Sep 17 00:00:00 2001
From: Dan Aloni <dan@kernelim.com>
Date: Wed, 1 Apr 2020 12:28:15 +0300
Subject: [PATCH 1/2] Support a script to be executed when the device goes up
This adds the `ifup_script` config option. The script receives the
following environment variables as input:
- NET_DEVICE: The name of the network device of the VPN.
- DNS_SUFFIX: DNS domain search prefix, if provided by the VPN server.

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+