Skip to content

Instantly share code, notes, and snippets.

View perguth's full-sized avatar
🎈

Per Guth perguth

🎈
View GitHub Profile
@perguth
perguth / computer
Last active July 23, 2019 14:01
Sleep host when Mosh is idle. Wake up on reconnect.
#!/bin/sh
wake-computer
echo 🚀 Connecting Mosh.
mosh [email protected]
@cosbgn
cosbgn / Find if your user is in the EU (Geolocation api javascript)
Created November 11, 2019 11:56
Find if user is in the EU without any extra API or server-side code or IP Address
// You can easily find out if the user is in the EU calculating the offset from GMT.
// It's not a perfect method but for simple use cases it works perfectly
// It also catches all Africa
const offset = new Date().getTimezoneOffset();
// 0 is GMT and - 120 is Finland -
// It should catch all the EU - However it also catches most of Africa so use it carefully!
@tdegrunt
tdegrunt / keyboardLayout.json
Last active January 27, 2025 01:36
Visual Studio Code (vscode/code) Colemak keyboard layout
{
"layout": {
"id": "com.apple.keylayout.Colemak",
"localizedName": "Colemak",
"lang": "en"
},
"rawMapping": {
"KeyA": {
"value": "a",
"valueIsDeadKey": false,
@zOrg1331
zOrg1331 / wireguard_layer2.md
Last active October 18, 2025 11:49
wireguard, wireguard layer 2, wireguard over TCP

Intro

This note describes how to connect two networks/devices/VMs over public network using Wireguard with Layer 2 support (ARP, IPv6 link-local, etc).

This can also be achieved using SSH and its "tap" tunnel, however, it does not provide the same level of latency and bandwidth as full-blown VPN such as Wireguard.

In addition, this note describes how to tunnel Wireguard over TCP connection. This may be of use if you encounter firewall in-between so, for instance, you can use TCP port 443 only.

Objective