Skip to content

Instantly share code, notes, and snippets.

View phillipberndt's full-sized avatar

Phillip Berndt phillipberndt

View GitHub Profile
@phillipberndt
phillipberndt / build-i3.sh
Last active November 5, 2023 19:04
Builder script for i3. Builds the latest i3 from the next branch and its prerequisites. Easily extendable should any dependency be missing from the list.
#!/bin/bash
#
# Build i3 and depencendies.
# by Phillip Berndt, www.pberndt.com, June 2013
#
# The default developer packages from debian based distributions,
# cmake and cairo headers are prerequisites for this script. If
# anything else is missing on your system, this script should be
# easily extendible by inserting further packages into the
# BUILD array below.
@phillipberndt
phillipberndt / gist:ef25e95ef801707eb27a
Created May 7, 2015 10:12
Compile Python for Android
#!/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.
@phillipberndt
phillipberndt / move_partition.sh
Created April 7, 2011 10:59
Move a linux partition to use free space before the partition
#!/bin/bash
#
# This script moves a disk's partition. This is useful if you
# want to resize two parititions, making the first one smaller and the second one bigger.
#
# Note that if your partitions are not encrypted, there are GUI tools to
# acomplish this (Gnome's GParted) and if you are using LVM you don't need this
# at all because there is no problem having fragmented partitions with LVM.
# If you can avoid using this script, do it! Using a GUI tool for such delicate stuff
# helps you avoid headaches ;-)
@phillipberndt
phillipberndt / .htaccess
Created November 18, 2013 12:32
A push-enabled GIT configuration for Apache / cgi-bin / public-html. Place both files in your `public_html` folder, create a corresponding `.htpasswd` file & enjoy.
AddHandler cgi-script .cgi
<Files "git.cgi">
Require valid-user
AuthType Basic
AuthName "GIT Access"
AuthUserFile /path/to/.htpasswd.git
</Files>
@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
@phillipberndt
phillipberndt / Fake xinerama
Last active January 19, 2021 20:26
Fake Xinerama configuration to split the DELL Latitude E7440 two-external monitors into two virtual heads
WHAT THIS IS
------------
The DELL LATITUDE E7440's docking station supports two external displays, and
the notebook's Haswell architecture supports having three displays active at
the same time. It works well, but the two external monitors are merged into one
big display:
$ xrandr
Screen 0: minimum 320 x 200, current 5280 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
@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 / 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 / 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>
# ./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