Skip to content

Instantly share code, notes, and snippets.

View patte's full-sized avatar

Patrick Recher patte

View GitHub Profile
@patte
patte / messages.csv
Last active January 20, 2019 16:05
fb
outbound day hour label
true 1204844400000 1502 07.03.2008 15:02
true 1205276400000 1133 12.03.2008 11:33
false 1205276400000 1548 12.03.2008 15:48
true 1205362800000 053 13.03.2008 00:53
true 1205535600000 110 15.03.2008 01:10
false 1207692000000 1546 09.04.2008 15:46
false 1208296800000 1755 16.04.2008 17:55
true 1208383200000 1438 17.04.2008 14:38
true 1208383200000 1448 17.04.2008 14:48
{
"data": {
"questionnaire": {
"id": "f44ac7ae-fa51-4565-aa90-fbcbf42bba40",
"userMainstreamScore": 0,
"answerSets": {
"userAnswerSet": null,
"sets": [
{
"id": "1111100000",
@patte
patte / wireguard-allowedips-exclude.md
Created April 1, 2021 20:49
exclude one address from Wireguard AllowedIPs

exclude one address from Wireguard AllowedIPs

The following python script calculates the network addresses in CIDR notation (ready to be set in the config to AllowedIPs =) to route all traffic (0.0.0.0/0) except for one address (30.31.32.33/32) through the wireguard interface. This is usefull if you run wireguard over another tunnel (e.g. udp2raw).

$ python3

import ipaddress
n1 = ipaddress.ip_network('0.0.0.0/0')
n2 = ipaddress.ip_network('30.31.32.33/32')
l = list(n1.address_exclude(n2))
@patte
patte / Logitech G502 X.md
Last active November 6, 2022 02:02
Logitech G502 X (HID, hidraw)
var topojsonClient = require("topojson-client")
ch = await fetch("https://swiss-maps.vercel.app/api/v0?format=topojson&projection=wgs84&year=2022&shapes=lakes").then(res => res.json())
geo = topojsonClient.feature(ch, ch.objects.lakes)
console.log(JSON.stringify(geo, null, 2))
@patte
patte / proxy_server.go
Created February 15, 2024 11:39
litefs proxy_server.go with simple websocket support
package main
import (
"io"
"log"
"net/http"
"net/http/httputil"
"net/url"
)