Skip to content

Instantly share code, notes, and snippets.

View Spindel's full-sized avatar
👷‍♂️
For hire

Spindel Ljungmark Spindel

👷‍♂️
For hire
  • https://www.modio.se/ @ModioAB
  • Sweden
  • 05:28 (UTC +02:00)
View GitHub Profile
@Spindel
Spindel / flock demo
Last active April 25, 2016 09:58
Using flock for SSL key generation
#!/bin/bash
set -eu
set -o pipefail
MY_CRT=temp.crt
MY_KEY=temp.key
MY_CSR=temp.csr
CLIENTID=`sed -e 's/://g' /sys/class/net/eth0/address`
SUBJECT="/C=XX/ST=TESTING/L=Testing/O=Test Inc/OU=Test Dept/CN=$CLIENTID"
@Spindel
Spindel / gist:7896135
Created December 10, 2013 19:01
PyPy does strange things
def min_max_native(indata):
def _minmax(data):
_value = itemgetter(2)
low = min(data, key=_value)
high = max(data, key=_value)
return (_value(low), _value(high))
copy = indata[:]
minmax = _minmax(copy)