Skip to content

Instantly share code, notes, and snippets.


Stefan stefanschmidt

View GitHub Profile
stefanschmidt / libpff.rb
Created May 21, 2021
Homebrew formula for libpff
View libpff.rb
class Libpff < Formula
desc "libpff is a library to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format"
homepage ""
license "LGPLv3+"
head "", :branch => "main"
# depends_on "cmake" => :build
depends_on "gettext"
depends_on "automake"
depends_on "libtool"
stefanschmidt /
Last active May 16, 2021
Installing markdeck on macOS Mojave
# MarkDeck: presentations as code
# install Docker Desktop (requires root privileges)
brew install --cask docker
# install Docker command line binaries
# /usr/local/bin/docker
# /usr/local/bin/docker-compose
open /Applications/
stefanschmidt / google-search-annoyances.txt
Last active May 13, 2021
Remove annoyances from Google search results
View google-search-annoyances.txt
! For use in Adguard for Safari on macOS:
! Syntax for filters:
! See also:
! Takes about ten seconds after saving for changes to be reflected in browser
! Removes the sections "People also search for", "People also ask", "Related searches" and "Featured snippet from the web" > div > div > div > h4:-abp-contains(People also search for)) > div > div > div > div > h2:-abp-contains(People also ask)) > div> div > div > div > div > h3 > span:-abp-contains(Related searches)) > div > div > div > div > h2:-abp-contains(Featured snippet from the web))
stefanschmidt /
Created May 8, 2021
Convert list of german last names from pdf to plain text
# Using pdf2txt we will convert an extensive list of german last names from pdf to plain text
# Deutscher Familiennamenatlas (DFA) is available from
# depends on pdftotext from poppler package (available via Homebrew)
# currently 54152 names (May 2021)
curl > temp.pdf
pdftotext temp.pdf
# remove page titles, page numbers, etc. from text with regular expressions
stefanschmidt /
Last active May 8, 2021
Convert list of german last names from html to plain text
# Using htmlparser we will convert an extensive list of german last names from html to plain text
# Digitales Familiennamenwörterbuch Deutschlands (DFD) is available from
# depends on htmlparser go package
# single-page view: currently 46035 names (May 2021)
curl -s '' |
htmlparser '#maincontent > ul:nth-child(even) > li > a text{}' > dfd.txt
stefanschmidt /
Last active Apr 7, 2019
Generate salted SHA-512 hashes
# Using mkpasswd and slappasswd we will generate salted SHA-512 hashes
# password: secret
# method 1: using mkpasswd
# requires whois package on Ubuntu
mkpasswd --method=sha-512 --salt=foobar42
# method 2: using slappasswd
# requires slapd package on Ubuntu
stefanschmidt /
Last active May 13, 2021
Dovecot command collection
# reload configuration
doveadm reload
# restart
service dovecot restart
# test authentication
doveadm auth test
# test login with passdb and userdb lookup
stefanschmidt / dns-query.rb
Last active Mar 1, 2019
Perform a DNS query with Ruby
View dns-query.rb
# requires net-dns gem
# query defaults to A record
require 'net/dns'
res =
packet = res.query("")
stefanschmidt / mx-query.rb
Created Mar 1, 2019
Perform an MX query with Ruby
View mx-query.rb
# requires net-dns gem
require 'net/dns'
res =
mx ="")
stefanschmidt / autenticate-ldap.rb
Last active Mar 1, 2019
Authenticate via LDAP with Ruby
View autenticate-ldap.rb
# Using an LDAP test server we will authenticate the user newton
# requires net-ldap gem
require 'net/ldap'
ldap = = ''
ldap.auth "uid=newton,dc=example,dc=com", "password"
if ldap.bind
puts 'authentication succeeded'