Skip to content

Instantly share code, notes, and snippets.

View krmnn's full-sized avatar

Thomas Karmann krmnn

  • Berlin
  • 10:56 (UTC +02:00)
View GitHub Profile
@krmnn
krmnn / macOS: Make Thunderbird ask for passphrase input.md
Last active April 9, 2018 06:42
macOS: Make Thunderbird ask for passphrase input
  1. Install pinentry-mac package

    brew install pinentry-mac

  2. Tell gpg-agent to use it in ~/.gnupg/gpg-agent.conf:

    pinentry-program /usr/local/bin/pinentry-mac
    
@krmnn
krmnn / hackintosh: Update apfs.efi.md
Last active May 10, 2018 14:58
hackintosh: Update apfs.efi

Used by Clover to read the apfs Filesystem to load the kernel.

mount EFI (TODO: find realiable way to get the current system disk with clover)

mv /Volumes/EFI/EFI/CLOVER/drivers64UEFI/apfs.efi /Volumes/EFI/EFI/CLOVER/drivers64UEFI/apfs.efi.bak
cp /usr/standalone/i386/apfs.efi /Volumes/EFI/EFI/CLOVER/drivers64UEFI/

copy kext fixes to /Volumes/EFI/EFI/CLOVER/kexts/10.13/

@krmnn
krmnn / Investment and retirement planning overview for Germany.md
Last active April 21, 2018 10:38
Investment and retirement planning overview for Germany
@krmnn
krmnn / vagrant ssh
Created July 2, 2018 13:03
vagrant ssh
#!/bin/sh
PORT=$(vagrant ssh-config | grep Port | grep -o '[0-9]\+')
ssh -q \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
-i ~/.vagrant.d/insecure_private_key \
vagrant@localhost \
-p $PORT \
"$@"
@krmnn
krmnn / Gitea: Disable previously enabled two-factor auth for user.md
Created August 5, 2018 19:18
Gitea: Disable previously enabled two-factor auth for user
  1. Whats the uid?
  2. psql -U gitea -W -d gitea -h localhost
  3. \c gitea
  4. DELETE from two_factor where uid = 1;
@krmnn
krmnn / Social and ecological alternatives to Amazon.md
Last active August 27, 2018 07:27
Social and ecological alternatives to Amazon

Everything

Fairmondo.de

  • Cooperative of 2000 private persons, traders and distributors
  • Directed towards sustainable ecological goods. Fairmondo Comission for those products is 50%. Ecological information is displayed inline.
  • Mechanisms against corruption. They pay 1% of each trade to Transparency International.

Books

buch7.de

  • they pay 75% of their profit to social projects.
@krmnn
krmnn / wifionice.sh
Created March 20, 2019 10:28
Linux: Automatically accept Use Policy of Deutsche Bahn to use their WiFi when connecting
#!/usr/bin/env bash
# Put this script in "/etc/network/if-up.d/" and make it executable (chmod +x)
[ -z "$(iwconfig 2>/dev/null| grep 'WIFIonICE')" ] && exit
URL=http://www.wifionice.de/de/
CSRF_TOKEN=$(curl http://www.wifionice.de/de/|grep -oE 'value="[0-9a-f]{32}"' | cut -d = -f2|sed 's/"//g')
POST_DATA="
login=true&CSRFToken=${CSRF_TOKEN}&connect="
curl -v -d "$(echo $POST_DATA |sed 's/ /%20/g')" curl -v -A "Mozilla/9000.0 (X11; Linux x86_64; rv:65.0) Gecko/20000000 Firefox/1337" -H "Cookie: csrf=${CSRF_TOKEN}" -d "${POST_DATA}" $URL