Skip to content

Instantly share code, notes, and snippets.

@sorenpeter
sorenpeter / apple_keyboad_dk_fix.sh
Last active February 2, 2026 08:12
Fix Danish keyboad layout when running Linux on a Apple MacBook
# Remap Danish MacBook keyboard to what is on the keys (by: sorenpeter@darch.dk)
# Based on: https://askubuntu.com/questions/843590/key-keycode-49-and-key-keycode-94-are-inverted-on-macbookpro-keyboar
# HOWTO: Save this as bash script and run it at statup/login
# Swap key under esc and next to z, plus fix dollersign
xmodmap -e "keycode 49 = less greater less greater backslash notsign backslash"
xmodmap -e "keycode 94 = dollar section onehalf section threequarters paragraph threequarters"
#xmodmap -e "keycode 0x5E = dollar section onehalf section threequarters paragraph threequarters"
#xmodmap -e "keycode 0x31 = less greater less greater backslash notsign backslash"
@sorenpeter
sorenpeter / webmention.php
Created March 16, 2024 22:15 — forked from adactio/webmention.php
Minimum viable webmention in PHP.
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
if (!isset($_POST['source']) || !isset($_POST['target'])) {
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
exit;
}