# create
dd if=/dev/zero of=/tmp/sparse_file bs=1 count=0 seek=512M
sudo losetup /dev/loop10 /tmp/sparse_file
sudo zpool create test /dev/loop10
sudo zpool status test
# write
sudo zfs create test/fs
sudo dd if=/dev/urandom of=/test/fs/bigfile bs=1M count=400 status=progress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ## move away CR2 and AAE files | |
| cd /data/ | |
| SRC="./Fotos-Mediathek.photoslibrary/Masters/" | |
| DEST="./additional-files/Masters/" | |
| sudo mkdir -p "$DEST" | |
| sudo rsync -av \ | |
| --remove-source-files \ |
sudo apt install --no-install-recommends msmtp msmtp-mta bsd-mailx
sudo touch /var/log/msmtp
sudo chown root:users /var/log/msmtp
sudo chmod 664 /var/log/msmtp
echo 'set mta=/usr/bin/msmtp' | sudo tee -a /etc/mail.rc
sudo vi /etc/msmtprc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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"). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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> | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "io" | |
| "log" | |
| "net/http" | |
| "net/http/httputil" | |
| "net/url" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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))
NewerOlder