Skip to content

Instantly share code, notes, and snippets.

View 166MMX's full-sized avatar

Johannes Harth 166MMX

View GitHub Profile
@166MMX
166MMX / git-merge-associate.py
Last active January 2, 2024 15:43 — forked from tvogel/git-merge-associate
git script to manually associate files in a conflicting merge when rename detection fails
#!/usr/bin/env python
import dataclasses
import locale
import subprocess
import sys
"""
Purpose: Manually associate missed renames in merge conflicts during Git merges.
Usage: git merge-associate <our-target> <base> <theirs>
@166MMX
166MMX / signaling-server.ts
Created March 21, 2023 10:14 — forked from ronnyroeller/signaling-server.ts
Lambda function to provide webrtc signaling server
import { ApiGatewayManagementApi, DynamoDB } from 'aws-sdk';
import { scanItems } from './dynamodb';
const { AWS_REGION, TOPICS_TABLE } = process.env;
const dynamoDb = new DynamoDB({
apiVersion: '2012-08-10',
region: AWS_REGION,
});
@166MMX
166MMX / c-struct-to-ksy.rb
Last active May 15, 2021 22:34 — forked from GreyCat/c-struct-to-ksy.rb
Convert C struct into Kaitai Struct spec (.ksy)
#!/usr/bin/env ruby
require 'yaml'
TYPE_TO_KSY = {
'uint8_t' => 'u1',
'uint16_t' => 'u2',
'uint32_t' => 'u4',
'uint64_t' => 'u8',
@166MMX
166MMX / README.md
Created February 19, 2020 14:41 — forked from brandt/README.md
Creates a loopback alias with IP 127.0.0.2 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  2. Set mode: sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
@166MMX
166MMX / parse_pbzx2.py
Created October 2, 2016 21:34 — forked from Manouchehri/parse_pbzx2.py
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
//Invite all you friends in facebook :)
for(var a=document.getElementsByClassName('checkableListItem'), i=a.length-1;i>=0;i--) a[i].click();
class ProgressBar
{
private int max
private int current
private int width
private String name
private long start
private long lastUpdate
private PrintStream ps
#!/usr/bin/env python
import sys
import datetime
frankierart={
0x01:'Stampit 2003',
0x02:'0x02???',
0x03:'Frankit',
0x05:'Filiale',
0x07:'Frankierservice Infopost/Infobrief',
0x08:'Premiumadress',