https://www.logitechg.com/en-us/products/gaming-mice/g502-x-wired-lightforce.910-006136.html
/sys/class/hidraw/hidraw2/device/uevent
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C099
# fix for: | |
# perl: warning: Setting locale failed. | |
# perl: warning: Please check that your locale settings: | |
# LANGUAGE = (unset), | |
# LC_ALL = (unset), | |
# LC_CTYPE = "UTF-8", | |
# LANG = "C.UTF-8" | |
# are supported and installed on your system. | |
# perl: warning: Falling back to a fallback locale ("C.UTF-8"). |
/** | |
* Asserts that the provided Uint8Array is backed by an ArrayBuffer. | |
* | |
* Throws an error if the buffer is a SharedArrayBuffer or any other type. | |
* This is useful for ensuring (type) compatibility with APIs that require Uint8Array<ArrayBuffer>. | |
* Usage: | |
* // bytes: Uint8Array<ArrayBufferLike> | |
* assertArrayBuffer(bytes); | |
* // bytes: Uint8Array<ArrayBuffer> | |
* |
# /etc/systemd/system/led.service | |
[Unit] | |
Description=Turn off boot button LED | |
After=multi-user.target | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash -c "echo 0 > /sys/class/leds/chromeos:white:power/brightness" | |
RemainAfterExit=true | |
User=root |
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) |
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)) |
https://www.logitechg.com/en-us/products/gaming-mice/g502-x-wired-lightforce.910-006136.html
/sys/class/hidraw/hidraw2/device/uevent
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C099
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))
{ | |
"data": { | |
"questionnaire": { | |
"id": "f44ac7ae-fa51-4565-aa90-fbcbf42bba40", | |
"userMainstreamScore": 0, | |
"answerSets": { | |
"userAnswerSet": null, | |
"sets": [ | |
{ | |
"id": "1111100000", |
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 |
How to archive a repo and copy the last n commits to a new one. republik/magazine
is used as an example here.
rebase-from
git config --global alias.rebase-from '!b="$(git branch --no-color | cut -c3-)" ; h="$(git rev-parse $b)" ; echo "Current branch: $b $h" ; c="$(git rev-parse $1)" ; echo "Recreating $b branch with initial commit $c ..." ; git checkout --orphan new-start $c ; git commit -C $c ; git rebase --onto new-start $c $b ; git branch -d new-start ; git reflog expire --expire=all ; git gc --prune=all'