Skip to content

Instantly share code, notes, and snippets.

#!/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 / 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 / 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 / dependencies.txt
Last active August 29, 2015 14:25
Library dependencies based on the contents of the factory images for hammerhead 5.1.1 (LMY48B) https://github.com/Lekensteyn/make-gapps-zip/issues/2
system/vendor/lib/libwvm.so
libQSEEComAPI.so
libWVStreamControlAPI_L1.so
libdrmframework.so
libstagefright.so
libstlport.so
libz.so
system/vendor/lib/libwvdrm_L1.so
libWVStreamControlAPI_L1.so
libstlport.so
@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 / 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 / aboot-parse.py
Created December 29, 2015 22:22
Quick and dirty script to parse aboot images
#!/usr/bin/env python
# From target/msm8974/tools/mkheader.c (size renamed to size)
"""
magic[0] = 0x00000005; /* appsbl */
magic[1] = 0x00000003; //Flash_partition_version /* nand */
magic[2] = 0x00000000; //image source pointer
magic[3] = base; //image destination pointer
magic[4] = code_size + cert_chain_size + signature_size; //image size
--- 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);