https://wiki.ledhed.net/api.php?action=feedcontributions&user=Ledhed&feedformat=atomLedHed's Wiki - User contributions [en]2024-03-28T01:32:18ZUser contributionsMediaWiki 1.23.2//wiki.ledhed.net/index.php?title=TimedatectlTimedatectl2023-12-14T07:52:35Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
I always forget how to check NTP sync status on systems that use systemd.<br />
<br />
<br />
== timedatectl ==<br />
=== Status ===<br />
timedatectl<br />
<br />
=== Show last synced server ===<br />
timedatectl timesync-status<br />
<br />
<br />
== Reference ==<br />
https://man7.org/linux/man-pages/man1/timedatectl.1.html<br />
https://www.server-world.info/en/note?os=Ubuntu_22.04&p=ntp&f=3<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_NUT_ServerRaspberry Pi NUT Server2023-10-19T10:50:11Z<p>Ledhed: /* Example upsd.users */</p>
<hr />
<div>== Overview ==<br />
NUT is an OpenSource tool that can monitor an extensive list of UPS devices. Often times UPS manufactures charge an extremely high cost for their network monitoring / SNMP cards. NUT running on a Raspberry Pi or other inexpensive SBC can be a cost effective way to monitor an UPS and performed network wide graceful shutdown in the event of a power failure.<br />
<br />
<br />
== Prerequisites ==<br />
* Raspberry Pi or other SBC running a Debian based distro<br />
* NUT Compatible UPS (see: [https://networkupstools.org/stable-hcl.html NUT-HCL])<br />
* USB (or Serial to USB) connection to the Raspberry Pi<br />
* Network Connectivity (Wired or Wireless depending on RPi Model).<br />
<br />
<br />
== Installation ==<br />
=== Update the software package list ===<br />
sudo apt update<br />
sudo apt upgrade<br />
<br />
<br />
=== Install NUT ===<br />
sudo apt install nut<br />
<br />
<br />
<br />
== Server Configuration ==<br />
=== Configuration Files ===<br />
NUT is broken into two services: nut-server and nut-monitor. The configuration files for these services are located here:<br />
/etc/nut/<br />
<br />
<br />
=== ups.conf ===<br />
This is the configuration file for the UPS hardware. Here is where you specify the Driver, Make, and Model of the UPS.<br />
<br />
==== Obtaining the VendorID and ProductID ====<br />
You will need this information before editing ups.conf.<br />
lsusb<br />
<br />
Bus 001 Device 004: ID 0764:0601 Cyber Power System, Inc. PR1500LCDRT2U UPS<br />
In this case the '''ID''' field is '''0764:0601''' and this translates to '''<VendorID>:<ProductID>'''.<br />
<br />
==== Example ups.conf ====<br />
[ups1]<br />
driver = usbhid-ups<br />
port = auto<br />
vendor = "CyberPowerPC PR1500LCDRT2U"<br />
vendorid = 0764<br />
productid = 0601<br />
pollinterval = 1<br />
bus = "001"<br />
<br />
=== upsd.conf ===<br />
This file tells the UPS service what IP & Port to listen on.<br />
==== Example upsd.conf ====<br />
LISTEN 127.0.0.1 3493 # Listen on localhost<br />
LISTEN 192.168.69.69 3493 # Listen on the LAN<br />
<br />
<br />
=== upsd.users ===<br />
This file contains the list of users that can access NUT services.<br />
<br />
==== Security ====<br />
Its important to note that this file contains '''clear text passwords!''' So you should take steps to restrict read access to this file. For example, set it to only be readable by the root user.<br />
chown root.root /etc/nut/upsd.users<br />
chmod 600 /etc/nut/upsd.users<br />
<br />
==== Example upsd.users ====<br />
[upsmon_master]<br />
password = <MASTER_PASSWORD_HERE><br />
actions = SET<br />
instcmds = ALL<br />
upsmon master<br />
[upsmon_remote]<br />
password = <SLAVE_PASSWORD_HERE><br />
upsmon slave<br />
<br />
=== upsmon.conf ===<br />
This file tells the nut-monitor which users can access the monitoring service. It essentially maps the user you created in the previous step to an Access Control List which tells the monitoring service which users can connect from which hosts on your network.<br />
<br />
==== Security ====<br />
Its important to note that this file contains '''clear text passwords!''' So you should take steps to restrict read access to this file. For example, set it to only be readable by the root user.<br />
chown root.root /etc/nut/upsmon.conf<br />
chmod 600 /etc/nut/upsmon.conf<br />
<br />
==== Example upsmon.conf ====<br />
MONITOR ups1@localhost 1 upsmon_master <MASTER_PASSWORD_HERE> master<br />
'''Note: You'll likely have more than one line if you have remote clients connecting to this NUT server (which is really the whole point).'''<br />
<br />
<br />
=== nut.conf ===<br />
This file defines the type of role this installation of NUT will be performing.<br />
==== Example nut.conf ====<br />
MODE=netserver<br />
<br />
<br />
== Client Configuration ==<br />
<br />
<br />
== Other ==<br />
[NUT Client for ESXi]<br />
<br />
<br />
<br />
== References ==<br />
https://www.networkshinobi.com/raspberry-pi-as-ups-server-via-the-nut/<br />
<br />
https://haefelfinger.org/posts/2019/2019-11-20-using-network-ups-tools-and-mosquitto-part1/<br />
<br />
<br />
<br />
[[Category:NUT]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_NUT_ServerRaspberry Pi NUT Server2023-10-19T10:49:53Z<p>Ledhed: /* Example ups.conf */</p>
<hr />
<div>== Overview ==<br />
NUT is an OpenSource tool that can monitor an extensive list of UPS devices. Often times UPS manufactures charge an extremely high cost for their network monitoring / SNMP cards. NUT running on a Raspberry Pi or other inexpensive SBC can be a cost effective way to monitor an UPS and performed network wide graceful shutdown in the event of a power failure.<br />
<br />
<br />
== Prerequisites ==<br />
* Raspberry Pi or other SBC running a Debian based distro<br />
* NUT Compatible UPS (see: [https://networkupstools.org/stable-hcl.html NUT-HCL])<br />
* USB (or Serial to USB) connection to the Raspberry Pi<br />
* Network Connectivity (Wired or Wireless depending on RPi Model).<br />
<br />
<br />
== Installation ==<br />
=== Update the software package list ===<br />
sudo apt update<br />
sudo apt upgrade<br />
<br />
<br />
=== Install NUT ===<br />
sudo apt install nut<br />
<br />
<br />
<br />
== Server Configuration ==<br />
=== Configuration Files ===<br />
NUT is broken into two services: nut-server and nut-monitor. The configuration files for these services are located here:<br />
/etc/nut/<br />
<br />
<br />
=== ups.conf ===<br />
This is the configuration file for the UPS hardware. Here is where you specify the Driver, Make, and Model of the UPS.<br />
<br />
==== Obtaining the VendorID and ProductID ====<br />
You will need this information before editing ups.conf.<br />
lsusb<br />
<br />
Bus 001 Device 004: ID 0764:0601 Cyber Power System, Inc. PR1500LCDRT2U UPS<br />
In this case the '''ID''' field is '''0764:0601''' and this translates to '''<VendorID>:<ProductID>'''.<br />
<br />
==== Example ups.conf ====<br />
[ups1]<br />
driver = usbhid-ups<br />
port = auto<br />
vendor = "CyberPowerPC PR1500LCDRT2U"<br />
vendorid = 0764<br />
productid = 0601<br />
pollinterval = 1<br />
bus = "001"<br />
<br />
=== upsd.conf ===<br />
This file tells the UPS service what IP & Port to listen on.<br />
==== Example upsd.conf ====<br />
LISTEN 127.0.0.1 3493 # Listen on localhost<br />
LISTEN 192.168.69.69 3493 # Listen on the LAN<br />
<br />
<br />
=== upsd.users ===<br />
This file contains the list of users that can access NUT services.<br />
<br />
==== Security ====<br />
Its important to note that this file contains '''clear text passwords!''' So you should take steps to restrict read access to this file. For example, set it to only be readable by the root user.<br />
chown root.root /etc/nut/upsd.users<br />
chmod 600 /etc/nut/upsd.users<br />
<br />
==== Example upsd.users ====<br />
[upsmon_master]<br />
password = <MASTER_PASSWORD_HERE><br />
actions = SET<br />
instcmds = ALL<br />
upsmon master<br />
[upsmon_remote]<br />
password = <SLAVE_PASSWORD_HERE><br />
upsmon slave<br />
<br />
<br />
=== upsmon.conf ===<br />
This file tells the nut-monitor which users can access the monitoring service. It essentially maps the user you created in the previous step to an Access Control List which tells the monitoring service which users can connect from which hosts on your network.<br />
<br />
==== Security ====<br />
Its important to note that this file contains '''clear text passwords!''' So you should take steps to restrict read access to this file. For example, set it to only be readable by the root user.<br />
chown root.root /etc/nut/upsmon.conf<br />
chmod 600 /etc/nut/upsmon.conf<br />
<br />
==== Example upsmon.conf ====<br />
MONITOR ups1@localhost 1 upsmon_master <MASTER_PASSWORD_HERE> master<br />
'''Note: You'll likely have more than one line if you have remote clients connecting to this NUT server (which is really the whole point).'''<br />
<br />
<br />
=== nut.conf ===<br />
This file defines the type of role this installation of NUT will be performing.<br />
==== Example nut.conf ====<br />
MODE=netserver<br />
<br />
<br />
== Client Configuration ==<br />
<br />
<br />
== Other ==<br />
[NUT Client for ESXi]<br />
<br />
<br />
<br />
== References ==<br />
https://www.networkshinobi.com/raspberry-pi-as-ups-server-via-the-nut/<br />
<br />
https://haefelfinger.org/posts/2019/2019-11-20-using-network-ups-tools-and-mosquitto-part1/<br />
<br />
<br />
<br />
[[Category:NUT]]</div>Ledhed//wiki.ledhed.net/index.php?title=Kerberos_and_CNAMEsKerberos and CNAMEs2023-06-30T04:59:46Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
By default Kerberos authentication will fail when accessing a server using a DNS Alias / CNAME.<br />
<br />
<br />
== Solution ==<br />
Create an alias for the host in Active Directory using the 'netdom' command:<br />
netdom computername <FQDN> /Add:<ALIAS><br />
<br />
Example:<br><br />
Server's FQDN = FileServer-01.domain.tld <br><br />
CNAME/Alias = FS1.domain.tld<br><br />
netdom computername FileServer-01.domain.tld /Add:FS1.domain.tld<br />
<br />
The netdom command registers a SPN for the server using the provided alias.<br />
<br />
<br />
== References ==<br />
https://serverfault.com/questions/481289/will-kerberos-work-with-cnames-if-i-have-the-spn-created-for-the-a-record-as-wel<br />
<br />
<br />
[[Category:Active Directory]]</div>Ledhed//wiki.ledhed.net/index.php?title=Kerberos_and_CNAMEsKerberos and CNAMEs2023-06-30T04:57:58Z<p>Ledhed: Created page with "== Overview == By default Kerberos authentication will fail when accessing a server using a DNS Alias / CNAME. == Solution == Create an alias for the host in Active Director..."</p>
<hr />
<div>== Overview ==<br />
By default Kerberos authentication will fail when accessing a server using a DNS Alias / CNAME.<br />
<br />
<br />
== Solution ==<br />
Create an alias for the host in Active Directory using the 'netdom' command:<br />
netdom computername <FQDN> /Add:<ALIAS><br />
<br />
Example:<br><br />
Server's FQDN = FileServer-01.domain.tld <br><br />
CNAME/Alias = FS1.domain.tld<br><br />
netdom computername FileServer-01.domain.tld /Add:FS1.domain.tld<br />
<br />
<br />
== References ==<br />
https://serverfault.com/questions/481289/will-kerberos-work-with-cnames-if-i-have-the-spn-created-for-the-a-record-as-wel<br />
<br />
<br />
[[Category:Active Directory]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ecowitt_GW1000Ecowitt GW10002023-04-10T08:57:25Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
The Ecowitt GW1000 is a weather gateway capable of receiving data from weather instruments via Radio Frequency and then rebroadcasts that data via IP.<br />
<br />
<br />
== WSView App ==<br />
In order to configure the GW1000 you need to install the WSView app on a mobile device. Then put your mobile device on the same WiFi network as the GW1000.<br />
<br />
=== Ecowitt Protocol ===<br />
In the WSView app click 'More' in the upper right and click 'Weather Services' then next your way to 'Customized'. Enable the custom weather service, set the protocol to 'Ecowitt' and enter your server's IP & Port information. Save.<br />
<br />
<br />
<br />
== WeeWX Integration ==<br />
# Install WeeWX<br />
# Install the [https://github.com/matthewwall/weewx-interceptor weewx-interceptor driver]<br />
# Configure WeeWX to use the 'Interceptor Driver'<br />
# Edit '''/etc/weewx/weewx.conf''' and add the following:<br />
[Interceptor]<br />
driver = user.interceptor<br />
device_type = ecowitt-client<br />
address = 10.11.12.13<br />
port = 8080<br />
''Note: Enter your own IP and Port'' <br />
<br />
<br />
== Local API ==<br />
You can grab live weather data in JSON format directly from the GW1000 through this URL:<br><br />
<nowiki>http://<GW1000-IP-ADDRESS>/get_livedata_info</nowiki><br />
<br />
Here is a table to translate the byte balues to sensor type<br />
# command_byte : (type, device, data_length)<br />
0x01: ('temperature', 'indoor', 2)<br />
0x02: ('temperature', 'outdoor', 2)<br />
0x03: ('ignore', 'dewpoint', 2)<br />
0x04: ('ignore', 'windchill', 2)<br />
0x05: ('ignore', 'heatindex', 2)<br />
0x06: ('humidity', 'indoor', 1)<br />
0x07: ('humidity', 'outdoor', 1)<br />
0x08: ('pressure_absolute', 'indoor', 2)<br />
0x09: ('pressure_relative', 'indoor', 2)<br />
0x0a: ('ignore', 'winddir', 2)<br />
0x0b: ('ignore', 'windspeed', 2)<br />
0x0c: ('ignore', 'gustspeed', 2)<br />
0x0d: ('ignore', 't_rainevent', 2)<br />
0x0e: ('ignore', 't_rainrate', 2)<br />
0x0f: ('ignore', 't_raingain', 2)<br />
0x10: ('ignore', 't_rainday', 2)<br />
0x11: ('ignore', 't_rainweek', 2)<br />
0x12: ('ignore', 't_rainmonth', 4)<br />
0x13: ('ignore', 't_rainyear', 4)<br />
0x14: ('ignore', 't_raintotals', 4)<br />
0x15: ('ignore', 'light', 4)<br />
0x16: ('ignore', 'uv', 2)<br />
0x17: ('ignore', 'uvi', 1)<br />
0x18: ('ignore', 'datetime', 6)<br />
0x19: ('ignore', 'daymaxwind', 2)<br />
0x1a: ('temperature', 'channel_1', 2)<br />
0x1b: ('temperature', 'channel_2', 2)<br />
0x1c: ('temperature', 'channel_3', 2)<br />
0x1d: ('temperature', 'channel_4', 2)<br />
0x1e: ('temperature', 'channel_5', 2)<br />
0x1f: ('temperature', 'channel_6', 2)<br />
0x20: ('temperature', 'channel_7', 2)<br />
0x21: ('temperature', 'channel_8', 2)<br />
0x22: ('humidity', 'channel_1', 1)<br />
0x23: ('humidity', 'channel_2', 1)<br />
0x24: ('humidity', 'channel_3', 1)<br />
0x25: ('humidity', 'channel_4', 1)<br />
0x26: ('humidity', 'channel_5', 1)<br />
0x27: ('humidity', 'channel_6', 1)<br />
0x28: ('humidity', 'channel_7', 1)<br />
0x29: ('humidity', 'channel_8', 1)<br />
0x2a: ('ignore', 'pm251', 2)<br />
0x2b: ('ignore', 'soiltemp1', 2)<br />
0x2c: ('moisture', 'soil_1', 1)<br />
0x2d: ('ignore', 'soiltemp2', 2)<br />
0x2e: ('moisture', 'soil_2', 1)<br />
0x2f: ('ignore', 'soiltemp3', 2)<br />
0x30: ('moisture', 'soil_3', 1)<br />
0x31: ('ignore', 'soiltemp4', 2)<br />
0x32: ('moisture', 'soil_4', 1)<br />
0x33: ('ignore', 'soiltemp5', 2)<br />
0x34: ('moisture', 'soil_5', 1)<br />
0x35: ('ignore', 'soiltemp6', 2)<br />
0x36: ('moisture', 'soil_6', 1)<br />
0x37: ('ignore', 'soiltemp7', 2)<br />
0x38: ('moisture', 'soil_7', 1)<br />
0x39: ('ignore', 'soiltemp8', 2)<br />
0x3a: ('moisture', 'soil_8', 1)<br />
0x3b: ('ignore', 'soiltemp9', 2)<br />
0x3c: ('moisture', 'soil_9', 1)<br />
0x3d: ('ignore', 'soiltemp10', 2)<br />
0x3e: ('moisture', 'soil_10', 1)<br />
0x3f: ('ignore', 'soiltemp11', 2)<br />
0x40: ('moisture', 'soil_11', 1)<br />
0x41: ('ignore', 'soiltemp12', 2)<br />
0x42: ('moisture', 'soil_12', 1)<br />
0x43: ('ignore', 'soiltemp13', 2)<br />
0x44: ('moisture', 'soil_13', 1)<br />
0x45: ('ignore', 'soiltemp14', 2)<br />
0x46: ('moisture', 'soil_14', 1)<br />
0x47: ('ignore', 'soiltemp15', 2)<br />
0x48: ('moisture', 'soil_15', 1)<br />
0x49: ('ignore', 'soiltemp16', 2)<br />
0x4a: ('moisture', 'soil_16', 1)<br />
0x4c: ('ignore', 'lowbatt', 16)<br />
0x4d: ('ignore', 'pm251_24h_avg', 2)<br />
0x4e: ('ignore', 'pm252_24h_avg', 2)<br />
0x4f: ('ignore', 'pm253_24h_avg', 2)<br />
0x50: ('ignore', 'pm254_24h_avg', 2)<br />
0x51: ('ignore', 'pm252', 2)<br />
0x52: ('ignore', 'pm253', 2)<br />
0x53: ('ignore', 'pm254', 2)<br />
0x58: ('ignore', 'leak1', 1)<br />
0x59: ('ignore', 'leak2', 1)<br />
0x5a: ('ignore', 'leak3', 1)<br />
0x5b: ('ignore', 'leak4', 1)<br />
0x60: ('ignore', 'lightningdist', 1)<br />
0x61: ('ignore', 'lightningdettime', 4)<br />
0x62: ('ignore', 'lightningcount', 4)<br />
0x63: ('ignore', 'temp9', 3)<br />
0x64: ('ignore', 'temp10', 3)<br />
0x65: ('ignore', 'temp11', 3)<br />
0x66: ('ignore', 'temp12', 3)<br />
0x67: ('ignore', 'temp13', 3)<br />
0x68: ('ignore', 'temp14', 3)<br />
0x69: ('ignore', 'temp15', 3)<br />
0x6a: ('ignore', 'temp16', 3)<br />
0x70: ('ignore', 'wh45_data', 16)<br />
0x72: ('ignore', 'leafwet1', 1)<br />
0x73: ('ignore', 'leafwet2', 1)<br />
0x74: ('ignore', 'leafwet3', 1)<br />
0x75: ('ignore', 'leafwet4', 1)<br />
0x76: ('ignore', 'leafwet5', 1)<br />
0x77: ('ignore', 'leafwet6', 1)<br />
0x78: ('ignore', 'leafwet7', 1)<br />
0x79: ('ignore', 'leafwet8', 1)<br />
<br />
''Note: you might need a firmware update for this URL to become available.''<br />
<br />
<br />
== Ecowitt Relay ==<br />
In the off chance that you want to relay the Ecowitt data to multiple endpoints check out the FOSHKplugin<br />
https://loxwiki.atlassian.net/wiki/spaces/LOXBERRY/pages/1252524456/FOSHKplugin+-+generic+version#Installation<br />
It claims to be able to rebroadcast the Ecowitt data to multiple endpoints, meaning you could have it relay the data to WeeWx, Home Assistant, and maybe a smart sprinkler.<br />
<br />
<br />
== Reference ==<br />
https://github.com/matthewwall/weewx-interceptor<br />
<br />
http://www.ecowitt.com/wifi_weather/80.html<br />
<br />
http://weewx.com<br />
<br />
https://blog.meteodrenthe.nl/2023/02/03/how-to-use-the-ecowitt-gateway-gw1000-gw1100-local-api/<br />
<br />
https://github.com/bmrzycki/gw1000-http/blob/main/gw1000-http<br />
<br />
<br />
[[Category:WeeWX]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ecowitt_GW1000Ecowitt GW10002023-04-06T08:29:26Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
The Ecowitt GW1000 is a weather gateway capable of receiving data from weather instruments via Radio Frequency and then rebroadcasts that data via IP.<br />
<br />
<br />
== WSView App ==<br />
In order to configure the GW1000 you need to install the WSView app on a mobile device. Then put your mobile device on the same WiFi network as the GW1000.<br />
<br />
=== Ecowitt Protocol ===<br />
In the WSView app click 'More' in the upper right and click 'Weather Services' then next your way to 'Customized'. Enable the custom weather service, set the protocol to 'Ecowitt' and enter your server's IP & Port information. Save.<br />
<br />
<br />
<br />
== WeeWX Integration ==<br />
# Install WeeWX<br />
# Install the [https://github.com/matthewwall/weewx-interceptor weewx-interceptor driver]<br />
# Configure WeeWX to use the 'Interceptor Driver'<br />
# Edit '''/etc/weewx/weewx.conf''' and add the following:<br />
[Interceptor]<br />
driver = user.interceptor<br />
device_type = ecowitt-client<br />
address = 10.11.12.13<br />
port = 8080<br />
''Note: Enter your own IP and Port'' <br />
<br />
<br />
== Local API ==<br />
You can grab live weather data in JSON format directly from the GW1000 through this URL:<br><br />
<nowiki>http://<GW1000-IP-ADDRESS>/get_livedata_info</nowiki><br />
<br />
Here is a table to translate the byte balues to sensor type<br />
# command_byte : (type, device, data_length)<br />
0x01: ('temperature', 'indoor', 2)<br />
0x02: ('temperature', 'outdoor', 2)<br />
0x03: ('ignore', 'dewpoint', 2)<br />
0x04: ('ignore', 'windchill', 2)<br />
0x05: ('ignore', 'heatindex', 2)<br />
0x06: ('humidity', 'indoor', 1)<br />
0x07: ('humidity', 'outdoor', 1)<br />
0x08: ('pressure_absolute', 'indoor', 2)<br />
0x09: ('pressure_relative', 'indoor', 2)<br />
0x0a: ('ignore', 'winddir', 2)<br />
0x0b: ('ignore', 'windspeed', 2)<br />
0x0c: ('ignore', 'gustspeed', 2)<br />
0x0d: ('ignore', 't_rainevent', 2)<br />
0x0e: ('ignore', 't_rainrate', 2)<br />
0x0f: ('ignore', 't_raingain', 2)<br />
0x10: ('ignore', 't_rainday', 2)<br />
0x11: ('ignore', 't_rainweek', 2)<br />
0x12: ('ignore', 't_rainmonth', 4)<br />
0x13: ('ignore', 't_rainyear', 4)<br />
0x14: ('ignore', 't_raintotals', 4)<br />
0x15: ('ignore', 'light', 4)<br />
0x16: ('ignore', 'uv', 2)<br />
0x17: ('ignore', 'uvi', 1)<br />
0x18: ('ignore', 'datetime', 6)<br />
0x19: ('ignore', 'daymaxwind', 2)<br />
0x1a: ('temperature', 'channel_1', 2)<br />
0x1b: ('temperature', 'channel_2', 2)<br />
0x1c: ('temperature', 'channel_3', 2)<br />
0x1d: ('temperature', 'channel_4', 2)<br />
0x1e: ('temperature', 'channel_5', 2)<br />
0x1f: ('temperature', 'channel_6', 2)<br />
0x20: ('temperature', 'channel_7', 2)<br />
0x21: ('temperature', 'channel_8', 2)<br />
0x22: ('humidity', 'channel_1', 1)<br />
0x23: ('humidity', 'channel_2', 1)<br />
0x24: ('humidity', 'channel_3', 1)<br />
0x25: ('humidity', 'channel_4', 1)<br />
0x26: ('humidity', 'channel_5', 1)<br />
0x27: ('humidity', 'channel_6', 1)<br />
0x28: ('humidity', 'channel_7', 1)<br />
0x29: ('humidity', 'channel_8', 1)<br />
0x2a: ('ignore', 'pm251', 2)<br />
0x2b: ('ignore', 'soiltemp1', 2)<br />
0x2c: ('moisture', 'soil_1', 1)<br />
0x2d: ('ignore', 'soiltemp2', 2)<br />
0x2e: ('moisture', 'soil_2', 1)<br />
0x2f: ('ignore', 'soiltemp3', 2)<br />
0x30: ('moisture', 'soil_3', 1)<br />
0x31: ('ignore', 'soiltemp4', 2)<br />
0x32: ('moisture', 'soil_4', 1)<br />
0x33: ('ignore', 'soiltemp5', 2)<br />
0x34: ('moisture', 'soil_5', 1)<br />
0x35: ('ignore', 'soiltemp6', 2)<br />
0x36: ('moisture', 'soil_6', 1)<br />
0x37: ('ignore', 'soiltemp7', 2)<br />
0x38: ('moisture', 'soil_7', 1)<br />
0x39: ('ignore', 'soiltemp8', 2)<br />
0x3a: ('moisture', 'soil_8', 1)<br />
0x3b: ('ignore', 'soiltemp9', 2)<br />
0x3c: ('moisture', 'soil_9', 1)<br />
0x3d: ('ignore', 'soiltemp10', 2)<br />
0x3e: ('moisture', 'soil_10', 1)<br />
0x3f: ('ignore', 'soiltemp11', 2)<br />
0x40: ('moisture', 'soil_11', 1)<br />
0x41: ('ignore', 'soiltemp12', 2)<br />
0x42: ('moisture', 'soil_12', 1)<br />
0x43: ('ignore', 'soiltemp13', 2)<br />
0x44: ('moisture', 'soil_13', 1)<br />
0x45: ('ignore', 'soiltemp14', 2)<br />
0x46: ('moisture', 'soil_14', 1)<br />
0x47: ('ignore', 'soiltemp15', 2)<br />
0x48: ('moisture', 'soil_15', 1)<br />
0x49: ('ignore', 'soiltemp16', 2)<br />
0x4a: ('moisture', 'soil_16', 1)<br />
0x4c: ('ignore', 'lowbatt', 16)<br />
0x4d: ('ignore', 'pm251_24h_avg', 2)<br />
0x4e: ('ignore', 'pm252_24h_avg', 2)<br />
0x4f: ('ignore', 'pm253_24h_avg', 2)<br />
0x50: ('ignore', 'pm254_24h_avg', 2)<br />
0x51: ('ignore', 'pm252', 2)<br />
0x52: ('ignore', 'pm253', 2)<br />
0x53: ('ignore', 'pm254', 2)<br />
0x58: ('ignore', 'leak1', 1)<br />
0x59: ('ignore', 'leak2', 1)<br />
0x5a: ('ignore', 'leak3', 1)<br />
0x5b: ('ignore', 'leak4', 1)<br />
0x60: ('ignore', 'lightningdist', 1)<br />
0x61: ('ignore', 'lightningdettime', 4)<br />
0x62: ('ignore', 'lightningcount', 4)<br />
0x63: ('ignore', 'temp9', 3)<br />
0x64: ('ignore', 'temp10', 3)<br />
0x65: ('ignore', 'temp11', 3)<br />
0x66: ('ignore', 'temp12', 3)<br />
0x67: ('ignore', 'temp13', 3)<br />
0x68: ('ignore', 'temp14', 3)<br />
0x69: ('ignore', 'temp15', 3)<br />
0x6a: ('ignore', 'temp16', 3)<br />
0x70: ('ignore', 'wh45_data', 16)<br />
0x72: ('ignore', 'leafwet1', 1)<br />
0x73: ('ignore', 'leafwet2', 1)<br />
0x74: ('ignore', 'leafwet3', 1)<br />
0x75: ('ignore', 'leafwet4', 1)<br />
0x76: ('ignore', 'leafwet5', 1)<br />
0x77: ('ignore', 'leafwet6', 1)<br />
0x78: ('ignore', 'leafwet7', 1)<br />
0x79: ('ignore', 'leafwet8', 1)<br />
<br />
''Note: you might need a firmware update for this URL to become available.''<br />
<br />
<br />
== Reference ==<br />
https://github.com/matthewwall/weewx-interceptor<br />
<br />
http://www.ecowitt.com/wifi_weather/80.html<br />
<br />
http://weewx.com<br />
<br />
https://blog.meteodrenthe.nl/2023/02/03/how-to-use-the-ecowitt-gateway-gw1000-gw1100-local-api/<br />
<br />
https://github.com/bmrzycki/gw1000-http/blob/main/gw1000-http<br />
<br />
<br />
[[Category:WeeWX]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ecowitt_GW1000Ecowitt GW10002023-04-06T08:27:21Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
The Ecowitt GW1000 is a weather gateway capable of receiving data from weather instruments via Radio Frequency and then rebroadcasts that data via IP.<br />
<br />
<br />
== WSView App ==<br />
In order to configure the GW1000 you need to install the WSView app on a mobile device. Then put your mobile device on the same WiFi network as the GW1000.<br />
<br />
=== Ecowitt Protocol ===<br />
In the WSView app click 'More' in the upper right and click 'Weather Services' then next your way to 'Customized'. Enable the custom weather service, set the protocol to 'Ecowitt' and enter your server's IP & Port information. Save.<br />
<br />
<br />
<br />
== WeeWX Integration ==<br />
# Install WeeWX<br />
# Install the [https://github.com/matthewwall/weewx-interceptor weewx-interceptor driver]<br />
# Configure WeeWX to use the 'Interceptor Driver'<br />
# Edit '''/etc/weewx/weewx.conf''' and add the following:<br />
[Interceptor]<br />
driver = user.interceptor<br />
device_type = ecowitt-client<br />
address = 10.11.12.13<br />
port = 8080<br />
''Note: Enter your own IP and Port'' <br />
<br />
<br />
== Local API ==<br />
You can grab live weather data in JSON format directly from the GW1000 through this URL:<br><br />
http://<GW1000-IP-ADDRESS>/get_livedata_info<br />
<br />
Here is a table to translate the byte balues to sensor type<br />
# command_byte : (type, device, data_length)<br />
0x01: ('temperature', 'indoor', 2)<br />
0x02: ('temperature', 'outdoor', 2)<br />
0x03: ('ignore', 'dewpoint', 2)<br />
0x04: ('ignore', 'windchill', 2)<br />
0x05: ('ignore', 'heatindex', 2)<br />
0x06: ('humidity', 'indoor', 1)<br />
0x07: ('humidity', 'outdoor', 1)<br />
0x08: ('pressure_absolute', 'indoor', 2)<br />
0x09: ('pressure_relative', 'indoor', 2)<br />
0x0a: ('ignore', 'winddir', 2)<br />
0x0b: ('ignore', 'windspeed', 2)<br />
0x0c: ('ignore', 'gustspeed', 2)<br />
0x0d: ('ignore', 't_rainevent', 2)<br />
0x0e: ('ignore', 't_rainrate', 2)<br />
0x0f: ('ignore', 't_raingain', 2)<br />
0x10: ('ignore', 't_rainday', 2)<br />
0x11: ('ignore', 't_rainweek', 2)<br />
0x12: ('ignore', 't_rainmonth', 4)<br />
0x13: ('ignore', 't_rainyear', 4)<br />
0x14: ('ignore', 't_raintotals', 4)<br />
0x15: ('ignore', 'light', 4)<br />
0x16: ('ignore', 'uv', 2)<br />
0x17: ('ignore', 'uvi', 1)<br />
0x18: ('ignore', 'datetime', 6)<br />
0x19: ('ignore', 'daymaxwind', 2)<br />
0x1a: ('temperature', 'channel_1', 2)<br />
0x1b: ('temperature', 'channel_2', 2)<br />
0x1c: ('temperature', 'channel_3', 2)<br />
0x1d: ('temperature', 'channel_4', 2)<br />
0x1e: ('temperature', 'channel_5', 2)<br />
0x1f: ('temperature', 'channel_6', 2)<br />
0x20: ('temperature', 'channel_7', 2)<br />
0x21: ('temperature', 'channel_8', 2)<br />
0x22: ('humidity', 'channel_1', 1)<br />
0x23: ('humidity', 'channel_2', 1)<br />
0x24: ('humidity', 'channel_3', 1)<br />
0x25: ('humidity', 'channel_4', 1)<br />
0x26: ('humidity', 'channel_5', 1)<br />
0x27: ('humidity', 'channel_6', 1)<br />
0x28: ('humidity', 'channel_7', 1)<br />
0x29: ('humidity', 'channel_8', 1)<br />
0x2a: ('ignore', 'pm251', 2)<br />
0x2b: ('ignore', 'soiltemp1', 2)<br />
0x2c: ('moisture', 'soil_1', 1)<br />
0x2d: ('ignore', 'soiltemp2', 2)<br />
0x2e: ('moisture', 'soil_2', 1)<br />
0x2f: ('ignore', 'soiltemp3', 2)<br />
0x30: ('moisture', 'soil_3', 1)<br />
0x31: ('ignore', 'soiltemp4', 2)<br />
0x32: ('moisture', 'soil_4', 1)<br />
0x33: ('ignore', 'soiltemp5', 2)<br />
0x34: ('moisture', 'soil_5', 1)<br />
0x35: ('ignore', 'soiltemp6', 2)<br />
0x36: ('moisture', 'soil_6', 1)<br />
0x37: ('ignore', 'soiltemp7', 2)<br />
0x38: ('moisture', 'soil_7', 1)<br />
0x39: ('ignore', 'soiltemp8', 2)<br />
0x3a: ('moisture', 'soil_8', 1)<br />
0x3b: ('ignore', 'soiltemp9', 2)<br />
0x3c: ('moisture', 'soil_9', 1)<br />
0x3d: ('ignore', 'soiltemp10', 2)<br />
0x3e: ('moisture', 'soil_10', 1)<br />
0x3f: ('ignore', 'soiltemp11', 2)<br />
0x40: ('moisture', 'soil_11', 1)<br />
0x41: ('ignore', 'soiltemp12', 2)<br />
0x42: ('moisture', 'soil_12', 1)<br />
0x43: ('ignore', 'soiltemp13', 2)<br />
0x44: ('moisture', 'soil_13', 1)<br />
0x45: ('ignore', 'soiltemp14', 2)<br />
0x46: ('moisture', 'soil_14', 1)<br />
0x47: ('ignore', 'soiltemp15', 2)<br />
0x48: ('moisture', 'soil_15', 1)<br />
0x49: ('ignore', 'soiltemp16', 2)<br />
0x4a: ('moisture', 'soil_16', 1)<br />
0x4c: ('ignore', 'lowbatt', 16)<br />
0x4d: ('ignore', 'pm251_24h_avg', 2)<br />
0x4e: ('ignore', 'pm252_24h_avg', 2)<br />
0x4f: ('ignore', 'pm253_24h_avg', 2)<br />
0x50: ('ignore', 'pm254_24h_avg', 2)<br />
0x51: ('ignore', 'pm252', 2)<br />
0x52: ('ignore', 'pm253', 2)<br />
0x53: ('ignore', 'pm254', 2)<br />
0x58: ('ignore', 'leak1', 1)<br />
0x59: ('ignore', 'leak2', 1)<br />
0x5a: ('ignore', 'leak3', 1)<br />
0x5b: ('ignore', 'leak4', 1)<br />
0x60: ('ignore', 'lightningdist', 1)<br />
0x61: ('ignore', 'lightningdettime', 4)<br />
0x62: ('ignore', 'lightningcount', 4)<br />
0x63: ('ignore', 'temp9', 3)<br />
0x64: ('ignore', 'temp10', 3)<br />
0x65: ('ignore', 'temp11', 3)<br />
0x66: ('ignore', 'temp12', 3)<br />
0x67: ('ignore', 'temp13', 3)<br />
0x68: ('ignore', 'temp14', 3)<br />
0x69: ('ignore', 'temp15', 3)<br />
0x6a: ('ignore', 'temp16', 3)<br />
0x70: ('ignore', 'wh45_data', 16)<br />
0x72: ('ignore', 'leafwet1', 1)<br />
0x73: ('ignore', 'leafwet2', 1)<br />
0x74: ('ignore', 'leafwet3', 1)<br />
0x75: ('ignore', 'leafwet4', 1)<br />
0x76: ('ignore', 'leafwet5', 1)<br />
0x77: ('ignore', 'leafwet6', 1)<br />
0x78: ('ignore', 'leafwet7', 1)<br />
0x79: ('ignore', 'leafwet8', 1)<br />
<br />
''Note: you might need a firmware update for this URL to become available.''<br />
<br />
<br />
== Reference ==<br />
https://github.com/matthewwall/weewx-interceptor<br />
<br />
http://www.ecowitt.com/wifi_weather/80.html<br />
<br />
http://weewx.com<br />
<br />
https://blog.meteodrenthe.nl/2023/02/03/how-to-use-the-ecowitt-gateway-gw1000-gw1100-local-api/<br />
<br />
https://github.com/bmrzycki/gw1000-http/blob/main/gw1000-http<br />
<br />
<br />
[[Category:WeeWX]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ecowitt_GW1000Ecowitt GW10002023-04-06T08:27:00Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
The Ecowitt GW1000 is a weather gateway capable of receiving data from weather instruments via Radio Frequency and then rebroadcasts that data via IP.<br />
<br />
<br />
== WSView App ==<br />
In order to configure the GW1000 you need to install the WSView app on a mobile device. Then put your mobile device on the same WiFi network as the GW1000.<br />
<br />
=== Ecowitt Protocol ===<br />
In the WSView app click 'More' in the upper right and click 'Weather Services' then next your way to 'Customized'. Enable the custom weather service, set the protocol to 'Ecowitt' and enter your server's IP & Port information. Save.<br />
<br />
<br />
<br />
== WeeWX Integration ==<br />
# Install WeeWX<br />
# Install the [https://github.com/matthewwall/weewx-interceptor weewx-interceptor driver]<br />
# Configure WeeWX to use the 'Interceptor Driver'<br />
# Edit '''/etc/weewx/weewx.conf''' and add the following:<br />
[Interceptor]<br />
driver = user.interceptor<br />
device_type = ecowitt-client<br />
address = 10.11.12.13<br />
port = 8080<br />
''Note: Enter your own IP and Port'' <br />
<br />
<br />
== Local API ==<br />
You can grab live weather data in JSON format directly from the GW1000 through this URL:<br />
http://<GW1000-IP-ADDRESS>/get_livedata_info<br />
<br />
Here is a table to translate the byte balues to sensor type<br />
# command_byte : (type, device, data_length)<br />
0x01: ('temperature', 'indoor', 2)<br />
0x02: ('temperature', 'outdoor', 2)<br />
0x03: ('ignore', 'dewpoint', 2)<br />
0x04: ('ignore', 'windchill', 2)<br />
0x05: ('ignore', 'heatindex', 2)<br />
0x06: ('humidity', 'indoor', 1)<br />
0x07: ('humidity', 'outdoor', 1)<br />
0x08: ('pressure_absolute', 'indoor', 2)<br />
0x09: ('pressure_relative', 'indoor', 2)<br />
0x0a: ('ignore', 'winddir', 2)<br />
0x0b: ('ignore', 'windspeed', 2)<br />
0x0c: ('ignore', 'gustspeed', 2)<br />
0x0d: ('ignore', 't_rainevent', 2)<br />
0x0e: ('ignore', 't_rainrate', 2)<br />
0x0f: ('ignore', 't_raingain', 2)<br />
0x10: ('ignore', 't_rainday', 2)<br />
0x11: ('ignore', 't_rainweek', 2)<br />
0x12: ('ignore', 't_rainmonth', 4)<br />
0x13: ('ignore', 't_rainyear', 4)<br />
0x14: ('ignore', 't_raintotals', 4)<br />
0x15: ('ignore', 'light', 4)<br />
0x16: ('ignore', 'uv', 2)<br />
0x17: ('ignore', 'uvi', 1)<br />
0x18: ('ignore', 'datetime', 6)<br />
0x19: ('ignore', 'daymaxwind', 2)<br />
0x1a: ('temperature', 'channel_1', 2)<br />
0x1b: ('temperature', 'channel_2', 2)<br />
0x1c: ('temperature', 'channel_3', 2)<br />
0x1d: ('temperature', 'channel_4', 2)<br />
0x1e: ('temperature', 'channel_5', 2)<br />
0x1f: ('temperature', 'channel_6', 2)<br />
0x20: ('temperature', 'channel_7', 2)<br />
0x21: ('temperature', 'channel_8', 2)<br />
0x22: ('humidity', 'channel_1', 1)<br />
0x23: ('humidity', 'channel_2', 1)<br />
0x24: ('humidity', 'channel_3', 1)<br />
0x25: ('humidity', 'channel_4', 1)<br />
0x26: ('humidity', 'channel_5', 1)<br />
0x27: ('humidity', 'channel_6', 1)<br />
0x28: ('humidity', 'channel_7', 1)<br />
0x29: ('humidity', 'channel_8', 1)<br />
0x2a: ('ignore', 'pm251', 2)<br />
0x2b: ('ignore', 'soiltemp1', 2)<br />
0x2c: ('moisture', 'soil_1', 1)<br />
0x2d: ('ignore', 'soiltemp2', 2)<br />
0x2e: ('moisture', 'soil_2', 1)<br />
0x2f: ('ignore', 'soiltemp3', 2)<br />
0x30: ('moisture', 'soil_3', 1)<br />
0x31: ('ignore', 'soiltemp4', 2)<br />
0x32: ('moisture', 'soil_4', 1)<br />
0x33: ('ignore', 'soiltemp5', 2)<br />
0x34: ('moisture', 'soil_5', 1)<br />
0x35: ('ignore', 'soiltemp6', 2)<br />
0x36: ('moisture', 'soil_6', 1)<br />
0x37: ('ignore', 'soiltemp7', 2)<br />
0x38: ('moisture', 'soil_7', 1)<br />
0x39: ('ignore', 'soiltemp8', 2)<br />
0x3a: ('moisture', 'soil_8', 1)<br />
0x3b: ('ignore', 'soiltemp9', 2)<br />
0x3c: ('moisture', 'soil_9', 1)<br />
0x3d: ('ignore', 'soiltemp10', 2)<br />
0x3e: ('moisture', 'soil_10', 1)<br />
0x3f: ('ignore', 'soiltemp11', 2)<br />
0x40: ('moisture', 'soil_11', 1)<br />
0x41: ('ignore', 'soiltemp12', 2)<br />
0x42: ('moisture', 'soil_12', 1)<br />
0x43: ('ignore', 'soiltemp13', 2)<br />
0x44: ('moisture', 'soil_13', 1)<br />
0x45: ('ignore', 'soiltemp14', 2)<br />
0x46: ('moisture', 'soil_14', 1)<br />
0x47: ('ignore', 'soiltemp15', 2)<br />
0x48: ('moisture', 'soil_15', 1)<br />
0x49: ('ignore', 'soiltemp16', 2)<br />
0x4a: ('moisture', 'soil_16', 1)<br />
0x4c: ('ignore', 'lowbatt', 16)<br />
0x4d: ('ignore', 'pm251_24h_avg', 2)<br />
0x4e: ('ignore', 'pm252_24h_avg', 2)<br />
0x4f: ('ignore', 'pm253_24h_avg', 2)<br />
0x50: ('ignore', 'pm254_24h_avg', 2)<br />
0x51: ('ignore', 'pm252', 2)<br />
0x52: ('ignore', 'pm253', 2)<br />
0x53: ('ignore', 'pm254', 2)<br />
0x58: ('ignore', 'leak1', 1)<br />
0x59: ('ignore', 'leak2', 1)<br />
0x5a: ('ignore', 'leak3', 1)<br />
0x5b: ('ignore', 'leak4', 1)<br />
0x60: ('ignore', 'lightningdist', 1)<br />
0x61: ('ignore', 'lightningdettime', 4)<br />
0x62: ('ignore', 'lightningcount', 4)<br />
0x63: ('ignore', 'temp9', 3)<br />
0x64: ('ignore', 'temp10', 3)<br />
0x65: ('ignore', 'temp11', 3)<br />
0x66: ('ignore', 'temp12', 3)<br />
0x67: ('ignore', 'temp13', 3)<br />
0x68: ('ignore', 'temp14', 3)<br />
0x69: ('ignore', 'temp15', 3)<br />
0x6a: ('ignore', 'temp16', 3)<br />
0x70: ('ignore', 'wh45_data', 16)<br />
0x72: ('ignore', 'leafwet1', 1)<br />
0x73: ('ignore', 'leafwet2', 1)<br />
0x74: ('ignore', 'leafwet3', 1)<br />
0x75: ('ignore', 'leafwet4', 1)<br />
0x76: ('ignore', 'leafwet5', 1)<br />
0x77: ('ignore', 'leafwet6', 1)<br />
0x78: ('ignore', 'leafwet7', 1)<br />
0x79: ('ignore', 'leafwet8', 1)<br />
<br />
''Note: you might need a firmware update for this URL to become available.''<br />
<br />
<br />
== Reference ==<br />
https://github.com/matthewwall/weewx-interceptor<br />
<br />
http://www.ecowitt.com/wifi_weather/80.html<br />
<br />
http://weewx.com<br />
<br />
https://blog.meteodrenthe.nl/2023/02/03/how-to-use-the-ecowitt-gateway-gw1000-gw1100-local-api/<br />
<br />
https://github.com/bmrzycki/gw1000-http/blob/main/gw1000-http<br />
<br />
<br />
[[Category:WeeWX]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ubuntu_Resize_DiskUbuntu Resize Disk2023-02-14T09:11:11Z<p>Ledhed: Created page with "== Overview == Sometimes you have to resize a VMs disk. This is a fairly trivial process, open the VMs settings, increase the disks size. Go to guest and resize the partition..."</p>
<hr />
<div>== Overview ==<br />
Sometimes you have to resize a VMs disk. This is a fairly trivial process, open the VMs settings, increase the disks size. Go to guest and resize the partition and filesystem, done!<br><br />
What happens if your VM doesn't see the increase in disk size?<br />
<br />
== Ubuntu (and probably other flavors of Linux) ==<br />
As root run the following command to initiate a rescan of the disk.<br />
echo 1 >/sys/class/block/sdb/device/rescan<br />
<br />
You can verify the size changes by running:<br />
fdisk -l /dev/sdb<br />
<br />
You can also grow the partition by running:<br />
growpart /dev/sdb 1<br />
This will grow the first partition to fill the disk<br />
<br />
You can also resize the filesystem by running:<br />
resize2fs /dev/sdb1<br />
<br />
<br />
== Reference ==<br />
https://kerneltalks.com/disk-management/how-to-rescan-disk-in-linux-after-extending-vmware-disk/<br />
<br />
<br />
[[category:Ubuntu]][[category:Linux]][[category:ESXi]]</div>Ledhed//wiki.ledhed.net/index.php?title=MySQL_Command_ReferenceMySQL Command Reference2023-02-07T03:21:12Z<p>Ledhed: </p>
<hr />
<div>== Combine 2 fields into one result ==<br />
<br />
SELECT CONCAT(fieldname1, fieldname2) FROM table<br />
Example:<br />
SELECT CONCAT(u.first, ' ', u.last) AS name FROM usr_table u<br />
<br />
ID | first | last |<br />
-----------------------------<br />
1 | Led | Hed |<br />
2 | Jimmy | Page |<br />
<br />
Results:<br />
Name<br />
----------- <br />
Led Hed<br />
Jimmy Page<br />
<br />
<br />
<br />
== Add fixed String to a field ==<br />
<br />
SELECT CONCAT(fieldname1, 'fixed string') FROM table<br />
<br><br />
<br />
<br />
<br />
== Do not return Duplicates ==<br />
<br />
SELECT DISTINCT fieldname FROM table<br />
<br><br />
<br />
<br />
== Return the 'Sum' of all fields selected ==<br />
<br />
SELECT SUM(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Round to 2 decimal places ==<br />
<br />
SELECT ROUND(fieldname, 2) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects only the field with the highest numerical value ==<br />
<br />
SELECT MAX(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects the leftmost 4 characters in a field ==<br />
<br />
SELECT LEFT(fieldname, 4) FROM table<br />
<br><br />
<br />
<br />
<br />
== Select date and format result in MM/DD/YYYY ==<br />
<br />
SELECT DATE_FORMAT(fieldname, '%c/%d/%Y') from table<br />
<br />
%a Abbreviated weekday name (Sun..Sat)<br />
%b Abbreviated month name (Jan..Dec)<br />
%c Month, numeric (0..12)<br />
%D Day of the month with English suffix (0th, 1st, 2nd, 3rd, â¦)<br />
%d Day of the month, numeric (00..31)<br />
%e Day of the month, numeric (0..31)<br />
%f Microseconds (000000..999999)<br />
%H Hour (00..23)<br />
%h Hour (01..12)<br />
%I Hour (01..12)<br />
%i Minutes, numeric (00..59)<br />
%j Day of year (001..366)<br />
%k Hour (0..23)<br />
%l Hour (1..12)<br />
%M Month name (January..December)<br />
%m Month, numeric (00..12)<br />
%p AM or PM<br />
%r Time, 12-hour (hh:mm:ss followed by AM or PM)<br />
%S Seconds (00..59)<br />
%s Seconds (00..59)<br />
%T Time, 24-hour (hh:mm:ss)<br />
%U Week (00..53), where Sunday is the first day of the week<br />
%u Week (00..53), where Monday is the first day of the week<br />
%V Week (01..53), where Sunday is the first day of the week; used with %X<br />
%v Week (01..53), where Monday is the first day of the week; used with %x<br />
%W Weekday name (Sunday..Saturday)<br />
%w Day of the week (0=Sunday..6=Saturday)<br />
%X Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V<br />
%x Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v<br />
%Y Year, numeric, four digits<br />
%y Year, numeric (two digits)<br />
%% A literal â%â character<br />
%x x, for any âxâ not listed above<br />
<br />
<br />
<br />
== Join fields from different tables ==<br />
<br />
SELECT a.fieldname1 b.fieldname2 FROM tableA a LEFT JOIN tableB b ON a.fieldname1 = b.fieldname1<br />
''To join these fields the values of a.fieldname1 and b.fieldname1 must be equal''<br><br />
''Example: SELECT j.JobName b.Amount FROM job j JOIN invoice i ON j.JobID = i.JobID WHERE j.JobID = '00123'''<br><br />
''The '''job''' table and '''invoice''' table were joined by the value of their '''JobID''' fields''<br><br />
'''''b.Amount''' was Selected from the invoice table where invoice.JobID = '00123' and '''j.JobName''' was Selected from the job table where job.JobID = '00123' ''<br><br />
<br><br />
<br><br />
<br />
<br />
<br />
== Change Column order within a table ==<br />
<br />
Reference: http://dev.mysql.com/doc/refman/5.0/en/change-column-order.html<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext AFTER ColumnNameToPutAfter<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext BEFORE ColumnNameToPutBefore<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext FIRST<br />
<br><br />
<br><br />
<br />
<br />
<br />
== Allow access from remote host ==<br />
<br />
GRANT ALL ON <DatabaseName>.* TO <User>@"<IP Address or Hostname>" IDENTIFIED BY "<Password>";<br />
FLUSH PRIVILEGES;<br />
Example:<br />
GRANT ALL ON *.* TO root@"10.0.0.25" IDENTIFIED BY "SomePassword";<br />
FLUSH PRIVILEGES;<br />
''This grants 'ALL' privileges for every database (*.*) to the user 'root' when connecting from IP Address 10.0.0.25 and the password given is 'SomePassword' ''<br><br />
''NOTE: Granting 'ALL' privileges to all (*.*) databases can be a security risk. In real world scenarios, only grant the privileges that are necessary and only to the user/hosts that need them.''<br />
<br><br />
<br><br />
<br />
<br />
== Show a Triggers ==<br />
SHOW TRIGGERS;<br />
<br><br />
<br><br />
<br />
<br />
== Delete a Trigger ==<br />
DROP TRIGGER <Trigger_Name>;<br />
<br><br />
<br><br />
<br />
<br />
== Show Database Size ==<br />
SELECT table_schema AS "Database", <br />
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" <br />
FROM information_schema.TABLES <br />
GROUP BY table_schema;<br />
<br><br />
<br />
<br />
== Show Table Size ==<br />
SELECT table_schema as "Database", table_name AS "Table", <br />
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" <br />
FROM information_schema.TABLES <br />
ORDER BY (data_length + index_length) DESC;<br />
<br><br />
<br />
<br />
[[Category:MySQL]]</div>Ledhed//wiki.ledhed.net/index.php?title=MySQL_Command_ReferenceMySQL Command Reference2023-02-07T03:20:48Z<p>Ledhed: /* Show Table Size */</p>
<hr />
<div>== Combine 2 fields into one result ==<br />
<br />
SELECT CONCAT(fieldname1, fieldname2) FROM table<br />
Example:<br />
SELECT CONCAT(u.first, ' ', u.last) AS name FROM usr_table u<br />
<br />
ID | first | last |<br />
-----------------------------<br />
1 | Led | Hed |<br />
2 | Jimmy | Page |<br />
<br />
Results:<br />
Name<br />
----------- <br />
Led Hed<br />
Jimmy Page<br />
<br />
<br />
<br />
== Add fixed String to a field ==<br />
<br />
SELECT CONCAT(fieldname1, 'fixed string') FROM table<br />
<br><br />
<br />
<br />
<br />
== Do not return Duplicates ==<br />
<br />
SELECT DISTINCT fieldname FROM table<br />
<br><br />
<br />
<br />
== Return the 'Sum' of all fields selected ==<br />
<br />
SELECT SUM(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Round to 2 decimal places ==<br />
<br />
SELECT ROUND(fieldname, 2) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects only the field with the highest numerical value ==<br />
<br />
SELECT MAX(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects the leftmost 4 characters in a field ==<br />
<br />
SELECT LEFT(fieldname, 4) FROM table<br />
<br><br />
<br />
<br />
<br />
== Select date and format result in MM/DD/YYYY ==<br />
<br />
SELECT DATE_FORMAT(fieldname, '%c/%d/%Y') from table<br />
<br />
%a Abbreviated weekday name (Sun..Sat)<br />
%b Abbreviated month name (Jan..Dec)<br />
%c Month, numeric (0..12)<br />
%D Day of the month with English suffix (0th, 1st, 2nd, 3rd, â¦)<br />
%d Day of the month, numeric (00..31)<br />
%e Day of the month, numeric (0..31)<br />
%f Microseconds (000000..999999)<br />
%H Hour (00..23)<br />
%h Hour (01..12)<br />
%I Hour (01..12)<br />
%i Minutes, numeric (00..59)<br />
%j Day of year (001..366)<br />
%k Hour (0..23)<br />
%l Hour (1..12)<br />
%M Month name (January..December)<br />
%m Month, numeric (00..12)<br />
%p AM or PM<br />
%r Time, 12-hour (hh:mm:ss followed by AM or PM)<br />
%S Seconds (00..59)<br />
%s Seconds (00..59)<br />
%T Time, 24-hour (hh:mm:ss)<br />
%U Week (00..53), where Sunday is the first day of the week<br />
%u Week (00..53), where Monday is the first day of the week<br />
%V Week (01..53), where Sunday is the first day of the week; used with %X<br />
%v Week (01..53), where Monday is the first day of the week; used with %x<br />
%W Weekday name (Sunday..Saturday)<br />
%w Day of the week (0=Sunday..6=Saturday)<br />
%X Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V<br />
%x Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v<br />
%Y Year, numeric, four digits<br />
%y Year, numeric (two digits)<br />
%% A literal â%â character<br />
%x x, for any âxâ not listed above<br />
<br />
<br />
<br />
== Join fields from different tables ==<br />
<br />
SELECT a.fieldname1 b.fieldname2 FROM tableA a LEFT JOIN tableB b ON a.fieldname1 = b.fieldname1<br />
''To join these fields the values of a.fieldname1 and b.fieldname1 must be equal''<br><br />
''Example: SELECT j.JobName b.Amount FROM job j JOIN invoice i ON j.JobID = i.JobID WHERE j.JobID = '00123'''<br><br />
''The '''job''' table and '''invoice''' table were joined by the value of their '''JobID''' fields''<br><br />
'''''b.Amount''' was Selected from the invoice table where invoice.JobID = '00123' and '''j.JobName''' was Selected from the job table where job.JobID = '00123' ''<br><br />
<br><br />
<br><br />
<br />
<br />
<br />
== Change Column order within a table ==<br />
<br />
Reference: http://dev.mysql.com/doc/refman/5.0/en/change-column-order.html<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext AFTER ColumnNameToPutAfter<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext BEFORE ColumnNameToPutBefore<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext FIRST<br />
<br><br />
<br><br />
<br />
<br />
<br />
== Allow access from remote host ==<br />
<br />
GRANT ALL ON <DatabaseName>.* TO <User>@"<IP Address or Hostname>" IDENTIFIED BY "<Password>";<br />
FLUSH PRIVILEGES;<br />
Example:<br />
GRANT ALL ON *.* TO root@"10.0.0.25" IDENTIFIED BY "SomePassword";<br />
FLUSH PRIVILEGES;<br />
''This grants 'ALL' privileges for every database (*.*) to the user 'root' when connecting from IP Address 10.0.0.25 and the password given is 'SomePassword' ''<br><br />
''NOTE: Granting 'ALL' privileges to all (*.*) databases can be a security risk. In real world scenarios, only grant the privileges that are necessary and only to the user/hosts that need them.''<br />
<br><br />
<br><br />
<br />
<br />
== Show a Triggers ==<br />
SHOW TRIGGERS;<br />
<br><br />
<br><br />
<br />
<br />
== Delete a Trigger ==<br />
DROP TRIGGER <Trigger_Name>;<br />
<br><br />
<br><br />
<br />
<br />
== Show Database Size ==<br />
SELECT table_schema AS "Database", <br />
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" <br />
FROM information_schema.TABLES <br />
GROUP BY table_schema;<br />
<br><br />
<br />
<br />
== Show Table Size ==<br />
SELECT table_schema as "Database", table_name AS "Table", <br />
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" <br />
FROM information_schema.TABLES <br />
ORDER BY (data_length + index_length) DESC;<br />
<br />
<br />
[[Category:MySQL]]</div>Ledhed//wiki.ledhed.net/index.php?title=MySQL_Command_ReferenceMySQL Command Reference2023-02-07T03:20:24Z<p>Ledhed: </p>
<hr />
<div>== Combine 2 fields into one result ==<br />
<br />
SELECT CONCAT(fieldname1, fieldname2) FROM table<br />
Example:<br />
SELECT CONCAT(u.first, ' ', u.last) AS name FROM usr_table u<br />
<br />
ID | first | last |<br />
-----------------------------<br />
1 | Led | Hed |<br />
2 | Jimmy | Page |<br />
<br />
Results:<br />
Name<br />
----------- <br />
Led Hed<br />
Jimmy Page<br />
<br />
<br />
<br />
== Add fixed String to a field ==<br />
<br />
SELECT CONCAT(fieldname1, 'fixed string') FROM table<br />
<br><br />
<br />
<br />
<br />
== Do not return Duplicates ==<br />
<br />
SELECT DISTINCT fieldname FROM table<br />
<br><br />
<br />
<br />
== Return the 'Sum' of all fields selected ==<br />
<br />
SELECT SUM(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Round to 2 decimal places ==<br />
<br />
SELECT ROUND(fieldname, 2) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects only the field with the highest numerical value ==<br />
<br />
SELECT MAX(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects the leftmost 4 characters in a field ==<br />
<br />
SELECT LEFT(fieldname, 4) FROM table<br />
<br><br />
<br />
<br />
<br />
== Select date and format result in MM/DD/YYYY ==<br />
<br />
SELECT DATE_FORMAT(fieldname, '%c/%d/%Y') from table<br />
<br />
%a Abbreviated weekday name (Sun..Sat)<br />
%b Abbreviated month name (Jan..Dec)<br />
%c Month, numeric (0..12)<br />
%D Day of the month with English suffix (0th, 1st, 2nd, 3rd, â¦)<br />
%d Day of the month, numeric (00..31)<br />
%e Day of the month, numeric (0..31)<br />
%f Microseconds (000000..999999)<br />
%H Hour (00..23)<br />
%h Hour (01..12)<br />
%I Hour (01..12)<br />
%i Minutes, numeric (00..59)<br />
%j Day of year (001..366)<br />
%k Hour (0..23)<br />
%l Hour (1..12)<br />
%M Month name (January..December)<br />
%m Month, numeric (00..12)<br />
%p AM or PM<br />
%r Time, 12-hour (hh:mm:ss followed by AM or PM)<br />
%S Seconds (00..59)<br />
%s Seconds (00..59)<br />
%T Time, 24-hour (hh:mm:ss)<br />
%U Week (00..53), where Sunday is the first day of the week<br />
%u Week (00..53), where Monday is the first day of the week<br />
%V Week (01..53), where Sunday is the first day of the week; used with %X<br />
%v Week (01..53), where Monday is the first day of the week; used with %x<br />
%W Weekday name (Sunday..Saturday)<br />
%w Day of the week (0=Sunday..6=Saturday)<br />
%X Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V<br />
%x Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v<br />
%Y Year, numeric, four digits<br />
%y Year, numeric (two digits)<br />
%% A literal â%â character<br />
%x x, for any âxâ not listed above<br />
<br />
<br />
<br />
== Join fields from different tables ==<br />
<br />
SELECT a.fieldname1 b.fieldname2 FROM tableA a LEFT JOIN tableB b ON a.fieldname1 = b.fieldname1<br />
''To join these fields the values of a.fieldname1 and b.fieldname1 must be equal''<br><br />
''Example: SELECT j.JobName b.Amount FROM job j JOIN invoice i ON j.JobID = i.JobID WHERE j.JobID = '00123'''<br><br />
''The '''job''' table and '''invoice''' table were joined by the value of their '''JobID''' fields''<br><br />
'''''b.Amount''' was Selected from the invoice table where invoice.JobID = '00123' and '''j.JobName''' was Selected from the job table where job.JobID = '00123' ''<br><br />
<br><br />
<br><br />
<br />
<br />
<br />
== Change Column order within a table ==<br />
<br />
Reference: http://dev.mysql.com/doc/refman/5.0/en/change-column-order.html<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext AFTER ColumnNameToPutAfter<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext BEFORE ColumnNameToPutBefore<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext FIRST<br />
<br><br />
<br><br />
<br />
<br />
<br />
== Allow access from remote host ==<br />
<br />
GRANT ALL ON <DatabaseName>.* TO <User>@"<IP Address or Hostname>" IDENTIFIED BY "<Password>";<br />
FLUSH PRIVILEGES;<br />
Example:<br />
GRANT ALL ON *.* TO root@"10.0.0.25" IDENTIFIED BY "SomePassword";<br />
FLUSH PRIVILEGES;<br />
''This grants 'ALL' privileges for every database (*.*) to the user 'root' when connecting from IP Address 10.0.0.25 and the password given is 'SomePassword' ''<br><br />
''NOTE: Granting 'ALL' privileges to all (*.*) databases can be a security risk. In real world scenarios, only grant the privileges that are necessary and only to the user/hosts that need them.''<br />
<br><br />
<br><br />
<br />
<br />
== Show a Triggers ==<br />
SHOW TRIGGERS;<br />
<br><br />
<br><br />
<br />
<br />
== Delete a Trigger ==<br />
DROP TRIGGER <Trigger_Name>;<br />
<br><br />
<br><br />
<br />
<br />
== Show Database Size ==<br />
SELECT table_schema AS "Database", <br />
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" <br />
FROM information_schema.TABLES <br />
GROUP BY table_schema;<br />
<br><br />
<br />
<br />
== Show Table Size ==<br />
SELECT <br />
table_schema as "Database", <br />
table_name AS "Table", <br />
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" <br />
FROM information_schema.TABLES <br />
ORDER BY (data_length + index_length) DESC;<br />
<br />
<br />
[[Category:MySQL]]</div>Ledhed//wiki.ledhed.net/index.php?title=MySQL_Command_ReferenceMySQL Command Reference2023-02-07T03:13:28Z<p>Ledhed: </p>
<hr />
<div>== Combine 2 fields into one result ==<br />
<br />
SELECT CONCAT(fieldname1, fieldname2) FROM table<br />
Example:<br />
SELECT CONCAT(u.first, ' ', u.last) AS name FROM usr_table u<br />
<br />
ID | first | last |<br />
-----------------------------<br />
1 | Led | Hed |<br />
2 | Jimmy | Page |<br />
<br />
Results:<br />
Name<br />
----------- <br />
Led Hed<br />
Jimmy Page<br />
<br />
<br />
<br />
== Add fixed String to a field ==<br />
<br />
SELECT CONCAT(fieldname1, 'fixed string') FROM table<br />
<br><br />
<br />
<br />
<br />
== Do not return Duplicates ==<br />
<br />
SELECT DISTINCT fieldname FROM table<br />
<br><br />
<br />
<br />
== Return the 'Sum' of all fields selected ==<br />
<br />
SELECT SUM(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Round to 2 decimal places ==<br />
<br />
SELECT ROUND(fieldname, 2) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects only the field with the highest numerical value ==<br />
<br />
SELECT MAX(fieldname) FROM table<br />
<br><br />
<br />
<br />
<br />
== Selects the leftmost 4 characters in a field ==<br />
<br />
SELECT LEFT(fieldname, 4) FROM table<br />
<br><br />
<br />
<br />
<br />
== Select date and format result in MM/DD/YYYY ==<br />
<br />
SELECT DATE_FORMAT(fieldname, '%c/%d/%Y') from table<br />
<br />
%a Abbreviated weekday name (Sun..Sat)<br />
%b Abbreviated month name (Jan..Dec)<br />
%c Month, numeric (0..12)<br />
%D Day of the month with English suffix (0th, 1st, 2nd, 3rd, â¦)<br />
%d Day of the month, numeric (00..31)<br />
%e Day of the month, numeric (0..31)<br />
%f Microseconds (000000..999999)<br />
%H Hour (00..23)<br />
%h Hour (01..12)<br />
%I Hour (01..12)<br />
%i Minutes, numeric (00..59)<br />
%j Day of year (001..366)<br />
%k Hour (0..23)<br />
%l Hour (1..12)<br />
%M Month name (January..December)<br />
%m Month, numeric (00..12)<br />
%p AM or PM<br />
%r Time, 12-hour (hh:mm:ss followed by AM or PM)<br />
%S Seconds (00..59)<br />
%s Seconds (00..59)<br />
%T Time, 24-hour (hh:mm:ss)<br />
%U Week (00..53), where Sunday is the first day of the week<br />
%u Week (00..53), where Monday is the first day of the week<br />
%V Week (01..53), where Sunday is the first day of the week; used with %X<br />
%v Week (01..53), where Monday is the first day of the week; used with %x<br />
%W Weekday name (Sunday..Saturday)<br />
%w Day of the week (0=Sunday..6=Saturday)<br />
%X Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V<br />
%x Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v<br />
%Y Year, numeric, four digits<br />
%y Year, numeric (two digits)<br />
%% A literal â%â character<br />
%x x, for any âxâ not listed above<br />
<br />
<br />
<br />
== Join fields from different tables ==<br />
<br />
SELECT a.fieldname1 b.fieldname2 FROM tableA a LEFT JOIN tableB b ON a.fieldname1 = b.fieldname1<br />
''To join these fields the values of a.fieldname1 and b.fieldname1 must be equal''<br><br />
''Example: SELECT j.JobName b.Amount FROM job j JOIN invoice i ON j.JobID = i.JobID WHERE j.JobID = '00123'''<br><br />
''The '''job''' table and '''invoice''' table were joined by the value of their '''JobID''' fields''<br><br />
'''''b.Amount''' was Selected from the invoice table where invoice.JobID = '00123' and '''j.JobName''' was Selected from the job table where job.JobID = '00123' ''<br><br />
<br><br />
<br><br />
<br />
<br />
<br />
== Change Column order within a table ==<br />
<br />
Reference: http://dev.mysql.com/doc/refman/5.0/en/change-column-order.html<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext AFTER ColumnNameToPutAfter<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext BEFORE ColumnNameToPutBefore<br />
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext FIRST<br />
<br><br />
<br><br />
<br />
<br />
<br />
== Allow access from remote host ==<br />
<br />
GRANT ALL ON <DatabaseName>.* TO <User>@"<IP Address or Hostname>" IDENTIFIED BY "<Password>";<br />
FLUSH PRIVILEGES;<br />
Example:<br />
GRANT ALL ON *.* TO root@"10.0.0.25" IDENTIFIED BY "SomePassword";<br />
FLUSH PRIVILEGES;<br />
''This grants 'ALL' privileges for every database (*.*) to the user 'root' when connecting from IP Address 10.0.0.25 and the password given is 'SomePassword' ''<br><br />
''NOTE: Granting 'ALL' privileges to all (*.*) databases can be a security risk. In real world scenarios, only grant the privileges that are necessary and only to the user/hosts that need them.''<br />
<br><br />
<br><br />
<br />
<br />
== Show a Triggers ==<br />
SHOW TRIGGERS;<br />
<br><br />
<br><br />
<br />
<br />
== Delete a Trigger ==<br />
DROP TRIGGER <Trigger_Name>;<br />
<br><br />
<br><br />
<br />
<br />
== Show Database Size ==<br />
SELECT table_schema AS "Database", <br />
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" <br />
FROM information_schema.TABLES <br />
GROUP BY table_schema;<br />
<br><br />
<br />
<br />
[[Category:MySQL]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ubuntu_22.04_AutoinstallUbuntu 22.04 Autoinstall2022-08-24T15:01:53Z<p>Ledhed: Created page with "== Overview == This article will explain how to create a custom USB Boot disk for automatic installation of Ubuntu 22.04 including an answer file. == Quick-n-Dirty == === In..."</p>
<hr />
<div>== Overview ==<br />
This article will explain how to create a custom USB Boot disk for automatic installation of Ubuntu 22.04 including an answer file.<br />
<br />
<br />
== Quick-n-Dirty ==<br />
=== Installation Media ===<br />
Partition USB stick into 2 pieces<br><br />
Partition 1 = 16M, EFI, Format FAT32<br><br />
Partition 2 = 4G, MS Dos, Format FAT32<br><br />
<br />
<br />
'''Mount Partition 2''' (make sure to use the right device, you can check with lsblk)<br />
mount /dev/sdb2 /mnt<br />
<br />
<br />
'''Extract ISO to Partition 2'''<br />
7z -y x ubuntu-22.04.1-live-server-amd64.iso -o/mnt<br />
<br />
<br />
'''Edit /mnt/boot/grub/grub.cfg'''<br />
Add these lines after the end of the first 'menuentry'<br />
menuentry "Auto Install Ubuntu Server" {<br />
set gfxpayload=keep<br />
linux /casper/vmlinuz autoinstall quiet ---<br />
initrd /casper/initrd<br />
}<br />
<br />
<br />
'''Update /mnt/md5sum.txt'''<br />
cd /mnt<br />
md5sum ./boot/grub/grub.cfg >> /mnt/md5sum.txt<br />
Remember to delete the old grub.cfg line.<br />
<br />
<br />
'''Create an efi directory under /mnt/boot/''':<br />
mkdir /mnt/boot/efi<br />
<br />
<br />
'''Mount Partition 1'''<br />
mount /dev/sdb1 /mnt/boot/efi<br />
<br />
<br />
'''Install grub on Partition 2''' (this assumes the system is x64 UEFI):<br />
grub-install --boot-directory=/mnt/boot /dev/sdb2<br />
<br />
<br />
'''Unmount Partition 1, then Partition 2'''<br />
umount /mnt/boot/efi<br />
umount /mnt<br />
<br />
<br />
=== Answer File Media ===<br />
'''Generate a user-data file''', this is most easily done by copying one from a manual installation. This file can be found at:<br />
/var/log/install/autoinstall-user-data<br />
<br />
<br />
'''Generate a meta-data file''', this file is typically empty.<br />
touch meta-data<br />
<br />
<br />
'''Create the answer-file.iso'''<br />
cloud-localds ./answer_file.iso user-data meta-data<br />
<br />
<br />
'''Burn answer-file.iso to a USB stick.'''<br />
<br />
<br />
''' Unmount the Answer File USB stick'''<br />
<br />
<br />
=== Boot it! ===<br />
Insert the newly created Installation USB stick and invoke your system's boot menu (F11 perhaps).<br />
* Highlight Partition 2<br />
* Insert the Answer File Media<br />
* Press [Enter]<br />
The system should install unattended including the network settings, user credentials, and packages you selected when generating the user-data file on the manual installation.<br />
<br />
<br />
<br />
== Reference ==<br />
https://ubuntu.com/server/docs/install/autoinstall<br />
<br><br />
https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html<br />
<br><br />
https://github.com/covertsh/ubuntu-autoinstall-generator/blob/main/ubuntu-autoinstall-generator.sh#L249<br />
<br><br />
https://linuxconfig.org/ubuntu-autoinstall-example<br />
<br><br />
https://gist.github.com/jamiekurtz/26c46b3e594f8cdd453a<br />
<br />
<br />
[[Category:Ubuntu]]</div>Ledhed//wiki.ledhed.net/index.php?title=Regex_ExamplesRegex Examples2022-07-14T11:21:30Z<p>Ledhed: Created page with "== Overview == Here are some common examples of Regex used for form validation. == Phone Numbers == == Email Addresses == == IP Address Validation == === IPv4 Address ===..."</p>
<hr />
<div>== Overview ==<br />
Here are some common examples of Regex used for form validation.<br />
<br />
== Phone Numbers ==<br />
<br />
<br />
== Email Addresses ==<br />
<br />
<br />
== IP Address Validation ==<br />
=== IPv4 Address ===<br />
^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$<br />
<br />
<br />
=== IPv4 Subnet in CIDR Notation ===<br />
^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)($|/([0-9]|[12][0-9]|3[0-2]))$<br />
<br />
<br />
<br />
== References ==<br />
https://www.regextester.com/<br />
<br />
https://www.regextutorial.org/regex-for-ip-address-match.php<br />
<br />
https://stackoverflow.com/questions/12141206/ipaddress-or-cidr-block-matching-regex<br />
<br />
<br />
<br />
[[Category:Regular_Expression]]</div>Ledhed//wiki.ledhed.net/index.php?title=Category:Regular_ExpressionCategory:Regular Expression2022-07-14T11:20:52Z<p>Ledhed: Created page with "== Regular Expression == Category:Tech_Notes"</p>
<hr />
<div>== Regular Expression ==<br />
<br />
<br />
[[Category:Tech_Notes]]</div>Ledhed//wiki.ledhed.net/index.php?title=Serial_ConsoleSerial Console2022-06-08T15:01:49Z<p>Ledhed: </p>
<hr />
<div>Serial Console HowTo<br />
<br />
== Overview ==<br />
Sometimes it is handy to be able to redirect a TTY Console to a serial port.<br />
One such example might be that your server is headless (No VGA, Keyboard, or Monitor)<br />
The info on this page will help you enable console access via a serial port.<br />
<br />
<br />
<br />
== Instructions ==<br />
<br />
To redirect a Linux Console to a serial port edit /etc/inittab and add this line at the end of the '# Run gettys in standard runlevels' section.<br />
<br />
S0:2345:respawn /usr/sbin/agetty -h ttyS0 38400 vt100<br />
<br />
When done issue this command to make the changes take effect:<br />
<br />
init q<br />
<br />
<br />
<br />
== Explanation ==<br />
TTY-ID:RUN-LEVELS:respawn COMMAND -SWITCHES PORT TERMINAL-EMULATION<br />
(For greater detail on inittab or agetty see the [[Serial_Console#References|References Section]] below)<br />
<br />
<br />
<br />
== General Notes ==<br />
1) In this HowTo I used 'agetty' but there are other getty packages such as 'getty', 'mgetty', and 'mingetty' use whichever is the default on your distribution. If you use one of the other getty packages keep in mind that the syntax will most likely be different.<br><br />
2) ttyS0 = COM1, ttyS1 = COM2 etc...<br />
<br />
<br />
<br />
==Modern Distros using Systemd==<br />
If you're on a distro that uses systemd, here is another method (in this case Ubuntu 22.04):<br />
<br />
cat <<EOF > /lib/systemd/system/ttyS0.service<br />
[Unit]<br />
Description=Serial Console Service<br />
<br />
[Service]<br />
ExecStart=/sbin/getty -L 115200 ttyS0 vt102<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
EOF<br />
<br />
Then reload, enable, and start the service<br />
systemctl daemon-reload<br />
systemctl enable ttyS0<br />
systemctl start ttyS0<br />
<br />
<br />
<br />
== References ==<br />
[http://www.vanemery.com/Linux/Serial/serial-console.html Linux Serial Console HowTo]<br><br />
[http://www.linuxjournal.com/article/2040 Linux Journal - Serial as a Console]<br><br />
[http://www.netadmintools.com/html/5inittab.man.html inittab Man Pages]<br><br />
[http://www.netadmintools.com/html/8agetty.man.html agetty Man Pages]<br />
<br><br />
[https://ubuntuforums.org/showthread.php?t=2343595 Serial Console connection on Ubuntu 16.04 or higher]<br />
<br />
<br />
<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Serial_ConsoleSerial Console2022-06-08T15:01:25Z<p>Ledhed: </p>
<hr />
<div>Serial Console HowTo<br />
<br />
== Overview ==<br />
Sometimes it is handy to be able to redirect a TTY Console to a serial port.<br />
One such example might be that your server is headless (No VGA, Keyboard, or Monitor)<br />
The info on this page will help you enable console access via a serial port.<br />
<br />
<br />
<br />
== Instructions ==<br />
<br />
To redirect a Linux Console to a serial port edit /etc/inittab and add this line at the end of the '# Run gettys in standard runlevels' section.<br />
<br />
S0:2345:respawn /usr/sbin/agetty -h ttyS0 38400 vt100<br />
<br />
When done issue this command to make the changes take effect:<br />
<br />
init q<br />
<br />
<br />
<br />
== Explanation ==<br />
TTY-ID:RUN-LEVELS:respawn COMMAND -SWITCHES PORT TERMINAL-EMULATION<br />
(For greater detail on inittab or agetty see the [[Serial_Console#References|References Section]] below)<br />
<br />
<br />
<br />
== General Notes ==<br />
1) In this HowTo I used 'agetty' but there are other getty packages such as 'getty', 'mgetty', and 'mingetty' use whichever is the default on your distribution. If you use one of the other getty packages keep in mind that the syntax will most likely be different.<br><br />
2) ttyS0 = COM1, ttyS1 = COM2 etc...<br />
<br />
<br />
<br />
==Modern Distros using Systemd==<br />
If you're on an distro that uses systemd, here is another method (in this case Ubuntu 22.04):<br />
<br />
cat <<EOF > /lib/systemd/system/ttyS0.service<br />
[Unit]<br />
Description=Serial Console Service<br />
<br />
[Service]<br />
ExecStart=/sbin/getty -L 115200 ttyS0 vt102<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
EOF<br />
<br />
Then reload, enable, and start the service<br />
systemctl daemon-reload<br />
systemctl enable ttyS0<br />
systemctl start ttyS0<br />
<br />
<br />
<br />
== References ==<br />
[http://www.vanemery.com/Linux/Serial/serial-console.html Linux Serial Console HowTo]<br><br />
[http://www.linuxjournal.com/article/2040 Linux Journal - Serial as a Console]<br><br />
[http://www.netadmintools.com/html/5inittab.man.html inittab Man Pages]<br><br />
[http://www.netadmintools.com/html/8agetty.man.html agetty Man Pages]<br />
<br><br />
[https://ubuntuforums.org/showthread.php?t=2343595 Serial Console connection on Ubuntu 16.04 or higher]<br />
<br />
<br />
<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Serial_ConsoleSerial Console2022-06-08T15:01:06Z<p>Ledhed: </p>
<hr />
<div>Serial Console HowTo<br />
<br />
== Overview ==<br />
Sometimes it is handy to be able to redirect a TTY Console to a serial port.<br />
One such example might be that your server is headless (No VGA, Keyboard, or Monitor)<br />
The info on this page will help you enable console access via a serial port.<br />
<br />
<br />
<br />
== Instructions ==<br />
<br />
To redirect a Linux Console to a serial port edit /etc/inittab and add this line at the end of the '# Run gettys in standard runlevels' section.<br />
<br />
S0:2345:respawn /usr/sbin/agetty -h ttyS0 38400 vt100<br />
<br />
When done issue this command to make the changes take effect:<br />
<br />
init q<br />
<br />
<br />
<br />
== Explanation ==<br />
TTY-ID:RUN-LEVELS:respawn COMMAND -SWITCHES PORT TERMINAL-EMULATION<br />
(For greater detail on inittab or agetty see the [[Serial_Console#References|References Section]] below)<br />
<br />
<br />
<br />
== General Notes ==<br />
1) In this HowTo I used 'agetty' but there are other getty packages such as 'getty', 'mgetty', and 'mingetty' use whichever is the default on your distribution. If you use one of the other getty packages keep in mind that the syntax will most likely be different.<br><br />
2) ttyS0 = COM1, ttyS1 = COM2 etc...<br />
<br />
<br />
<br />
==Modern Distros using Systemd==<br />
If you're on an distro that uses systemd, here is another method (in this case Ubuntu 22.04):<br />
<br />
cat <<EOF > /lib/systemd/system/ttyS0.service<br />
[Unit]<br />
Description=Serial Console Service<br />
<br />
[Service]<br />
ExecStart=/sbin/getty -L 115200 ttyS0 vt102<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
EOF<br />
<br />
Then reload, enable, and start the service<br />
systemctl daemon-reload<br />
systemctl enable ttyS0<br />
systemctl start ttyS0<br />
<br />
<br />
<br />
== References ==<br />
[http://www.vanemery.com/Linux/Serial/serial-console.html Linux Serial Console HowTo]<br><br />
[http://www.linuxjournal.com/article/2040 Linux Journal - Serial as a Console]<br><br />
[http://www.netadmintools.com/html/5inittab.man.html inittab Man Pages]<br><br />
[http://www.netadmintools.com/html/8agetty.man.html agetty Man Pages]<br><br />
<br><br />
[https://ubuntuforums.org/showthread.php?t=2343595 Serial Console connection on Ubuntu 16.04 or higher]<br />
<br />
<br />
<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Serial_ConsoleSerial Console2022-06-08T15:00:17Z<p>Ledhed: </p>
<hr />
<div>Serial Console HowTo<br />
<br />
== Overview ==<br />
Sometimes it is handy to be able to redirect a TTY Console to a serial port.<br />
One such example might be that your server is headless (No VGA, Keyboard, or Monitor)<br />
The info on this page will help you enable console access via a serial port.<br />
<br />
<br />
<br />
== Instructions ==<br />
<br />
To redirect a Linux Console to a serial port edit /etc/inittab and add this line at the end of the '# Run gettys in standard runlevels' section.<br />
<br />
S0:2345:respawn /usr/sbin/agetty -h ttyS0 38400 vt100<br />
<br />
When done issue this command to make the changes take effect:<br />
<br />
init q<br />
<br />
<br />
<br />
== Explanation ==<br />
TTY-ID:RUN-LEVELS:respawn COMMAND -SWITCHES PORT TERMINAL-EMULATION<br />
(For greater detail on inittab or agetty see the [[Serial_Console#References|References Section]] below)<br />
<br />
<br />
<br />
== General Notes ==<br />
1) In this HowTo I used 'agetty' but there are other getty packages such as 'getty', 'mgetty', and 'mingetty' use whichever is the default on your distribution. If you use one of the other getty packages keep in mind that the syntax will most likely be different.<br><br />
2) ttyS0 = COM1, ttyS1 = COM2 etc...<br />
<br />
<br />
<br />
==Modern Distros using Systemd==<br />
If you're on an distro that uses systemd, here is another method (in this case Ubuntu 22.04):<br />
<br />
cat <<EOF > /lib/systemd/system/ttyS0.service<br />
[Unit]<br />
Description=Serial Console Service<br />
<br />
[Service]<br />
ExecStart=/sbin/getty -L 115200 ttyS0 vt102<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
EOF<br />
<br />
Then reload, enable, and start the service<br />
systemctl daemon-reload<br />
systemctl enable ttyS0<br />
systemctl start ttyS0<br />
<br />
<br />
<br />
== References ==<br />
[http://www.vanemery.com/Linux/Serial/serial-console.html Linux Serial Console HowTo]<br><br />
[http://www.linuxjournal.com/article/2040 Linux Journal - Serial as a Console]<br><br />
[http://www.netadmintools.com/html/5inittab.man.html inittab Man Pages]<br><br />
[http://www.netadmintools.com/html/8agetty.man.html agetty Man Pages]<br><br />
<br><br />
[https://ubuntuforums.org/showthread.php?t=2343595]<br />
<br />
<br />
<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Linux_Random_MACLinux Random MAC2022-06-01T10:47:29Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Current versions of Linux distros are obtaining DHCP leases with Randomized MAC addresses which I find aggravating when trying to track down a host by MAC. It also blows up a DHCP reservation if you re-install an OS on the same Hardware/VM.<br />
<br />
== Solution 1 ==<br />
echo " dhcp-identifier: mac" >>/etc/netplan/xxx.yaml<br />
netplan apply<br />
<br />
<br />
== Solution 2 (old) ==<br />
echo "send dhcp-client-identifier = hardware;" >>/etc/dhcp/dhclient.conf<br />
rm /var/lib/dhcp/*<br />
systemctl restart networking<br />
<br />
<br />
<br />
== References ==<br />
https://superuser.com/questions/1338510/wrong-ip-address-from-dhcp-client-on-ubuntu-18-04<br />
<br />
https://superuser.com/questions/1553094/force-to-use-mac-address-as-dhcp-client-id-on-debian-buster<br />
<br />
<br />
[[Category:Linux]][[Category:Ubuntu]]</div>Ledhed//wiki.ledhed.net/index.php?title=OpenBSD_Shell_TweaksOpenBSD Shell Tweaks2022-01-24T11:01:24Z<p>Ledhed: Created page with "'''INCOMPLETE''' == Overview == A buddy of mine who is a FreeBSD fanatic got me using it and I fell in love with it's command line, specifically the command history complet..."</p>
<hr />
<div>'''INCOMPLETE'''<br />
<br />
<br />
<br />
== Overview ==<br />
A buddy of mine who is a FreeBSD fanatic got me using it and I fell in love with it's command line, specifically the command history completion. OpenBSD's default root shell is ksh and while it does tab completion and command history, it doesn't do command history completion. I also really like a colored command line interface for quickly identifying folders, links, and executables (ya this is a Linux carryover). This article will show how to add color and add command history completion to the Korn shell.<br />
<br />
<br />
== Prompt ==<br />
Add this to your .profile file:<br />
PS1='$USER:$PWD# '<br />
export PS1<br />
<br />
<br />
== COLORLS ==<br />
pkg_add -r colorls<br />
Add this to your .profile file:<br />
LSCOLORS=gxfxhxhxcxhxhxBxBxhxhx<br />
export LSCOLORS<br />
alias ls='colorls -G'<br />
<br />
<br />
== Reference ==<br />
https://geoff.greer.fm/lscolors/<br />
<br />
<br />
<br />
[[Category:OpenBSD]]</div>Ledhed//wiki.ledhed.net/index.php?title=OpenBSD_AliasesOpenBSD Aliases2022-01-23T12:42:51Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
I started using OpenBSD and found that some of the command aliases I'm used to using in other distributions weren't there. Naturally I went looking for ~/.kshrc but was surprised to find it wasn't there. There was .cshrc but edits to that file weren't working (probably because the default shell in OpenBSD is ksh).<br />
<br />
<br />
== How to add Aliases ==<br />
Edit ~/.profile and add:<br />
export ENV=$HOME/.kshrc<br />
<br />
Now create ~/.kshrc<br />
alias ll="ls -lsah"<br />
alias service=rcctl<br />
<br />
<br />
== References ==<br />
https://unix.stackexchange.com/questions/476065/openbsd-how-does-one-set-an-alias<br />
<br />
<br />
[[Category:OpenBSD]]</div>Ledhed//wiki.ledhed.net/index.php?title=OpenBSD_Disk_SetupOpenBSD Disk Setup2022-01-23T12:40:47Z<p>Ledhed: Created page with "== Overview == How to customize the partition sized during OpenBSD installation to give /var more space. == Edit Auto Configured Disk Layout == At install time you can choos..."</p>
<hr />
<div>== Overview ==<br />
How to customize the partition sized during OpenBSD installation to give /var more space.<br />
<br />
<br />
== Edit Auto Configured Disk Layout ==<br />
At install time you can choose (A) for auto-layout. This creates a lot more partitions than other distributions. Often times it gives more space to /home than I'd like especially if the installation is going to be a server. </br><br />
Fortunately you can (E) edit the auto-layout. When you press (E) you get dropped to a fdisk like command prompt. </br><br />
Here are some helpful commands"<br />
? Help<br />
a Add partition<br />
d Delete partition<br />
p Print partition table<br />
z Delete all partitions<br />
<br />
The default partition layout looks like this:<br />
a: /<br />
b: swap<br />
c: reserved/unused<br />
d: /tmp<br />
e: /var<br />
f: /usr<br />
g: /usr/X11R6<br />
h: /usr/local<br />
i: /usr/src<br />
j: /usr/obj<br />
k: /home<br />
<br />
On servers that won't host many users I prefer to make /var the last partition so I can have it use 100% of the remaining space. You can do this by specifying '''100&''' for the partition size.<br />
<br />
<br />
<br />
== Reference ==<br />
https://dev.to/nabbisen/openbsd-manual-partitioning-at-installation-4cif<br />
<br />
<br />
[[Category:OpenBSD]]</div>Ledhed//wiki.ledhed.net/index.php?title=OpenBSD_AliasesOpenBSD Aliases2022-01-23T11:56:26Z<p>Ledhed: Created page with "== Overview == I started using OpenBSD and found that some of the command aliases I'm used to using in other distributions weren't there. Naturally I went looking for ~/.kshrc..."</p>
<hr />
<div>== Overview ==<br />
I started using OpenBSD and found that some of the command aliases I'm used to using in other distributions weren't there. Naturally I went looking for ~/.kshrc but was surprised to find it wasn't there. There was .cshrc but edits to that file weren't working (probably because the default shell in OpenBSD is ksh).<br />
<br />
<br />
== How to add Aliases ==<br />
Edit ~/.profile and add:<br />
export ENV=$HOME/.kshrc<br />
<br />
Now create ~/.kshrc<br />
alias ll="ls -lsah"<br />
alias service=rcctl<br />
<br />
<br />
== References ==<br />
https://unix.stackexchange.com/questions/476065/openbsd-how-does-one-set-an-alias<br />
<br />
<br />
[[Category:OpenBSD]]</div>Ledhed//wiki.ledhed.net/index.php?title=Category:OpenBSDCategory:OpenBSD2022-01-23T11:50:14Z<p>Ledhed: Created page with "https://www.openbsd.org/ Category:Tech_Notes"</p>
<hr />
<div>https://www.openbsd.org/<br />
<br />
[[Category:Tech_Notes]]</div>Ledhed//wiki.ledhed.net/index.php?title=Linux_Random_MACLinux Random MAC2021-12-06T11:00:27Z<p>Ledhed: Created page with "== Overview == Current versions of Linux distros are obtaining DHCP leases with Randomized MAC addresses which I find aggravating when trying to track down a host by MAC. It a..."</p>
<hr />
<div>== Overview ==<br />
Current versions of Linux distros are obtaining DHCP leases with Randomized MAC addresses which I find aggravating when trying to track down a host by MAC. It also blows up a DHCP reservation if you re-install an OS on the same Hardware/VM.<br />
<br />
<br />
== Solution ==<br />
echo "send dhcp-client-identifier = hardware;" >>/etc/dhcp/dhclient.conf<br />
rm /var/lib/dhcp/*<br />
systemctl restart networking<br />
<br />
<br />
<br />
== References ==<br />
https://superuser.com/questions/1553094/force-to-use-mac-address-as-dhcp-client-id-on-debian-buster<br />
<br />
<br />
[[Category:Linux]][[Category:Ubuntu]]</div>Ledhed//wiki.ledhed.net/index.php?title=TimedatectlTimedatectl2021-11-09T05:06:49Z<p>Ledhed: Created page with "== Overview == I always forget how to check NTP sync status on systems that use systemd. == timedatectl == === Status === timedatectl === Show last synced server === time..."</p>
<hr />
<div>== Overview ==<br />
I always forget how to check NTP sync status on systems that use systemd.<br />
<br />
<br />
== timedatectl ==<br />
=== Status ===<br />
timedatectl<br />
<br />
=== Show last synced server ===<br />
timedatectl timesync-status<br />
<br />
<br />
== Reference ==<br />
https://man7.org/linux/man-pages/man1/timedatectl.1.html<br />
<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Home_Assistant_UpdatesHome Assistant Updates2021-11-04T03:37:59Z<p>Ledhed: Created page with "== Overview == Home Assistant updates are released on the first Wednesday of every month. You can update form the WebUI or from the CLI. == WebUI == There is an 'Updater' e..."</p>
<hr />
<div>== Overview ==<br />
Home Assistant updates are released on the first Wednesday of every month. You can update form the WebUI or from the CLI.<br />
<br />
<br />
== WebUI ==<br />
There is an 'Updater' entity that will let you know if an update is available.<br />
Go to the Supervisor and there should be a card indicating the current version, and the latest version.<br />
Click 'Upgrade', Ideally create a backup/snapshot and download it to a safe place prior to performing the upgrade.<br />
You can download from the WebUI, or by accessing the 'backup/' directory (if you have SAMBA setup).<br />
<br />
<br />
== CLI ==<br />
Updating to a specific version<br />
ha core update --version 2021.10.7<br />
<br />
<br />
== References ==<br />
https://community.home-assistant.io/t/2021-11-icon-picker-device-links-and-entity-categories/352836/51<br />
<br />
Latest Release Notes<br />
https://www.home-assistant.io/latest-release-notes/<br />
<br />
<br />
[[Category:Home Assistant]]</div>Ledhed//wiki.ledhed.net/index.php?title=Tasmota_Command_Line_OptionsTasmota Command Line Options2021-09-15T05:09:00Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Some useful command line options for devices running Tasmota firmware<br />
<br />
<br />
<br />
== Console ==<br />
Open the device's webpage, and click the 'Console' button. At the console enter your commands. Commands are automatically saved and should survive a reboot.<br />
<br />
== MQTT ==<br />
https://github.com/arendst/Tasmota/wiki/Commands#mqtt<br />
<br />
<br />
=== Update Interval ===<br />
To set the update interval / frequency at which the devices sends MQTT messages:<br />
TelePeriod 30<br />
''0 = disable telemetry messages''<br><br />
''1 = reset telemetry period to firmware default (TELE_PERIOD)''<br><br />
''10..3600 = set telemetry period in seconds (default = 300)''<br><br />
<br />
<br />
== Temperature Calibration ==<br />
TempOffset 1.3<br />
[https://tasmota.github.io/docs/Commands/#tempoffset TempOffset]<br />
<br />
<br />
<br />
== Humidity Calibration ==<br />
HumOffset 1.7<br />
[https://tasmota.github.io/docs/Commands/#humidoffset HumOffset]<br />
<br />
<br />
<br />
=== Status ===<br />
status 8<br />
This is a handy way to debug an unknown device. Set as many GPIO pins to SwitchX and then run this command, then press+hold a button on the device and run status 8 again to see which one changed.<br />
<br />
<br />
<br />
== NTP / Time Server ==<br />
NtpServer1 <IP_Address><br />
NtpServer2 <IP_Address><br />
<br />
=== List existing NTP settings ===<br />
NtpServer <ENTER><br />
<br />
<br />
<br />
== SetOptions ==<br />
https://github.com/arendst/Tasmota/wiki/commands#setoption-overview<br />
<br />
=== Temperature Units ===<br />
To set temperature units to Fahrenheit:<br />
SetOption8 1<br />
<br />
=== Color Values ===<br />
To set color units to R,G,B,W (0-255):<br />
SetOption17 1<br />
Enables color status in decimals<br />
<br />
To set color red:<br />
color 255,0,0,0<br />
To set color green:<br />
color 0,255,0,0<br />
To set color blue:<br />
color 0,0,255,0<br />
To set color white:<br />
color 0,0,0,255<br />
<br />
<br />
=== AutoDiscovery ===<br />
SetOption19 enables/disables MQTT Auto-Discovery<br />
SetOption19 0<br />
This disables MQTT auto-discovery, but also enables auto-discovery in Home Assistant when using the Tasmota Integration.<br />
<br />
<br />
== WiFi Manager ==<br />
If you have a device that is physically difficult to get to, or difficult to flash (bulbs), you may want to enable the WiFi Manager. This will cause the device to switch to AP mode when it can't find a wireless network to connect to. When in AP mode, you can connect to it from another wireless device like a laptop or smart phone and change the network config.<br />
WifiConfig 2<br />
<br />
<br />
== I2C Scan ==<br />
This command causes Tasmota to scan the I2C bus and display found device ID's.<br />
i2cscan<br />
<br />
<br />
== Reference ==<br />
https://github.com/arendst/Tasmota/wiki/commands <br />
<br />
<br />
[[Category:Tasmota]]</div>Ledhed//wiki.ledhed.net/index.php?title=BitwardenBitwarden2021-06-16T11:06:00Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
How to install Bitwarden<br />
<br />
<br />
=== Install ===<br />
<br />
As Root:<br />
Install Prerequisites<br />
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common<br />
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -<br />
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"<br />
apt update<br />
apt install docker-ce docker-ce-cli containerd.io docker-compose<br />
<br />
Create the Bitwarden Service Account<br />
useradd -s /bin/bash -m -d /home/bitwarden bitwarden<br />
usermod -aG docker bitwarden<br />
passwd bitwarden (USE A REALLY LONG COMPLEX PASSWORD AND FORGET IT!) You'll never actually login as this user, instead login as a user with root privileges and: su bitwarden<br />
mkdir /opt/bitwarden<br />
chmod 700 /opt/bitwarden<br />
chown bitwarden.bitwarden /opt/bitwarden<br />
<br />
<br />
Bitwarden User:<br />
cd /opt/bitwarden<br />
wget -O bitwarden.sh https://go.btwrdn.co/bw-sh<br />
chmod +x bitwarden.sh<br />
./bitwarden.sh install<br />
<br />
Copy ca.crt, certificate.crt, and private.key to:<br />
/home/bitwarden/bwdata/ssl/<FQDN>/<br />
<br />
Start Bitwarden<br />
~/bitwarden.sh start<br />
<br />
<br />
=== Automatic Startup ===<br />
Create /lib/systemd/system/bitwarden.service<br />
[Unit]<br />
Description=Bitwarden<br />
Requires=docker.service<br />
After=docker.service<br />
<br />
[Service]<br />
Type=oneshot<br />
User=bitwarden<br />
Group=bitwarden<br />
ExecStart=/opt/bitwarden/bitwarden.sh start<br />
ExecStop=/opt/bitwarden/bitwarden.sh stop<br />
RemainAfterExit=true<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
Enable the Bitwarden service<br />
systemctl enable bitwarden<br />
<br />
Start the service<br />
systemctl start bitwarden<br />
<br />
<br />
<br />
== Reference ==<br />
https://bitwarden.com/help/article/install-on-premise/#install-docker-and-docker-compose<br />
<br />
https://bitwarden.com/help/article/hosting-faqs/#q-how-do-i-add-bitwarden-to-system-boot<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=BitwardenBitwarden2021-06-16T11:05:08Z<p>Ledhed: Created page with "== Overview == How to install Bitwarden === Install === As Root: Install Prerequisites apt-get install apt-transport-https ca-certificates curl gnupg-agent software-proper..."</p>
<hr />
<div>== Overview ==<br />
How to install Bitwarden<br />
<br />
<br />
=== Install ===<br />
<br />
As Root:<br />
Install Prerequisites<br />
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common<br />
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -<br />
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"<br />
apt update<br />
apt install docker-ce docker-ce-cli containerd.io docker-compose<br />
<br />
Create the Bitwarden Service Account<br />
useradd -s /bin/bash -m -d /home/bitwarden bitwarden<br />
usermod -aG docker bitwarden<br />
passwd bitwarden (USE A REALLY LONG COMPLEX PASSWORD AND FORGET IT!) You'll never actually login as this user, instead login as a user with root privileges and: su bitwarden<br />
mkdir /opt/bitwarden<br />
chmod 700 /opt/bitwarden<br />
chown bitwarden.bitwarden /opt/bitwarden<br />
<br />
<br />
Bitwarden User:<br />
cd /opt/bitwarden<br />
wget -O bitwarden.sh https://go.btwrdn.co/bw-sh<br />
chmod +x bitwarden.sh<br />
./bitwarden.sh install<br />
<br />
Copy ca.crt, certificate.crt, and private.key to:<br />
/home/bitwarden/bwdata/ssl/<FQDN>/<br />
<br />
Start Bitwarden<br />
~/bitwarden.sh start<br />
<br />
<br />
=== Automatic Startup ===<br />
Create /lib/systemd/system/bitwarden.service<br />
[Unit]<br />
Description=Bitwarden<br />
Requires=docker.service<br />
After=docker.service<br />
<br />
[Service]<br />
Type=oneshot<br />
User=bitwarden<br />
Group=bitwarden<br />
ExecStart=/opt/bitwarden/bitwarden.sh start<br />
ExecStop=/opt/bitwarden/bitwarden.sh stop<br />
RemainAfterExit=true<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
Enable the Bitwarden service<br />
systemctl enable bitwarden<br />
<br />
Start the service<br />
systemctl start bitwarden<br />
<br />
<br />
<br />
== Reference ==<br />
https://bitwarden.com/help/article/hosting-faqs/#q-how-do-i-add-bitwarden-to-system-boot<br />
<br />
[[Category:Linux]]</div>Ledhed//wiki.ledhed.net/index.php?title=Ubuntu_fd0_errorUbuntu fd0 error2021-06-16T04:56:26Z<p>Ledhed: Created page with "== Overview == If you install Ubuntu as an ESXi VM and remove the Floppy virtual hardware Ubuntu will boot slower and throw this error: blk_update_request: I/O error, dev fd0..."</p>
<hr />
<div>== Overview ==<br />
If you install Ubuntu as an ESXi VM and remove the Floppy virtual hardware Ubuntu will boot slower and throw this error:<br />
blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0<br />
<br />
<br />
== How to Fix ==<br />
Login to your Ubuntu VM and run the following:<br />
sudo rmmod floppy<br />
echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf<br />
sudo dpkg-reconfigure initramfs-tools<br />
Reboot. <br />
<br />
== Reference ==<br />
https://askubuntu.com/questions/719058/blk-update-request-i-o-error-dev-fd0-sector-0<br />
<br />
<br />
<br />
[[Category:Ubuntu]][[Category:ESXi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_Change_IP_without_RebootRaspberry Pi Change IP without Reboot2021-06-15T08:45:12Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Sometimes you want to change your Raspberry Pi's IP without having to reboot, here's how!<br />
<br />
<br />
== IP ADDR ==<br />
So in newer versions of Raspbian and RaspberryPi OS (Jessie and above) when you make changes to:<br />
/etc/dhcpcd.conf<br />
The changes don't take effect upon service restart.<br />
sudo service dhcpcd restart<br />
<br />
Here's what you need to do: <br><br />
Edit:<br />
/etc/dhcpcd.conf<br />
Run:<br />
sudo service dhcpcd stop<br />
sudo ip addr flush dev eth0<br />
sudo service dhcpcd start<br />
<br />
DONE!!!<br />
<br />
<br />
== Reference ==<br />
https://raspberrypi.stackexchange.com/questions/76655/change-static-ip-without-rebooting<br />
<br />
<br />
<br />
[[Category:Raspberry_Pi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_Change_IP_without_RebootRaspberry Pi Change IP without Reboot2021-06-15T08:42:12Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Sometimes you want to change your Raspberry Pi's IP without having to reboot, here's how!<br />
<br />
<br />
== IP ADDR ==<br />
So in newer versions of Raspbian and RaspberryPi OS (Jessie and above) when you make changes to:<br />
/etc/dhcpcd.conf<br />
The changes don't take effect upon service restart.<br />
sudo service dhcpcd restart<br />
<br />
Here's what you need to do: <br><br />
Edit:<br />
/etc/dhcpcd.conf<br />
Run:<br />
sudo ip addr flush dev eth0<br />
sudo service dhcpcd restart<br />
<br />
DONE!!!<br />
<br />
<br />
== Reference ==<br />
https://raspberrypi.stackexchange.com/questions/76655/change-static-ip-without-rebooting<br />
<br />
<br />
<br />
[[Category:Raspberry_Pi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_Change_IP_without_RebootRaspberry Pi Change IP without Reboot2021-06-15T08:41:58Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Sometimes you want to change your Raspberry Pi's IP without having to reboot, here's how!<br />
<br />
<br />
== IP ADDR ==<br />
So in newer versions of Raspbian and RaspberryPi OS (Jessie and above) when you make changes to:<br />
/etc/dhcpcd.conf<br />
The changes don't take effect upon service restart.<br />
sudo service dhcpcd restart<br />
<br />
Here's what you need to do:<br />
Edit:<br />
/etc/dhcpcd.conf<br />
Run:<br />
sudo ip addr flush dev eth0<br />
sudo service dhcpcd restart<br />
<br />
DONE!!!<br />
<br />
<br />
== Reference ==<br />
https://raspberrypi.stackexchange.com/questions/76655/change-static-ip-without-rebooting<br />
<br />
<br />
<br />
[[Category:Raspberry_Pi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Raspberry_Pi_Change_IP_without_RebootRaspberry Pi Change IP without Reboot2021-06-15T08:41:33Z<p>Ledhed: Created page with "== Overview == Sometimes you want to change your Raspberry Pi's IP without having to reboot, here's how! == IP ADDR == So in newer versions of Raspbian and RaspberryPi OS (J..."</p>
<hr />
<div>== Overview ==<br />
Sometimes you want to change your Raspberry Pi's IP without having to reboot, here's how!<br />
<br />
<br />
== IP ADDR ==<br />
So in newer versions of Raspbian and RaspberryPi OS (Jessie and above) when you make changes to:<br />
/etc/dhcpcd.conf<br />
The changes don't take effect upon service restart.<br />
sudo service dhcpcd restart<br />
<br />
Here's what you need to do:<br />
Edit:<br />
/etc/dhcpcd.conf<br />
Run:<br />
sudo ip addr flush dev eth0<br />
Then:<br />
sudo service dhcpcd restart<br />
<br />
DONE!!!<br />
<br />
<br />
== Reference ==<br />
https://raspberrypi.stackexchange.com/questions/76655/change-static-ip-without-rebooting<br />
<br />
<br />
<br />
[[Category:Raspberry_Pi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Changing_the_NTP_Server_in_HassOSChanging the NTP Server in HassOS2021-06-01T07:30:38Z<p>Ledhed: /* Background Info */</p>
<hr />
<div>== Overview ==<br />
Its common practice to create an Isolated VLAN for Home Automation gear and IoT devices. Doing so will make your environment inherently more secure, but it also presents challenges. In my case my Home Assistant server wasn't keeping accurate time. This article will briefly demonstrate how to change the NTP server Home Assistant connects to for time syncronizations.<br />
<br />
<br />
== Background Info ==<br />
HassOS runs on an Overlay File System, which means that edits to files from the command line won't survive a reboot (assuming you can even make changes, often times you'll get an error stating that its a Read-Only File System). So how do you make changes? <br><br />
First: Read [https://github.com/home-assistant/operating-system/blob/dev/Documentation/configuration.md]<br />
I had done this, but had challenges getting the USB stick to passthrough to my HassOS VM on Boot. So I went the alternative route by creating a '''CONFIG''' folder in the boot partition, BUT WHERE IS THE BOOT PARTITION!!!<br />
Open the console of your HassOS and login as ''root''. Then at the command line type: ''logon''<br />
ha > login<br />
# mkdir -p /mnt/boot/CONFIG<br />
# echo -e "[Time]\nNTP=10.20.30.40\nFallbackNTP=10.20.30.41" > /mnt/boot/CONFIG/timesyncd.conf<br />
''Replace '''10.20.30.40''' and '''10.20.30.41''' with your desired NTP servers.'' <br><br />
Alternatively you can:<br />
# vi /mnt/boot/CONFIG/timesyncd.conf<br />
<br />
[Time]<br />
NTP=10.20.30.40<br />
FallbackNTP=10.20.30.41<br />
<br />
Once /mnt/boot/CONFIG/timesyncd.conf has been created you can reboot the Host<br />
# reboot<br />
<br />
== Notes ==<br />
You can confirm the changes by logging in again and running:<br />
# cat /etc/systemd/timesyncd.conf<br />
It should reflect the changes you made above.<br><br />
I also noticed that the /mnt/boot/CONFIG folder is removed after reboot. This is normal, and your changes should persist future reboots.<br />
<br />
<br />
<br />
== Reference ==<br />
https://github.com/home-assistant/operating-system/blob/dev/Documentation/configuration.md<br />
<br />
https://github.com/home-assistant/supervisor/issues/957#issuecomment-528948200<br />
<br />
<br />
[[Category:Home Assistant]]</div>Ledhed//wiki.ledhed.net/index.php?title=Dynamic_Firewall_Aliases_in_OPNSenseDynamic Firewall Aliases in OPNSense2021-05-29T08:39:34Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
In an ideal world you would create firewall rules that target specific source IP addresses. Unfortunately many cloud services utilize multiple large ranges of IPs that change. Which make Static Aliases a pain to manage. This article will show you how to create Dynamic IP Aliases in OPNSense.<br />
<br />
== Aliases ==<br />
Aliases are very power. In addition to being able to assign friendly names to IPs, Networks, MAC Address, URLs, Domains, etc. You can also nest Aliases, and then reference the alias in your Firewall Rules. Here we will focus on 'URL Tables' which allow you to create an Alias of IPs and/or networks from a URL at a given interval. Making the Alias dynamic, and resilient to changes.<br />
<br />
=== URL Tables ===<br />
Firewall -> Aliases <br><br />
Create (+ Icon) <br><br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPv4<br />
|-<br />
| Type || Host(s)<br />
|-<br />
| Content || https://www.cloudflare.com/ips-v4<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IPv4 Address List<br />
|-<br />
|}<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPv6<br />
|-<br />
| Type || Host(s)<br />
|-<br />
| Content || https://www.cloudflare.com/ips-v6<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IPv6 Address List<br />
|-<br />
|}<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPs<br />
|-<br />
| Type || Network(s)<br />
|-<br />
| Content || CloudFlare_IPv4 CloudFlare_IPv6<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IP Ranges<br />
|-<br />
|}<br />
<br />
The last Alias is a nested Network Alias that uses both URL Tables. Now you can reference 'CloudFlare_IPs' in your source or destination rules.<br />
<br />
<br />
== Security ==<br />
Make sure the URL Table you reference is from a source you trust. If the URL is DNS hijacked or content modified by the attacker, they could substitute their own IP address into your firewall rules. Its highly advised to use a URL that uses HTTPS so you can verify the identity of the server and make Man-in-the-Middle attacks more difficult.<br />
<br />
<br />
== Reference ==<br />
https://docs.opnsense.org/manual/how-tos/edrop.html<br />
<br />
https://www.cloudflare.com/ips/<br />
<br />
[[Category:OPNSense]]</div>Ledhed//wiki.ledhed.net/index.php?title=Dynamic_Firewall_Aliases_in_OPNSenseDynamic Firewall Aliases in OPNSense2021-05-29T08:30:25Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
In an ideal world you would create firewall rules that target specific source IP addresses. Unfortunately many cloud services utilize multiple large ranges of IPs that change. Which make Static Aliases a pain to manage. This article will show you how to create Dynamic IP Aliases in OPNSense.<br />
<br />
== Aliases ==<br />
Aliases are very power. In addition to being able to assign friendly names to IPs, Networks, MAC Address, URLs, Domains, etc. You can also nest Aliases, and then reference the alias in your Firewall Rules. Here we will focus on 'URL Tables' which allow you to create an Alias of IPs and/or networks from a URL at a given interval. Making the Alias dynamic, and resilient to changes.<br />
<br />
=== URL Tables ===<br />
Firewall -> Aliases<br />
Create (+ Icon)<br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPv4<br />
|-<br />
| Type || Host(s)<br />
|-<br />
| Content || https://www.cloudflare.com/ips-v4<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IPv4 Address List<br />
|-<br />
|}<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPv6<br />
|-<br />
| Type || Host(s)<br />
|-<br />
| Content || https://www.cloudflare.com/ips-v6<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IPv6 Address List<br />
|-<br />
|}<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
| Enabled || [X]<br />
|-<br />
| Name || CloudFlare_IPs<br />
|-<br />
| Type || Network(s)<br />
|-<br />
| Content || CloudFlare_IPv4 CloudFlare_IPv6<br />
|-<br />
| Statistics || [ ]<br />
|-<br />
| Description || CloudFlare IP Ranges<br />
|-<br />
|}<br />
<br />
The last Alias is a nested Network Alias that uses both URL Tables. Now you can reference 'CloudFlare_IPs' in your source or destination rules.<br />
<br />
<br />
== Security ==<br />
Make sure the URL Table you reference is from a source you trust. If the URL is DNS hijacked or content modified by the attacker, they could substitute their own IP address into your firewall rules. Its highly advised to use a URL that uses HTTPS so you can verify the identity of the server and make Man-in-the-Middle attacks more difficult.<br />
<br />
<br />
== Reference ==<br />
https://docs.opnsense.org/manual/how-tos/edrop.html<br />
<br />
https://www.cloudflare.com/ips/<br />
<br />
[[Category:OPNSense]]</div>Ledhed//wiki.ledhed.net/index.php?title=Dynamic_Firewall_Aliases_in_OPNSenseDynamic Firewall Aliases in OPNSense2021-05-29T08:04:35Z<p>Ledhed: Created page with "== Overview == In an ideal world you would create firewall rules that target specific source IP addresses. Unfortunately many cloud services utilize multiple large ranges of I..."</p>
<hr />
<div>== Overview ==<br />
In an ideal world you would create firewall rules that target specific source IP addresses. Unfortunately many cloud services utilize multiple large ranges of IPs that change. Which make Static Aliases a pain to manage. This article will show you how to create Dynamic IP Aliases in OPNSense.<br />
<br />
== Aliases ==<br />
Aliases are very power<br />
<br />
=== URL Tables ===<br />
<br />
<br />
== Reference ==<br />
https://docs.opnsense.org/manual/how-tos/edrop.html<br />
<br />
https://www.cloudflare.com/ips/<br />
<br />
[[Category:OPNSense]]</div>Ledhed//wiki.ledhed.net/index.php?title=Category:OPNSenseCategory:OPNSense2021-05-29T06:24:27Z<p>Ledhed: Created page with "https://opnsense.org/ Category:Tech_Notes"</p>
<hr />
<div>https://opnsense.org/<br />
<br />
[[Category:Tech_Notes]]</div>Ledhed//wiki.ledhed.net/index.php?title=Setting_a_Static_IP_in_HassOSSetting a Static IP in HassOS2021-05-16T05:27:54Z<p>Ledhed: Created page with "== Notes == mkdir -p /mnt/boot/CONFIG vi /mnt/boot/CONFIG/my-network Change the '''[IPv4]''' section to: [ipv4] method=manual address=10.20.30.40/24;10.20.30.1 dns=1.1..."</p>
<hr />
<div>== Notes ==<br />
mkdir -p /mnt/boot/CONFIG<br />
vi /mnt/boot/CONFIG/my-network<br />
<br />
Change the '''[IPv4]''' section to:<br />
<br />
[ipv4]<br />
method=manual<br />
address=10.20.30.40/24;10.20.30.1<br />
dns=1.1.1.1;8.8.8.8;<br />
<br />
<br />
== nmcli ==<br />
# nmcli con show<br />
# nmcli con show "Home Assistant OS default"<br />
<br />
# nmcli con edit "Home Assistant OS default"<br />
<br />
nmcli> set ipv4.addresses 10.20.30.40/24<br />
Do you also want to set 'ipv4.method' to 'manual'? [yes]:<br />
<br />
nmcli> set ipv4.dns 1.1.1.1,8.8.8.8<br />
nmcli> set ipv4.gateway 10.20.30.1<br />
<br />
Confirm the changes:<br />
nmcli> print ipv4<br />
and Save:<br />
nmcli> save<br />
<br />
Restart the connection:<br />
nmcli con reload<br />
or a Host reboot also works.<br />
<br />
<br />
== Reference ==<br />
https://github.com/home-assistant/operating-system/blob/dev/Documentation/network.md<br />
<br />
<br />
<br />
[[Category:Home Assistant]]</div>Ledhed//wiki.ledhed.net/index.php?title=Changing_the_NTP_Server_in_HassOSChanging the NTP Server in HassOS2021-05-16T05:15:47Z<p>Ledhed: Created page with "== Overview == Its common practice to create an Isolated VLAN for Home Automation gear and IoT devices. Doing so will make your environment inherently more secure, but it also..."</p>
<hr />
<div>== Overview ==<br />
Its common practice to create an Isolated VLAN for Home Automation gear and IoT devices. Doing so will make your environment inherently more secure, but it also presents challenges. In my case my Home Assistant server wasn't keeping accurate time. This article will briefly demonstrate how to change the NTP server Home Assistant connects to for time syncronizations.<br />
<br />
<br />
== Background Info ==<br />
HassOS runs on an Overlay File System, which means that edits to files from the command line won't survive a reboot (assuming you can even make changes, often times you'll get an error stating that its a Read-Only File System). So how to you make changes? <br><br />
First: Read [https://github.com/home-assistant/operating-system/blob/dev/Documentation/configuration.md]<br />
I had done this, but had challenges getting the USB stick to passthrough to my HassOS VM on Boot. So I went the alternative route by creating a '''CONFIG''' folder in the boot partition, BUT WHERE IS THE BOOT PARTITION!!!<br />
Open the console of your HassOS and login as ''root''. Then at the command line type: ''logon''<br />
ha > login<br />
# mkdir -p /mnt/boot/CONFIG<br />
# echo -e "[Time]\nNTP=10.20.30.40\nFallbackNTP=10.20.30.41" > /mnt/boot/CONFIG/timesyncd.conf<br />
''Replace '''10.20.30.40''' and '''10.20.30.41''' with your desired NTP servers.'' <br><br />
Alternatively you can:<br />
# vi /mnt/boot/CONFIG/timesyncd.conf<br />
<br />
[Time]<br />
NTP=10.20.30.40<br />
FallbackNTP=10.20.30.41<br />
<br />
Once /mnt/boot/CONFIG/timesyncd.conf has been created you can reboot the Host<br />
# reboot<br />
<br />
<br />
== Notes ==<br />
You can confirm the changes by logging in again and running:<br />
# cat /etc/systemd/timesyncd.conf<br />
It should reflect the changes you made above.<br><br />
I also noticed that the /mnt/boot/CONFIG folder is removed after reboot. This is normal, and your changes should persist future reboots.<br />
<br />
<br />
<br />
== Reference ==<br />
https://github.com/home-assistant/operating-system/blob/dev/Documentation/configuration.md<br />
<br />
https://github.com/home-assistant/supervisor/issues/957#issuecomment-528948200<br />
<br />
<br />
[[Category:Home Assistant]]</div>Ledhed//wiki.ledhed.net/index.php?title=Tasmota_Command_Line_OptionsTasmota Command Line Options2021-04-27T16:22:13Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
Some useful command line options for devices running Tasmota firmware<br />
<br />
<br />
<br />
== Console ==<br />
Open the device's webpage, and click the 'Console' button. At the console enter your commands. Commands are automatically saved and should survive a reboot.<br />
<br />
== MQTT ==<br />
https://github.com/arendst/Tasmota/wiki/Commands#mqtt<br />
<br />
<br />
=== Update Interval ===<br />
To set the update interval / frequency at which the devices sends MQTT messages:<br />
TelePeriod 30<br />
''0 = disable telemetry messages''<br><br />
''1 = reset telemetry period to firmware default (TELE_PERIOD)''<br><br />
''10..3600 = set telemetry period in seconds (default = 300)''<br><br />
<br />
<br />
== Temperature Calibration ==<br />
TempOffset 1.3<br />
[https://tasmota.github.io/docs/Commands/#tempoffset TempOffset]<br />
<br />
<br />
<br />
== Humidity Calibration ==<br />
HumOffset 1.7<br />
[https://tasmota.github.io/docs/Commands/#humidoffset HumOffset]<br />
<br />
<br />
<br />
=== Status ===<br />
status 8<br />
This is a handy way to debug an unknown device. Set as many GPIO pins to SwitchX and then run this command, then press+hold a button on the device and run status 8 again to see which one changed.<br />
<br />
<br />
== SetOptions ==<br />
https://github.com/arendst/Tasmota/wiki/commands#setoption-overview<br />
<br />
=== Temperature Units ===<br />
To set temperature units to Fahrenheit:<br />
SetOption8 1<br />
<br />
=== Color Values ===<br />
To set color units to R,G,B,W (0-255):<br />
SetOption17 1<br />
Enables color status in decimals<br />
<br />
To set color red:<br />
color 255,0,0,0<br />
To set color green:<br />
color 0,255,0,0<br />
To set color blue:<br />
color 0,0,255,0<br />
To set color white:<br />
color 0,0,0,255<br />
<br />
<br />
=== AutoDiscovery ===<br />
SetOption19 enables/disables MQTT Auto-Discovery<br />
SetOption19 0<br />
This disables MQTT auto-discovery, but also enables auto-discovery in Home Assistant when using the Tasmota Integration.<br />
<br />
<br />
== WiFi Manager ==<br />
If you have a device that is physically difficult to get to, or difficult to flash (bulbs), you may want to enable the WiFi Manager. This will cause the device to switch to AP mode when it can't find a wireless network to connect to. When in AP mode, you can connect to it from another wireless device like a laptop or smart phone and change the network config.<br />
WifiConfig 2<br />
<br />
<br />
== I2C Scan ==<br />
This command causes Tasmota to scan the I2C bus and display found device ID's.<br />
i2cscan<br />
<br />
<br />
== Reference ==<br />
https://github.com/arendst/Tasmota/wiki/commands <br />
<br />
<br />
[[Category:Tasmota]]</div>Ledhed//wiki.ledhed.net/index.php?title=ESXi_NUT_ClientESXi NUT Client2021-04-14T11:18:04Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
How to make ESXi a NUT client for graceful shutdowns.<br />
<br />
<br />
== Download ==<br />
https://rene.margar.fr/download/1483/<br />
<br />
<br />
== Reference ==<br />
https://www.bohica.net/main/freebsd-and-unix-mainmenu-28/283-nut-client-for-vmware-esxi<br />
<br />
https://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/<br />
<br />
<br />
[[Category:NUT]][[Category:ESXi]]</div>Ledhed//wiki.ledhed.net/index.php?title=ESXi_NUT_ClientESXi NUT Client2021-04-14T09:41:11Z<p>Ledhed: Created page with "== Overview == How to make ESXi a NUT client for graceful shutdowns. == Reference == https://www.bohica.net/main/freebsd-and-unix-mainmenu-28/283-nut-client-for-vmware-esxi..."</p>
<hr />
<div>== Overview ==<br />
How to make ESXi a NUT client for graceful shutdowns.<br />
<br />
<br />
== Reference ==<br />
https://www.bohica.net/main/freebsd-and-unix-mainmenu-28/283-nut-client-for-vmware-esxi<br />
<br />
<br />
<br />
[[Category:NUT]][[Category:ESXi]]</div>Ledhed//wiki.ledhed.net/index.php?title=Tripp_Lite_-_NUTTripp Lite - NUT2021-04-14T09:38:49Z<p>Ledhed: </p>
<hr />
<div>== Overview ==<br />
I ran into some issues with NUT and my new Tripp Lite SMART1500LCDXL and wanted to post me notes so others can benefit.<br />
<br />
<br />
== Issue ==<br />
MUT would post a wall message stating that it lost connection with the UPS and then post that the data was stale.<br />
<br />
<br />
== Resolution ==<br />
I initially set the '''pollinterval''' to 15 seconds, but started getting the disconnect issue. It turns out that the UPS likes to be polled by the driver every 1/2 second. NUT by default sets a 'pollinterval' of 2 seconds which seems to be frequent enough to prevent the disconnect. So I just commented out the '''pollinterval''' line in ups.conf, you could set it to a value of 1 but 2 seems to be enough.<br />
=== ups.conf ===<br />
[ups1]<br />
driver = "usbhid-ups"<br />
port = "auto"<br />
desc = "Tripp Lite SMART1500LCDXL"<br />
vendor = "Tripp Lite"<br />
vendorid = "09ae"<br />
productid = "2012"<br />
# pollinterval = 1<br />
bus = "001"<br />
<br />
<br />
== Reference ==<br />
https://alioth-lists.debian.net/pipermail/nut-upsdev/2019-June/007440.html<br />
<br />
<br />
<br />
[[Category:NUT]]</div>Ledhed//wiki.ledhed.net/index.php?title=Tripp_Lite_-_NUTTripp Lite - NUT2021-04-14T09:06:29Z<p>Ledhed: Created page with "== Overview == I ran into some issues with NUT and my new Tripp Lite SMART1500LCDXL and wanted to post me notes so others can benefit. == Issue == MUT would post a wall messa..."</p>
<hr />
<div>== Overview ==<br />
I ran into some issues with NUT and my new Tripp Lite SMART1500LCDXL and wanted to post me notes so others can benefit.<br />
<br />
== Issue ==<br />
MUT would post a wall message stating that it lost connection with the UPS and then post that the data was stale.<br />
<br />
<br />
== Resolution ==<br />
I initially set the '''pollinterval''' to 15 seconds, but started getting the disconnect issue. It turns out that the UPS likes to be polled by the driver every 1/2 second. NUT by default sets a 'pollinterval' of 2 seconds which seems to be frequent enough to prevent the disconnect. So I just commented out the '''pollinterval''' line in ups.conf, you could set it to a value of 1 but 2 seems to be enough.<br />
=== ups.conf ===<br />
[ups1]<br />
driver = "usbhid-ups"<br />
port = "auto"<br />
desc = "Tripp Lite SMART1500LCDXL"<br />
vendor = "Tripp Lite"<br />
vendorid = "09ae"<br />
productid = "2012"<br />
# pollinterval = 1<br />
bus = "001"<br />
<br />
<br />
== Reference ==<br />
https://alioth-lists.debian.net/pipermail/nut-upsdev/2019-June/007440.html<br />
<br />
<br />
<br />
[[Category:NUT]]</div>Ledhed