Skip to content

Instantly share code, notes, and snippets.

View saper-2's full-sized avatar

saper-2

  • Poland
View GitHub Profile
@beanieboi
beanieboi / home assistant.yml
Last active June 6, 2022 03:09
HomeAssistant Luftdaten REST API - Air Quality, PM2.5, PM10, Temp and Humidity (SDS011 and DHT22)
sensor:
- platform: rest
name: luftdaten
resource: http://192.168.1.149/data.json
scan_interval: 100
json_attributes:
- sensordatavalues
value_template: '{{ value_json.age }}'
- platform: template
sensors:
@posilva
posilva / disable.sh
Last active November 21, 2023 18:15
Remove/Disable Ubuntu SystemD Daily.Timers
# References:
#
# https://cinhtau.net/2016/12/09/disable-apt-auto-update-and-upgrade/
# https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image
# https://askubuntu.com/questions/824718/ubuntu-16-04-unattended-upgrades-runs-at-random-times/831206
apt-get -y purge update-notifier-common ubuntu-release-upgrader-core landscape-common unattended-upgrades
systemctl kill --kill-who=all apt-daily.service
systemctl kill --kill-who=all apt-daily-upgrade.service
@fushnisoft
fushnisoft / clariondate.sql
Last active January 5, 2024 14:33
Convert a Clarion Date (INT) to SQL DateTime
DECLARE @ClarionDate INT = 47563
DECLARE @SqlDateTime DATETIME
-- Convert the clarion DATE into and SQL DateTime
SET @SqlDateTime = DateAdd(day, @ClarionDate - 4, '1801-01-01')
SELECT @SqlDateTime AS 'SQL Date Time'
-- Now convert it back from and SQL DateTime to a Clarion Date
SET @ClarionDate = DateDiff(day, DateAdd(day, -4, '1801-01-01'), @SqlDateTime)