Skip to content

Instantly share code, notes, and snippets.

View obfusk's full-sized avatar
🏳️‍🌈
hacking ⇒ ¬sleeping 😸

FC (Fay) Stegerman obfusk

🏳️‍🌈
hacking ⇒ ¬sleeping 😸
View GitHub Profile
@obfusk
obfusk / apk-find-utc.py
Last active April 15, 2021 07:36
find/strip UTC timestamps from ZIP files' CD extra fields
#!/usr/bin/python3
# encoding: utf-8
import struct
import sys
import zipfile
def _has_timestamp(info):
xtr = info.extra
@obfusk
obfusk / copy-v2-sig.py
Last active June 21, 2023 13:50
apk signature copying
#!/usr/bin/env python3
import os
import shutil
import subprocess
import sys
import zipfile
from collections import namedtuple
@obfusk
obfusk / github-sshkeys.sh
Created February 13, 2021 15:00
ssh authorized_keys from github
#!/bin/bash
# Usage: github-sshkeys.sh USERNAME >> ~/.ssh/authorized_keys
curl "https://api.github.com/users/$1/keys" | jq -r '.[] | .key'
@obfusk
obfusk / tags.sh
Created January 17, 2021 08:18
differentiate annotated & lightweight git tags
for x in $( git tag ); do echo $x; git show --stat $x | head -1; done
@obfusk
obfusk / gbp.sh
Created January 17, 2021 07:19
jiten gbp
git clone --no-checkout -o upstream [email protected]:obfusk/jiten.git
git tag v0.3.6-26-ga981f30 remotes/upstream/master
git checkout -b debian/sid v0.3.6-26-ga981f30
gbp export-orig
dpkg-source --include-binaries --build .
gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-debian-branch=debian/sid
@obfusk
obfusk / default.nix
Last active July 8, 2021 10:12
jiten for nixos | OUTDATED | jiten is now in nixpkgs (un)stable
{ nixpkgs ? import <nixpkgs> {} }:
with nixpkgs;
let
callPkg = lib.callPackageWith (nixpkgs // pkgs);
pkgs = rec {
jiten = callPkg (
{ lib
, fetchFromGitHub
, python3Packages
, makeWrapper
@obfusk
obfusk / external-screen-fu
Created January 6, 2021 18:02
external-screen-fu
#!/bin/bash
case "${1:-on}" in
on)
xrandr --output HDMI-1 --auto --output eDP-1 --off
xrdb -merge <<< 'Xft.dpi: 96'
;;
off)
xrandr --output HDMI-1 --off --output eDP-1 --auto
xrdb -merge <<< 'Xft.dpi: 120'
;;
@obfusk
obfusk / virsh
Last active January 19, 2021 13:39
virsh
#!/bin/bash
/bin/virsh -c qemu:///system "$@"
@obfusk
obfusk / diff
Created January 1, 2021 12:40
python build diff
├── lib/arm64-v8a/libpython3.9.so
│ ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}
│ │ @@ -190721,18 +190721,18 @@
│ │ sub w13, w10, #0x1
│ │ cmp w14, #0xff
│ │ b.ne 1b8ddc <PyUnicode_BuildEncodingMap@@Base+0x668> // b.any
│ │ add w16, w9, #0x1
│ │ strb w9, [x20, x15]
│ │ mov w14, w9
│ │ mov w9, w16
@obfusk
obfusk / V
Last active December 4, 2020 13:30
open files in vim tabs
#!/bin/bash
exec v -R "$@"