Skip to content

Instantly share code, notes, and snippets.

View klaernie's full-sized avatar

Andre Klärner klaernie

View GitHub Profile
@klaernie
klaernie / tee.py
Last active June 28, 2018 07:52 — forked from danielrichman/tee.py
bidirectional tee
#!/usr/bin/python
import sys
import subprocess
import threading
import signal
import logging
if len(sys.argv) < 3:
sys.stderr.write("Usage: {0} output_file command [arg [arg] ...]\n"\
@klaernie
klaernie / holymoly.md
Last active April 17, 2024 17:37 — forked from jpmens/holymoly.md
Create openHAB (Jetty) keystore from OpenSSL certificate/key pair

Configure openHAB keystore to use our own TLS server certificates

1. Launch openHAB, and verify that the shipped cert is in effect

$ openssl s_client -connect localhost:8443
[lots of stuff truncated]
-----END CERTIFICATE-----
subject=/C=Unknown/ST=Unknown/L=Unknown/O=openHAB/OU=Unknown/CN=openhab.org
issuer=/C=Unknown/ST=Unknown/L=Unknown/O=openHAB/OU=Unknown/CN=openhab.org

Keybase proof

I hereby claim:

  • I am klaernie on github.
  • I am klaernie (https://keybase.io/klaernie) on keybase.
  • I have a public key ASCRT_qdPIR81nt_ROVP9_uAJt9lgxefJ8-P7r1ZAlkUgQo

To claim this, I am signing this object:

@klaernie
klaernie / foreach_vs_array_asterix.php
Last active May 8, 2016 09:59 — forked from ak4n/foreach_vs_array_asterix
Benchmarking execution time of PHP constructs (list / each, foreach) vs (array_walk, array_map, array_reduce, array_filter)
<?php
/**
* Execution time check for: (list/each,foreach) vs (array_walk, array_map, array_reduce, array_filter)
* @docs to read
* http://www.giorgiosironi.com/2010/02/stop-writing-foreach-cycles.html
* http://www.pastie.org/829318
* http://php.net/manual/en/function.array-walk.php#112722
* http://zaemis.blogspot.com/2013/06/building-array-with-arrayreduce.html
* (!) http://stackoverflow.com/questions/2473989/list-of-big-o-for-php-functions/2484455#2484455
* http://www.faieta.net/wp/performance-implications-of-closures-in-php/
@klaernie
klaernie / .vimrc
Last active January 22, 2020 12:48 — forked from frasertweedale/.vimrc
vimrc-fu to bootstrap vundle. This code will bootstrap vundle and run PluginInstall when vundle is missing. It is non-interactive thanks to a healthy sprinkling of :silent, and assumes that Git is installed. This version is also aware that it initial run might be under vcsh, so it unsets $GIT_DIR before cloning vundle.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
let s:bootstrap = 0
try
call vundle#begin()
catch /E117:/
let s:bootstrap = 1
@klaernie
klaernie / .cVimrc
Last active January 31, 2018 15:01
" Settings
set noautofocus
set nosmoothscroll
set nohud
set autohidecursor
set typelinkhints
let scrollduration = 10
let searchlimit = 40
set smartsearch
" Mappings