Skip to content

Instantly share code, notes, and snippets.

View phillipberndt's full-sized avatar

Phillip Berndt phillipberndt

View GitHub Profile
@phillipberndt
phillipberndt / update_urlfilter.ini.pl
Created April 2, 2011 09:34
Update Opera's urlfilter.ini from secure.fanboy.co.nz while preserving custom entries
#!/usr/bin/perl -w
use LWP::Simple;
use Storable;
use strict;
# Configuration
# You can define multiple urlfilter.ini lists to be downloaded
my @remotes = qw(
http://secure.fanboy.co.nz/adblock/opera/urlfilter.ini
);
@phillipberndt
phillipberndt / gist:5339943
Created April 8, 2013 19:54
Patch against Android Base framework, patched with 4.2 OpenPDroid patches from March 2013. Fixes the Cell Tower bug. Tested with an i9100 / cm10.1. This is probably bad coding style, see https://github.com/wsot/openpdroid_support/issues/1 for details.
diff --git a/services/java/com/android/server/PrivacyTelephonyRegistry.java b/services/java/com/android/server/PrivacyTelephonyRegistry.java
index 36f2d9e..95a3f58 100644
--- a/services/java/com/android/server/PrivacyTelephonyRegistry.java
+++ b/services/java/com/android/server/PrivacyTelephonyRegistry.java
@@ -44,17 +44,25 @@ public class PrivacyTelephonyRegistry extends TelephonyRegistry{
private static final int PERMISSION_CALL_STATE = 3;
private static final int PERMISSION_SERVICE_STATE = 4;
+
+ private Context _context;
@phillipberndt
phillipberndt / determine_dependency_versions.py
Last active December 25, 2015 02:09
Script to determine the exact versions of the GTK libraries required for pqiv. See https://github.com/phillipberndt/pqiv/issues/13
#!/usr/bin/env python
# encoding: utf-8
#
# Find minimal required versions of the gtk/gdk/gdk_pixbuf/glib/cairo libs
# for pqiv
#
import re
import sys
import urllib
@phillipberndt
phillipberndt / gist:6623a5b4b57134e59b57
Created March 4, 2016 10:15
pqiv Aufruf um zu neuen Dateien zu springen
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
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
# ./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
@phillipberndt
phillipberndt / s2n_keylog.patch
Created July 26, 2018 12:29
Add SSLKEYLOGFILE support to S2N
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>
@phillipberndt
phillipberndt / build_linux_pqiv.sh
Last active September 2, 2018 18:43
Script to create a statically linked build of pqiv with dependencies
#!/bin/bash
#
# Build a statically linked version of all pqiv prerequisites and some fake
# ones (atk-bridge, epoxy). Then, compile a statically linked version of pqiv.
#
# This script is only useful in Linux. For Windows, use mxe.cc, a great script
# to compile mingw cross compiler environments with all the required
# dependencies and libraries.
#
# The resulting binary works fine at least between libc 2.15 and 2.19 despite
@phillipberndt
phillipberndt / bluez-5-sink.patch
Created January 15, 2016 16:00
Bluez 5 support for a2dp-alsa
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.
@phillipberndt
phillipberndt / lddeps.py
Last active May 20, 2021 13:47
Check if an elf file has superflous dependencies
#!/usr/bin/env python
"""
A quick & dirty replacement for dpkg-shlibdeps
Written to check if pqiv uses any unnecessary depencencies. dpkg-shlibdeps
claims that this was the case and I wanted to check.
"""
import functools
import multiprocessing.pool
import os