Skip to content

Instantly share code, notes, and snippets.

Avatar

Phillip Berndt phillipberndt

View GitHub Profile
@phillipberndt
phillipberndt / s2n_keylog.patch
Created Jul 26, 2018
Add SSLKEYLOGFILE support to S2N
View s2n_keylog.patch
diff --git a/tls/s2n_handshake_io.c b/tls/s2n_handshake_io.c
index 40a8fb0..0c7c2b4 100644
--- a/third-party-src/tls/s2n_handshake_io.c
+++ b/third-party-src/tls/s2n_handshake_io.c
@@ -16,6 +16,7 @@
#include <sys/param.h>
#include <errno.h>
+#include <stdio.h>
#include <s2n.h>
View config.log
# ./configure --cross-prefix=i686-w64-mingw32.static- --enable-cross-compile --arch=i686 --target-os=mingw32 --prefix=/home/pberndt/pqiv_builds/mxe/usr/i686-w64-mingw32.static --enable-static --disable-shared --yasmexe=i686-w64-mingw32.static-yasm --disable-debug --enable-memalign-hack --disable-pthreads --enable-w32threads --disable-doc --enable-avresample --enable-gpl --enable-version3 --extra-libs=-mconsole --enable-avisynth --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
ALL_COMPONENTS='
aac_adtstoasc_bsf
chomp_bsf
dump_extradata_bsf
dca_core_bsf
h264_mp4toannexb_bsf
hevc_mp4toannexb_bsf
imx_dump_header_bsf
mjpeg2jpeg_bsf
View gist:2fd22acf6daefc204eb3b5051358d778
Haystack: babaacb
Needle: abab
Split into [ "babaa", "b" ]
> Match the longest substring with the input and keep track of the longest match.
> If you don't get a complete match, use the longest one to slice up the
> substring once more, and retry with the next longest substring.
There's no complete match, and the longest match is "bab". So splice up the substring again, and retry with
@phillipberndt
phillipberndt / gist:6623a5b4b57134e59b57
Created Mar 4, 2016
pqiv Aufruf um zu neuen Dateien zu springen
View gist:6623a5b4b57134e59b57
pqiv --watch-directories --sort-key=mtime --sort --end-of-files-action=wait --slideshow-interval=0.001 --slideshow test
--watch-directories -> Nach neuen Dateien suchen
--sort-key=mtime -> Nach Änderungsdatum sortieren, also ganz neue Dateien ans Ende
--sort
--end-of-files-action=wait -> Am Ende der Slideshow auf neue Dateien warten statt direkt von vorne neu zu starten
--slideshow-interval=0.001 -> Slideshow sehr schnell durchlaufen
--slideshow
@phillipberndt
phillipberndt / bluez-5-sink.patch
Created Jan 15, 2016
Bluez 5 support for a2dp-alsa
View bluez-5-sink.patch
Patch for a2dp-alsa sinks to work with Bluez 5
By Phillip Berndt <phillipberndt@googlemail.com>
This is a patch for
http://www.lightofdawn.org/blog/?viewDetailed=00032
to work with Bluez 5.x. The changes are mostly what the original author
described, thanks a lot for the detailled description!
Note that this is a destructive patch; it breaks Bluez 4
support. Also, --source is untested.
View randr.c
/*
* This file generated automatically from randr.xml by c_client.py.
* Edit at your peril.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
@phillipberndt
phillipberndt / xcbtest.c
Created Jun 24, 2015
test if fakexrandr supports xcb
View xcbtest.c
/* compile with
gcc -oxcbtest xcbtest.c -lxcb -lxcb-randr -lX11 -lXrandr
*/
#include <xcb/xcb.h>
#include <xcb/randr.h>
#include <X11/extensions/Xrandr.h>
#include <X11/Xlibint.h>
View gtktextbuffer-markup-bug.c
#include <gtk/gtk.h>
void main() {
GtkTextIter start, end, inspos, tagpos;
gsize length;
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL);
GtkTextTag *tag1 = gtk_text_buffer_create_tag(buffer, "tagone", NULL);
GtkTextTag *tag2 = gtk_text_buffer_create_tag(buffer, "tagtwo", NULL);
@phillipberndt
phillipberndt / autorandr.patch
Created May 18, 2015
autorandr patch to show DPI
View autorandr.patch
diff --git a/autorandr.py b/autorandr.py
index 19722c9..6df9d9b 100755
--- a/autorandr.py
+++ b/autorandr.py
@@ -129,7 +129,8 @@ class XrandrOutput(object):
(?P<rotate>(?:normal|left|right|inverted))\s+ # Rotation
(?:(?P<reflect>X\ and\ Y|X|Y)\ axis)? # Reflection
)? # .. but everything of the above only if the screen is in use.
- (?:[\ \t]*\([^\)]+\))(?:\s*[0-9]+mm\sx\s[0-9]+mm)?
+ (?:[\ \t]*\([^\)]+\))\s*
View gist:ef25e95ef801707eb27a
#!/bin/sh
#
# This script builds & bundles Python for Android
# You'll end up with a tar.bz2 file that contains a Python distribution
#
# Requires all prerequisites to build Android on the host, and the NDK
# installed.
#
# This script creates a file python4android.tbz2. Unpack it on your device
# (into a non-noexec partition!) and enjoy.