Skip to content

Instantly share code, notes, and snippets.

View pkern's full-sized avatar

Philipp Kern pkern

  • Karlsruhe, Germany
View GitHub Profile
@pkern
pkern / gist:98fe7e99d681f36ff2cdc93a4d253abf
Created May 6, 2024 14:07
Intel PTT tpm2_getcap algorithms output
# tpm2_getcap algorithms
rsa:
value: 0x1
asymmetric: 1
symmetric: 0
hash: 0
object: 1
reserved: 0x0
signing: 0
encrypting: 0
@pkern
pkern / printer-duplex-processing.path
Last active June 10, 2018 15:50
Convert a stack of simplex scanned pages to duplex, ignoring blank pages
[Unit]
Description=Printer Duplex post-processing
[Path]
PathChanged=/srv/scans/duplex
[Install]
WantedBy=multi-user.target
@pkern
pkern / alertmanager.service
Created January 20, 2018 23:27
alertmanager service using rkt
[Unit]
Description=alertmanager
Requires=network-online.target
After=network-online.target
[Service]
Slice=machine.slice
Delegate=true
ExecStartPre=/usr/bin/rkt fetch quay.io/prometheus/alertmanager:latest
ExecStart=/usr/bin/rkt run --net=host --volume volume-alertmanager,kind=host,source=/srv/mon/alertmanager,readOnly=false --mount volume=volume-alertmanager,target=/etc/alertmanager --volume resolv,kind=host,source=/etc/resolv.conf,readOnly=true --mount volume=resolv,target=/etc/resolv.conf quay.io/prometheus/alertmanager:latest
@pkern
pkern / Makefile
Last active December 4, 2023 15:58
OpenWRT package for sniproxy
include $(TOPDIR)/rules.mk
PKG_NAME:=sniproxy
PKG_VERSION:=0.6.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/dlundquist/sniproxy/archive/
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_MD5SUM:=bcfb5d1efe045b8b356a4229f2339f02

Keybase proof

I hereby claim:

  • I am pkern on github.
  • I am pkern (https://keybase.io/pkern) on keybase.
  • I have a public key whose fingerprint is F75F BFCD 771D EB5E 9C86 0505 50C3 634D 3A29 1CF9

To claim this, I am signing this object:

@pkern
pkern / preseed-s390x.cfg
Last active December 29, 2016 17:47
Script to reinstall a z/VM instance with Debian
d-i debian-installer/locale string en_US
d-i debian-installer/country string US
d-i debian-installer/language string en
d-i time/zone Etc/UTC
d-i mirror/country manual
d-i mirror/http/mirror string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
@pkern
pkern / cups-connector.service
Created August 30, 2015 06:45
systemd unit for cups-connector
[Unit]
Description=Google CloudPrint CUPS connector
After=org.cups.cupsd.service
Requires=org.cups.cupsd.service
[Service]
Restart=always
TimeoutStartSec=0
RuntimeDirectory=cups-connector
RuntimeDirectoryMode=0755
#!/usr/bin/python
## vim:set et ts=2 sw=2 ai:
# homedir_reminder.py - Reminds users about sizable homedirs.
##
# Copyright (c) 2013 Philipp Kern <phil@philkern.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/usr/bin/env python
# vim:set encoding=utf-8:
# GistID: 5078559
#
# Requirements: python2 (>= 2.7), python-git
#
# Copyright ⓒ 2013 Philipp Kern <pkern@debian.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@pkern
pkern / archive-mails
Created September 16, 2012 00:24 — forked from fwenzel/cleanup-maildir.py
A script for cleaning up mails in Maildir folders, with proper threading support
#!/bin/sh
BASE=$HOME/Maildir
ARCHIVEBASE=$HOME/Maildir/archive.
for folder in `find $BASE -maxdepth 1 -type d \! -regex '.*/archive\..*' \! -name cur \! -name tmp \! -name new`
do
folder=$(basename $folder)
if [ "${folder}" = "Maildir" ]; then folder=INBOX; fi
./cleanup-maildir.py --archive-folder=${ARCHIVEBASE}${folder} --maildir-root=$BASE --folder-prefix= --age=365 -d 1 -k -u -v archive ${folder}