This file contains 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
#!/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 |
This file contains 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
#### 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 |
This file contains 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
#### 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 |
This file contains 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
# 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 |
This file contains 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
# How to define Tecalor THZ heatpump: | |
# | |
define Mythz THZ <IP of device connected to heatpump>:2000 | |
define FileLog_Mythz FileLog ./log/Mythz-%Y.log Mythz | |
attr Mythz interval_sDHW 600 | |
attr Mythz interval_sHC1 600 | |
attr Mythz interval_sGlobal 600 | |
attr Mythz interval_sElectrDHWDay 3600 | |
attr Mythz interval_sHeatDHWDay 3600 | |
attr Mythz interval_sHeatRecoveredDay 3600 |
This file contains 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
# How to enable MQTT2_CLIENT: | |
# | |
define MyMQTT MQTT2_CLIENT <IP of MQTT server>:1883 | |
# How to set MQTT user name: | |
# | |
Go to FHEM => MyMQTT => attr MyMQTT | |
Select 'username' from drop-down menu (under 'MQTT2_CLIENT' heading) | |
Enter username in empty field and hit [Return] key |
This file contains 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
# How to add menu entries to FHEM's WebGUI: | |
# | |
# Click "Edit files" in navigation bar, then click on fhem.cfg | |
# In the new window, add following line to fhem.cfg (consider making a backup of fhem.cfg first): | |
attr WEB menuEntries Update,cmd=update,UpdateCheck,cmd=update+check,Restart,cmd=shutdown+restart | |
# To also add a menu entry for log file deletion, define an alias for the deletion command and add the menu entry, e.g.: | |
# | |
define c_dellog cmdalias dellog AS {qx(truncate $currlogfile --size 0);;Log 1, "logfile deleted";;} |
This file contains 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
# Enter following command to disable write protection for fhem.cfg (consider making a backup of fhem.cfg) | |
# | |
attr WEB editConfig 1 |
This file contains 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
# Connect mobile device to PC/laptop via USB | |
# Connect to your Wifi network (PC/laptop and mobile device must be in the same Wifi) | |
# Enter command: | |
adb kill-server | |
# Enter command: | |
adb usb |
This file contains 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
# How to test mosquitto broker and client on Raspberry Pi OS | |
# | |
# Source: https://randomnerdtutorials.com/testing-mosquitto-broker-and-client-on-raspbbery-pi/ | |
# | |
# Install mosquitto clients (if not already installed together with mosquitto broker) | |
# | |
sudo apt install mosquitto-clients | |
# Subscribe to topic "testTopic" |
NewerOlder