Skip to content

Instantly share code, notes, and snippets.

@Lekensteyn
Lekensteyn / Makefile
Last active August 29, 2015 14:23
Minimal reproducer for gtk3/mutter bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3961
CFLAGS = -Wall -Wextra -g $(shell pkg-config --cflags gtk+-3.0)
LDFLAGS = $(shell pkg-config --libs gtk+-3.0)
app: app.c
$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
@Lekensteyn
Lekensteyn / gdb.py
Last active August 29, 2015 14:19
Generated Python source for gdb using pystubgen (https://github.com/Lekensteyn/pystubgen)
# Generated from package gdb using pystubgen
"""
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
"""
class Architecture(object):
"""
GDB architecture object
"""
@Lekensteyn
Lekensteyn / modules.py
Last active November 8, 2023 10:10
Print a table with enabled nginx modules https://wiki.debian.org/Nginx
#!/usr/bin/env python
#
# Prints information about modules, whether these are enabled or not.
# The goal is to quickly find whether a module appears in some package
# variant for some distro version.
#
# Written for use in https://wiki.debian.org/Nginx
#
# The resulting table should appear as:
#
@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"
#!/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
#
# 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
/* 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);
--- 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));
@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)
@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_*}