sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| #!/bin/bash | |
| # Set script to exit on error | |
| set -e | |
| # Enable logging | |
| exec > >(tee -i /var/log/setup-script.log) | |
| exec 2>&1 | |
| echo "Starting script execution..." |
| #!/bin/bash | |
| # Change the date under CUTOFF_DATE to change how far back you want to delete | |
| # Install the GitHub CLI tool by following the instructions in the official documentation: https://cli.github.com/manual/installation | |
| # Make sure you auth first to github with 'gh auth login' | |
| REPO_OWNER="OWNER" | |
| REPO_NAME="REPO_NAME" | |
| CUTOFF_DATE=$(date --date='30 days ago' +'%Y-%m-%dT%H:%M:%SZ') | |
| PAGE=1 |
| /** | |
| * Retroactively add Blurhash strings to image assets in your Sanity Content Lake. | |
| * 1. yarn add got sharp blurhash | |
| * 2. run sanity exec blurhash --with-user-token | |
| * 3. repeat (patches 100 assets in 1 transaction pr run) | |
| * | |
| * Some images might take a while to process. | |
| */ | |
| import client from 'part:@sanity/base/client' | |
| import got from 'got' |
This is a quick documentation on how I've setup akri in my kubernetes cluster to make my Conbee II stick available to zigbee2mqtt as a remote device. This allows zigbee2mqtt to run on any node in the cluster. The advantage to using Akri over node-feature-detection and node affinity rules to run zigbee2mqtt on a given node is that when a device is unplugged Akri will automatically remove the pod. So I can move the stick from one node to another and less than a minute later the stick is ready to be used again.
Eventually Kubernetes plans to add requiredDuringSchedulingRequiredDuringExecution affinity rules which in theory could
give us a similar effect where zigbee2mqtt could connect directly to the device rather than connecting remotely, but we could
simply move the stick and the zigbee2mqtt pod would follow it.
| blueprint: | |
| name: Appliance has finished | |
| description: Do something when an appliance (like a washing machine or dishwasher) | |
| has finished as detected by a power sensor. | |
| domain: automation | |
| input: | |
| power_sensor: | |
| name: Power Sensor | |
| description: Power sensor entity (e.g. from a smart plug device). | |
| selector: |
Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):
Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:
curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
| // Licence: Robert Koch-Institut (RKI), dl-de/by-2-0 | |
| const newCasesApiUrl = `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_COVID19/FeatureServer/0/query?f=json&where=NeuerFall%20IN(1%2C%20-1)&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22AnzahlFall%22%2C%22outStatisticFieldName%22%3A%22value%22%7D%5D&resultType=standard&cacheHint=true`; | |
| const incidenceUrl = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=GEN,last_update,cases,cases7_per_100k&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json` | |
| const saveIncidenceLatLon = (location) => { | |
| let fm = FileManager.iCloud() | |
| let path = fm.joinPath(fm.documentsDirectory(), "covid19latlon.json") | |
| fm.writeStrin |
| // Licence: Robert Koch-Institut (RKI), dl-de/by-2-0 | |
| class IncidenceWidget { | |
| constructor() { | |
| this.previousDaysToShow = 31; | |
| this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json` | |
| this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json` | |
| this.stateToAbbr = { | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>PayloadContent</key> | |
| <array> | |
| <dict> | |
| <key>DNSSettings</key> | |
| <dict> | |
| <key>DNSProtocol</key> |