Skip to content

Instantly share code, notes, and snippets.

View wolfgangkarall's full-sized avatar

Wolfgang Karall-Ahlborn wolfgangkarall

  • Vienna, Austria
View GitHub Profile
@wolfgangkarall
wolfgangkarall / docker-escape-to-host.sh
Created January 31, 2024 20:08
docker-escape-to-host, debian:bookworm edition
docker-escape-to-host() {
# run the 1st container, exposing the docker daemon's socket to it
docker run -it --rm --name "silly-overpowered-container" -v /var/run/docker.sock:/var/run/docker.sock debian:bookworm bash -c '
# inside the 1st container, install docker CLI
apt update
apt -y install ca-certificates wget
cat <<EOF > /etc/apt/sources.list.d/docker.list
deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bookworm stable
@wolfgangkarall
wolfgangkarall / stunnel-chroot-reload.md
Last active September 12, 2015 19:19 — forked from DavidWittman/stunnel-chroot-reload.md
Reloading stunnel configurations when in a chroot

Reloading stunnel configurations when in a chroot

Example stunnel config

# /etc/stunnel/stunnel.conf
cert = /etc/stunnel/cert.pem
sslVersion = TLSv1 TLSv1.1 TLSv1.2

chroot = /var/run/stunnel/
@wolfgangkarall
wolfgangkarall / mythhash.cpp
Last active August 29, 2015 14:14
Calculating hashes for video files as used by MythTV in the DB table videometadata
// on Debian/Ubuntu:
// - install libqt4-dev
// - put file into a directory called mythhash
// - run:
// qmake -project
// qmake
// make
// C++ headers
#include <iostream>
@wolfgangkarall
wolfgangkarall / google-addressbook-multi
Created January 13, 2015 20:02
google-addressbook multiple phone/email entries
diff -r 6d397e9f2fe1 plugins/google_addressbook/google_func.php
--- a/plugins/google_addressbook/google_func.php Tue Jan 13 19:18:00 2015 +0100
+++ b/plugins/google_addressbook/google_func.php Tue Jan 13 21:00:52 2015 +0100
@@ -143,7 +143,7 @@
foreach($entry['gd:email'] as $email) {
list($rel, $type) = explode('#', $email['@attributes']['rel'], 2);
$type = empty($type) ? '' : ':'.$type;
- $record['email'.$type] = $email['@attributes']['address'];
+ $record['email'.$type][] = $email['@attributes']['address'];
}

Keybase proof

I hereby claim:

  • I am wolfgangkarall on github.
  • I am wolfgangkarall (https://keybase.io/wolfgangkarall) on keybase.
  • I have a public key whose fingerprint is F11F 50F8 96B7 C8B5 6D25 AEDE BA1C 0955 172C C057

To claim this, I am signing this object:

@wolfgangkarall
wolfgangkarall / gist:8835042
Created February 5, 2014 22:53
LVM recipe: determine which physical volume(s) a logical volume is located on
# from http://programmaticallyspeaking.com/lvm-recipe-determine-which-physical-volumes-a-logical-volume-is-located-on.html
lvs --segments -o +pe_ranges
@wolfgangkarall
wolfgangkarall / gist:6496124
Created September 9, 2013 14:13
List APT packages by install source and release/component
# slightly adapted from http://askubuntu.com/a/43583
apt-cache policy $(dpkg -l | awk '/^ii/{ print $2 }') |
awk '/^[^ ]/ { split($1, a, ":"); pkg = a[1] }
nextline == 1 { nextline = 0; printf("%-40s %-50s %s\n", pkg, $2, $3) }
/\*\*\*/ { nextline = 1 }'
@wolfgangkarall
wolfgangkarall / RsyncP.pm.diff
Last active December 21, 2015 13:29
Patch for BackupPC or rather File::RsyncP (see http://backuppc.sf.net/ and http://perlrsync.sf.net/ ) to make it work against Cyanogenmod 10.1.2's rsync/sshd.
--- RsyncP.pm.orig 2010-07-25 22:50:02.000000000 +0200
+++ RsyncP.pm 2013-08-22 23:18:15.000000000 +0200
@@ -397,6 +397,12 @@ sub remoteStart
$rs->log("Fetching remote protocol") if ( $rs->{logLevel} >= 5 );
return -1 if ( $rs->getData(4) < 0 );
my $data = $rs->{readData};
+ if ( $data =~ /^void endpwent\(\)\(3\) is not implemented on Android/ ) {
+ $rs->log("Working around Android bug") if ( $rs->{logLevel} >= 1 );
+ $rs->{readData} = '';
+ return -1 if ( $rs->getData(4) < 0 );