Skip to content

Instantly share code, notes, and snippets.

View joneskoo's full-sized avatar

Joonas Kuorilehto joneskoo

View GitHub Profile
@joneskoo
joneskoo / sennheiser_hd595.scpt
Created January 27, 2024 11:43
Sennheiser HD595 AutoEQ settings for Apple Music
// https://autoeq.app
// Sennheiser HD595 / iTunes Built-in equalizer
tell application "Music"
activate
set newPreset to make new EQ preset
set name of newPreset to "Sennheiser HD595"
set band 1 of newPreset to 12
set band 2 of newPreset to 4.8
set band 3 of newPreset to -0.1
set band 4 of newPreset to -2.5
@joneskoo
joneskoo / interfaces.d-wan0
Last active May 16, 2020 15:06
interfaces.d for CAKE traffic shaping on cable modem (1G/100M)
auto wan0
iface wan0 inet dhcp
bridge_ports enp9s0 enp4s0f1
#bridge_hw 00:11:22:33:44:55
nameserver 127.0.0.1
# CAKE / Uplink shaping
post-up tc qdisc add dev enp9s0 root cake bandwidth 80Mbit docsis nat ack-filter
pre-down tc qdisc del dev enp9s0 root
@joneskoo
joneskoo / keybindings.json
Created August 7, 2019 18:07
VS code prefs
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+cmd+l",
"command": "editor.action.insertCursorAtEndOfEachLineSelected",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+c",
"command": "workbench.action.terminal.toggleTerminal"
@joneskoo
joneskoo / new_peer.sh
Created June 6, 2019 19:12
Wireguard client/server config generator
#!/bin/bash
set -eu
set -o pipefail
dns_server=172.24.100.250
client_ip=$1
psk=$(wg genpsk)
client_privkey=$(wg genkey)
client_pubkey=$(wg pubkey <<<"$client_privkey")
# Usage:
# $ docker build -t badtls.io .
# $ docker run --name badtlsio --rm -p 9990:9990 -p 9991:9991 -p 10000:10000 -p 10001:10001 -p 10002:10002 -p 10004:10004 -p 10005:10005 -p 11000:11000 -p 11001:11001 -p 11002:11002 -p 11003:11003 -p 11004:11004 -p 11005:11005 -p 11006:11006 -p 11007:11007 -p 11008:11008 -p 11009:11009 -it badtls.io
#
# Add to /etc/hosts:
# ::1 domain-match.badtls.io wildcard-match.badtls.io san-match.badtls.io required-auth.badtls.io optional-auth.badtls.io dh1024.badtls.io expired-1963.badtls.io future.badtls.io domain-mismatch.badtls.io san-mismatch.badtls.io weak-sig.badtls.io bad-key-usage.badtls.io expired.badtls.io wildcard.mismatch.badtls.io rc4.badtls.io rc4-md5.badtls.io
FROM nginx:latest
ADD . /badtls.io
$ uname -v
Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64
$ wget -q https://raw.githubusercontent.com/wbond/badtls.io/master/certs/ca.crt
$ CURL_CA_BUNDLE=ca.crt curl -v https://domain-match.badtls.io:10000/
* Trying 50.116.33.29...
* Connected to domain-match.badtls.io (50.116.33.29) port 10000 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: domain-match.badtls.io
* Server certificate: Bad TLS Limited RSA CA
> GET / HTTP/1.1
@joneskoo
joneskoo / go-13057.diff
Created July 12, 2016 20:51
Proof of concept to add KeyLogWriter to go crypto/tls (NSS key log file output)
diff --git a/vendor/crypto/tls/common.go b/vendor/crypto/tls/common.go
index c68ebfe..4ccde9b 100644
--- a/vendor/crypto/tls/common.go
+++ b/vendor/crypto/tls/common.go
@@ -349,6 +349,13 @@ type Config struct {
// be used.
CurvePreferences []CurveID
+ // KeyLogWriter is a debug log stream of all TLS master secrets
+ // as negotiated between client and server.
@joneskoo
joneskoo / Dockerfile
Last active July 4, 2016 16:30
remoteu2f-proxy dockerfile
FROM golang:1.6
RUN go get -u \
github.com/golang/protobuf/proto \
github.com/golang/protobuf/protoc-gen-go
RUN go get -d blitiri.com.ar/go/remoteu2f/remoteu2f-proxy
RUN cd /go/src/blitiri.com.ar/go/remoteu2f/ && git remote rm origin && git remote add origin https://github.com/joneskoo/remoteu2f && git pull origin rebuild-protobuf
RUN go install blitiri.com.ar/go/remoteu2f/remoteu2f-proxy
RUN mkdir /etc/remoteu2f-proxy && ( for i in `seq 1 10`; do head -c60 /dev/urandom | sha256sum -b | cut -d ' ' -f 1 ; done ) > /etc/remoteu2f-proxy/tokens
RUN openssl req -x509 -sha256 -newkey rsa:2048 -keyout /etc/ssl/yourkey.key -out /etc/ssl/yourcert.crt -days 3650 -nodes -subj '/CN=localhost'
CMD ["/go/bin/remoteu2f-proxy", \
"Hours": {
"PMax": {
"Item1": 1450515600000,
"Item2": 10.434
},
"QMax": null,
"Step": {
"TimeZoneInfo": {
"Id": "FLE Standard Time",
"DisplayName": "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
[joneskoo@grant energiatili]$ go run reader.go power.csv |grep WARN
WARN: Records missing, now 2011-12-31 22:00:00 +0000 UTC 2562047h47m16.854775807s
WARN: Offset now 0
WARN: Detected DST forward shift 2012-03-25 02:00:00 +0000 UTC
WARN: Records missing, now 2014-09-02 22:00:00 +0000 UTC 18265h0m0s
WARN: Offset now 1h0m0s
WARN: Detected DST backward shift 2014-10-26 01:00:00 +0000 UTC
WARN: Detected DST forward shift 2015-03-29 02:00:00 +0000 UTC
WARN: Detected DST backward shift 2015-10-25 01:00:00 +0000 UTC
WARN: Detected DST forward shift 2016-03-27 02:00:00 +0000 UTC