Skip to content

Instantly share code, notes, and snippets.

#
# Makefile for the USB serial device drivers.
#
# Object file lists.
obj-$(CONFIG_USB_SERIAL) += usbserial.o
usbserial-y := usb-serial.o generic.o bus.o
@Lekensteyn
Lekensteyn / libev-4.22-cmake.patch
Created March 18, 2016 00:23
hacky cmake patch for libev-4.22 (for use with MSVC 2013 https://github.com/tatsuhiro-t/nghttp2/pull/544)
diff -Nur libev-4.22.orig/cmakeconfig.h.in libev-4.22/cmakeconfig.h.in
--- libev-4.22.orig/cmakeconfig.h.in 1970-01-01 01:00:00.000000000 +0100
+++ libev-4.22/cmakeconfig.h.in 2016-03-18 01:18:55.167666371 +0100
@@ -0,0 +1 @@
+/* Dummy file */
diff -Nur libev-4.22.orig/CMakeLists.txt libev-4.22/CMakeLists.txt
--- libev-4.22.orig/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ libev-4.22/CMakeLists.txt 2016-03-18 01:17:27.359666381 +0100
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.0)
@Lekensteyn
Lekensteyn / 0001-Enable-more-optional-dependencies.patch
Last active March 29, 2016 09:35
gammaray 2.4.1-2 packaging patch and build log
From 71fb48669d8508c4571bd9ca4b603ba83d0aa6a8 Mon Sep 17 00:00:00 2001
From: Peter Wu <peter@lekensteyn.nl>
Date: Tue, 29 Mar 2016 10:41:39 +0200
Subject: [PATCH] Enable more optional dependencies
Also add cmake as makedepends and perl for building manual pages.
Explicitly use CMAKE_BUILD_TYPE=Release to avoid building in debug mode.
Set ECM_MKSPECS_INSTALL_DIR as suggested on
http://api.kde.org/ecm/module/ECMGeneratePriFile.html to avoid
@Lekensteyn
Lekensteyn / fix-UBIF-typo.dsl
Created November 9, 2012 16:39
ACPI UBIX fix for Toshiba Satellite L750D
/*
* ACPI UBIX fix for Toshiba Satellite L750D
* https://bbs.archlinux.org/viewtopic.php?id=152543
*
* Symptoms:
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x0000000000000011) is beyond end of object (20120320/exoparg2-418)
* ACPI Error: Method parse/execution failed [\_SB_.BAT1.UBIX] (Node ffff880203e8a168), AE_AML_PACKAGE_LIMIT (20120320/psparse-536)
* ACPI Error: Method parse/execution failed [\_SB_.BAT1._BIX] (Node ffff880203e8a0f0), AE_AML_PACKAGE_LIMIT (20120320/psparse-536)
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Evaluating _BIX (20120320/battery-419)
*
@Lekensteyn
Lekensteyn / patch-rtc.py
Created August 16, 2015 22:07
Script to patch an Android recovery.img file, changing the qcom,qpnp-rtc-write Device Tree property (tested with an Android 5.1 image based on kernel 3.4 for a Nexus 5 (rev_11)).
#!/usr/bin/env python
"""
Patch a recovery image to enable RTC writing
Unfortunately it has not the intended effect (tested from recovery):
~ # /system/xbin/hwclock -w
hwclock: RTC_SET_TIME: Operation not permitted
<3>[ 25.821247] spmi_pmic_arb fc4cf000.qcom,spmi: pmic_arb_wait_for_done: transaction denied (0x5)
<3>[ 25.821338] qcom,qpnp-rtc qpnp-rtc-ee162000: SPMI write failed
@Lekensteyn
Lekensteyn / wireshark-postdissector.lua
Created October 25, 2016 14:05
Wireshark post-dissector example (tested with Wireshark 2.0.6 and git master (2.3.x))
-- Wireshark post-dissector written in Lua
--
-- "Turns out #wireshark allows adding any field value as a column.
-- How about a column with a function of a value like strlen(x)+5 or log(x)?😁"
-- https://twitter.com/Wirefloss/status/790677617955344384
--
-- You were asking for what? Ok, here you go! An example of a Lua
-- post-dissector which adds a field to the Wireshark protocol tree which can
-- then be displayed as custom column. Have fun! ~ @Lekensteyn
--
@Lekensteyn
Lekensteyn / generate-wireshark-cs
Created September 12, 2013 23:54
helper for adding new cipher suites to wireshark (resulting code is for Wireshark 1.10.2)
#!/bin/bash
# Quick 'n' dirty generator for extending wireshark cipher suites
# Author: Peter Wu <lekensteyn@gmail.com>
p() {
local tmp kex sig keysize dig diglen
[ $# -gt 0 ] || return
num=$(($2*0x100 + $3))
tmp=${1%%_WITH_*}
@Lekensteyn
Lekensteyn / push-go-crypto.sh
Created September 5, 2017 11:54
Extracts commits from the src/crypto/tls/ directory (from Go upstream) in a reproducible way, preserving all metadata (including committer info).
#!/bin/bash
# Extracts commits from the src/crypto/tls/ directory (from Go upstream) in a
# reproducible way, preserving all metadata (including committer info).
#
# Strategy:
# 0. Create a new temporary working repo.
# 1. Fetch go branch/commit that should be pulled from.
# 2. Rewrite history of go branch, extracting just the src/crypto/tls/ commits.
# 3. Push the updated branch back to tls-tris.
@Lekensteyn
Lekensteyn / 69-libticables.rules
Created September 14, 2014 11:01
improved udev rules for libticables (disable overly broad ttyS and parallel dev matches), directly assign uaccess tag instead of PDA env hack
ACTION!="add", GOTO="libticables_end"
# serial device (assume TI calculator)
#KERNEL=="ttyS[0-3]", TAG+="uaccess"
# parallel device (assume TI calculator)
#SUBSYSTEM=="ppdev", TAG+="uaccess"
# SilverLink
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e001", TAG+="uaccess"
# TI-84+ DirectLink
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e003", TAG+="uaccess"
@Lekensteyn
Lekensteyn / parse_pbzx.py
Last active August 7, 2022 19:49 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages
#!/usr/bin/env python
# Extract .cpio file from a pbzx Payload file.
#
# Based on https://gist.github.com/pudquick/ac29c8c19432f2d200d4,
# this version adds a command-line interface, improves efficiency (1 MiB chunks
# instead of a full copy in memory), adds Python 3 compatibility and
# automatically decompresses stuff (some blocks may not be compressed).
#
# Example usage (from Python):
#