Skip to content

Instantly share code, notes, and snippets.

@7wells
7wells / gist:f32fa8f703cdab46b04c32e693bbae22
Created November 18, 2022 11:14
FHEM - How to ensure that ser2net starts not too early
# How to ensure that ser2net starts not too early (ie. not before the device is recognized)
#
sudo nano /lib/systemd/system/ser2net.service
# Add the following 2 lines in the [Unit] section:
After=network-online.target
Wants=network-online.target
# See also there: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000622
@7wells
7wells / gist:4f8bd463cfe89879faaed2c2c98027f8
Last active March 15, 2024 18:10
How to create a shortcut in Windows startup folder for Pageant incl. encrypted keys
#### How to create a shortcut in Windows startup folder for Pageant incl. encrypted keys
## References
# https://stackoverflow.com/questions/31814060/create-a-shortcut-with-parameters-added-to-the-program-path
# The below batch file creates a temporary vbs script, executes it to create the startup entry
# for pageant, and it cleanly deletes the temporary vbs file afterwards. As shown in the example,
# you can add multiple keys in `Arguments`. Replace them by your key file name(s). You might also need
@7wells
7wells / gist:ab7b61276e9b2fa048dd231341e55c02
Last active March 15, 2024 18:09
How to build Lineage OS 17.1 for Lenovo Tab4 10 Plus (TBX704)
#### How to build Lineage OS 17.1 for Lenovo Tab4 10 Plus (TBX704)
## References
# https://wiki.lineageos.org/devices/bacon/build
# https://xdaforums.com/t/how-to-build-lineageos-17-1-for-the-lenovo-tab4-10-plus.4275983
# Credits to: Ecthelion4 (see 2nd link)
## Prerequisites
@7wells
7wells / boot.sh
Created March 25, 2024 17:45 — forked from ThePlenkov/boot.sh
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null