Skip to content

Instantly share code, notes, and snippets.


Lars Kumbier LarsKumbier

View GitHub Profile
LarsKumbier /
Created Feb 15, 2019
This will update the remote ssh keys and reset the known_hosts file after a redeploy of new machines
#!/usr/bin/env bash
## This will update the remote ssh keys and reset the known_hosts file after a redeploy of a new VM
## will return the found * host names from an ansible file
## - alternatively, put your own logic here or give a fixed list:
## HOSTS=( )
HOSTS=( $(grep -o -e "[a-zA-Z0-9\-]*\.example\.com" inventory/heidelberg/inventory) )
LarsKumbier /
Created Aug 13, 2018
When activating HSTS, all links of a page will be rewritten from http to https upon clicking on them. This might lead to redirect-loops, where an https-page is redirecting to http and back on badly programmed rewrite rules. This script takes a list of urls and checks, if they run into a redirect-loop upon activating HSTS.
from urllib.parse import urlparse
import requests
import sys
def requestUrl(url, counter=0):
def upgradeUrl(url):
View db.users.find.json
"userId" : 1,
"__classname__" : "some-static-string",
"failedLoginCount": 0,
"mailValidated": true,
"answers": {
"toTheQuestion": -42,
"niceBlog": "Slate Star Codex"
mongoimport -d db -c users --type tsv --file export.tsv --headerline --columnsHaveTypes
View result.tsv failedLoginCount.int32() mailValidated.boolean() answers.toTheQuestion.int32()
1 'some-static-string' 0 TRUE -42 'Slate Star Codex'
2 'some-static-string' 2 FALSE -42 'Slate Star Codex'
LarsKumbier / export.sql
Last active Apr 16, 2019
Export Postgresql for mongoimport
View export.sql
userid AS "",
'some-static-string' AS "",
failed_login_count AS "failedLoginCount.int32()",
CASE WHEN mail_validated=TRUE THEN 'TRUE' ELSE 'FALSE' END AS "mailValidated.boolean()",
-42 AS "answers.toTheQuestion.int32()",
'Slate Star Codex' AS ""
LarsKumbier /
Created Apr 19, 2014
Proof of Identity for

Keybase proof

I hereby claim:

  • I am LarsKumbier on github.
  • I am larskumbier ( on keybase.
  • I have a public key whose fingerprint is 61DF 4812 8447 4B95 689B 9DB0 EE73 4042 E4AC D8BA

To claim this, I am signing this object: