Skip to content

Instantly share code, notes, and snippets.

@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 / rtsx-remove-devinit.patch
Created May 24, 2013 13:16
Fix a build error in Linux 3.9 (and possibly 3.8)
commit 41c027ae2136fc48d1b6eac3a17fbd2b8b4d3717
Author: Peter Wu <lekensteyn@gmail.com>
Date: Fri May 24 13:38:20 2013 +0200
Remove references to __devinit/__devexit (dropped in Linux 3.8)
diff --git a/rtsx.c b/rtsx.c
index c1c76f3..70a8d03 100644
--- a/rtsx.c
+++ b/rtsx.c
@Lekensteyn
Lekensteyn / bumblebee-bugreport-20130812_103716.tar.gz
Last active December 20, 2015 23:19
bugreport results for bumblebee issue 455
@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 / ws-psk-length.patch
Created October 1, 2013 17:01
ssl: Support PSK larger than 16 octets
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index e4e2ec4..31dbada 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -2154,14 +2154,15 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
size = (int)strlen(ssl_psk);
- /* psk must be 0 to 16 bytes*/
- if (size < 0 || size > 32 || size % 2 != 0)
--- a/apps/pkcs8.c
+++ b/apps/pkcs8.c
@@ -157,6 +157,12 @@ int MAIN(int argc, char **argv)
topk8 = 1;
else if (!strcmp (*args, "-noiter"))
iter = 1;
+ else if (!strcmp (*args, "-iter"))
+ {
+ if (!args[1]) goto bad;
+ iter = atoi(*(++args));
/* cc -g -Wall -Wextra -fsanitize=address robot.c -lGL -lglut -lGLU -o robot */
#include <stdio.h> /* for printf of glError */
#include <GL/glut.h>
void display(void) {
glClear(GL_COLOR_BUFFER_BIT);
// draw axis
glLineWidth(2);
glBegin(GL_LINES);
#
# 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
#!/usr/bin/env python
# Attempt to find the cause for http://meta.stackoverflow.com/q/228587/150311
# (“Hot Network Questions” change when I hit Back button in my browser)
try:
from http.server import *
except:
from BaseHTTPServer import *
from datetime import datetime
import time
@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"