Skip to content

Instantly share code, notes, and snippets.

View PandorasFox's full-sized avatar
🦊
Sleepy fox; not currently doing much OSS work.

cassandra fox PandorasFox

🦊
Sleepy fox; not currently doing much OSS work.
View GitHub Profile
# godot compressed file unpacker/repacker
# i think this should Just Work(tm) for deflate and gzip assets
# sucks for anyone who needs to mess with fastLZ/zstd assets (hopefully not me later)
# works with like, python3.2 standard library (or thereabouts, i'm using 3.10)
import math
import os
import struct
import sys
import zlib
Core count 24
0.0,37.7,37.5,89.8,91.2,90.5,91.5,92.1,92.8,92.0,91.5,92.2,21.6,37.4,40.3,90.8,90.5,89.3,91.5,92.7,93.4,92.1,91.6,92.0
36.5,0.0,38.8,90.9,91.9,90.3,92.4,92.7,93.2,92.8,92.5,92.9,36.9,21.5,40.4,90.5,90.7,90.5,93.7,91.9,95.2,91.5,93.2,91.6
39.8,37.1,0.0,90.4,92.1,91.0,91.7,92.2,92.7,92.4,91.7,92.5,39.8,37.7,21.6,89.3,91.0,90.2,91.4,92.8,94.2,92.4,91.6,92.3
89.7,89.9,90.7,0.0,38.1,40.0,91.3,91.6,92.4,92.0,91.4,92.0,89.1,91.1,90.5,22.4,37.8,39.3,91.5,93.1,93.9,92.0,91.7,92.0
90.8,91.5,91.8,37.1,0.0,38.8,93.1,93.6,94.1,93.5,93.5,93.5,90.9,92.2,91.3,38.0,22.8,37.8,92.7,94.4,95.0,93.3,93.1,93.5
89.9,91.3,90.7,40.6,40.3,0.0,91.4,92.1,92.6,92.4,91.8,92.4,89.0,90.6,89.3,38.6,38.5,21.5,95.5,96.6,97.3,95.8,95.5,95.8
95.2,95.5,95.3,95.1,96.3,95.3,0.0,38.4,40.6,96.1,95.7,96.4,95.0,95.5,95.4,95.1,95.7,91.5,22.8,39.2,39.1,92.7,92.2,93.3
91.7,92.2,92.2,91.6,93.2,92.3,38.5,0.0,37.3,93.4,93.1,93.4,91.6,92.4,92.1,91.9,92.4,92.2,39.0,22.8,37.5,93.4,93.2,93.3
92.4,93.1,92.6,92.6,94.1,92.6,40.7,40.2,0.0,93.9,93.4,94.0
@PandorasFox
PandorasFox / gist:2eb0769651519c0ccdf6a54e8e4549b1
Created February 7, 2020 18:06
x11trace > /tmp/picom_xtrace & sleep 1; DISPLAY=:9 picom -b && ~/bin/xsecurelock.sh
000:<: am lsb-first want 11:0 authorising with 'MIT-MAGIC-COOKIE-1' of length 16
000:>: Success, version is 11:0 vendor='The X.Org Foundation' release=12007000 resource-id=0x06c00000 resource-mask=0x001fffff motion-buffer-size=256 max-request-len=65535 image-byte-order=LSBFirst(0x00) bitmap-bit-order=LeastSignificant(0x00) scanline-unit=32 scanline-pad=32 min-keycode=0x08 max-keycode=0x00 pixmap-formats={depth=1 bits/pixel=1 scanline-pad=32},{depth=4 bits/pixel=8 scanline-pad=32},{depth=8 bits/pixel=8 scanline-pad=32},{depth=15 bits/pixel=16 scanline-pad=32},{depth=16 bits/pixel=16 scanline-pad=32},{depth=24 bits/pixel=32 scanline-pad=32},{depth=32 bits/pixel=32 scanline-pad=32}; roots={root=0x000006dc default-colormap=0x00000020 white-pixel=0x00ffffff black-pixel=0x00000000 input-mask=KeyPress,KeyRelease,ButtonPress,EnterWindow,LeaveWindow,PointerMotion,StructureNotify,SubstructureNotify,SubstructureRedirect,FocusChange,PropertyChange width[pixel]=5600 height[pixel]=3840 width[mm]=1480 height[mm]=1015 min-in
[ 0.000000] Linux version 5.4.7-arch1-1-surface-dev (linux-surface-dev@archlinux) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu, 02 Jan 2020 05:16:37 +0000
[ 0.000000] Command line: \vmlinuz-linux-surface-dev cryptdevice=UUID=48bc04de-3c3e-4ed5-ba80-cb7e03b54a83:root root=/dev/mapper/root rw quiet splash initrd=initramfs-linux-surface-dev.img
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Hygon HygonGenuine
[ 0.000000] Centaur CentaurHauls
[ 0.000000] zhaoxin Shanghai
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
gpiochip0: GPIOs 256-511, parent: platform/AMDI0030:00, AMDI0030:00:
GPIO bank0 pin0 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state|
disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x50000
pin1 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state|
disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x50000
pin2 Edge trigger| Active low| interrupt is enabled| interrupt is masked| enable wakeup in S0i3 state| enable wakeup in S3 state|
enable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x5ea00
pin3 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state|
disable wakeup in S4/S5 state| input is low| pull-up is disabled| Pull-down is disabled| output is disabled|
#!/bin/sh
# run me after updating surface-linux while you still have wifi
# (or keep a copy of board.bin stashed somewhere)
sudo rm -fv /tmp/board.bin
curl -A "Mozilla/4.0" www.killernetworking.com/support/K1535_Debian/board.bin > /tmp/board.bin
sudo rm -fv /usr/lib/firmware/ath10k/QCA6174/hw{3.0,2.1}/board-2.bin /usr/lib/firmware/ath10k/QCA6174/hw3.0/board.bin
sudo cp -v /tmp/board.bin /usr/lib/firmware/ath10k/QCA6174/hw3.0/board.bin
sudo cp -v /tmp/board.bin /usr/lib/firmware/ath10k/QCA6174/hw2.1/board.bin
sudo modprobe -rv ath10k_pci && sudo modprobe -v ath10k_pci
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.
Table at 0xCE2DD000.
Handle 0x0000, DMI type 18, 23 bytes
32-bit Memory Error Information
Type: OK
Granularity: Unknown
Operation: Unknown
#!/bin/sh
./trans.py | xclip -selection clipboard
xclip -selection clipboard -o | ./read_stdin.py
# 0x1f3f3
# 0xfe0f
# 0x200d
# 0x26a7
# 0xfe0f
Soot started on Tue Feb 20 23:26:21 EST 2018
excludedPackages: [java., sun., javax., com.sun., com.ibm., org.xml., org.w3c., apple.awt., com.apple., android.support.]
java.lang.Error: Error loading java.lang.CharSequence
at soot.JastAddJ.PathPart.getCompilationUnit(PathPart.java:128)
at soot.JastAddJ.Program.getCompilationUnit(Program.java:858)
at soot.JastAddJ.Program.getLibCompilationUnit_compute(Program.java:1531)
at soot.JastAddJ.Program.getLibCompilationUnit(Program.java:1514)
at soot.JastAddJ.Program.lookupLibType_compute(Program.java:1479)
/*
* gcc ./tmp.c -lxcb -lxcb-xkb -lxkbcommon -lxkbcommon-x11 -g -fsanitize=address -fno-omit-frame-pointer
*/
#include <assert.h>
#include <err.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>