sudo vim /lib/systemd/system/servicename.service
[Unit]
Description=My Service
After=multi-user.target
[Service]
- theme: Backend-selected | |
icon: mdi:city-variant | |
path: zurich | |
badges: [] | |
cards: | |
- type: vertical-stack | |
cards: | |
- camera_view: auto | |
type: picture-glance | |
title: Uetliberg Zürichsee |
[ | |
{ | |
"id": "398bef58.0823b", | |
"type": "server-events", | |
"z": "7d4c9938.2a0338", | |
"name": "Apple TV Remote", | |
"server": "78fe396.483dac8", | |
"event_type": "homekit_tv_remote_key_pressed", | |
"exposeToHomeAssistant": false, | |
"haConfig": [ |
[{"id":"a5733396e98a6fbf","type":"function","z":"e550f91e.577438","name":"insert metrics","func":"msg.payload = {\n\"data\" : {\n\"metrics\" : [\n{\n\"units\" : \"count\",\n\"data\" : [\n{\n\"qty\" : 5472,\n\"date\" : \"2021-12-11 00:00:00 -0500\"\n},\n{\n\"qty\" : 8169,\n\"date\" : \"2021-12-12 00:00:00 -0500\"\n},\n{\n\"date\" : \"2021-12-13 00:00:00 -0500\",\n\"qty\" : 3446\n},\n{\n\"date\" : \"2021-12-14 00:00:00 -0500\",\n\"qty\" : 4784\n},\n{\n\"date\" : \"2021-12-15 00:00:00 -0500\",\n\"qty\" : 4837.7652613770606\n},\n{\n\"qty\" : 4852,\n\"date\" : \"2021-12-16 00:00:00 -0500\"\n}\n],\n\"name\" : \"step_count\"\n}\n],\n\"workouts\" : [\n\n]\n}\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":220,"y":3440,"wires":[["aaeb804e202a0508"]]},{"id":"9513551692b17c69","type":"inject","z":"e550f91e.577438","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y": |
# generate certificates for 10years with the following command: | |
# openssl req -new -x509 -keyout key.pem -out server.pem -days 3000 -nodes | |
# Startup with the following command: | |
# python3 server.py | |
import http.server | |
import ssl | |
import subprocess | |
import base64 |
def props = new Properties() | |
file("gradle.properties").withInputStream { props.load(it) } | |
int major | |
int minor | |
int hotfix | |
task readVersion() { | |
doFirst { | |
String version = props.getProperty("version") |
scp filename.txt [email protected]:/var/lib/location/on/server
scp [email protected]:/var/lib/location/on/server/filename.txt ./
# 1. Install gfc emulator | |
npm install -g @google-cloud/functions-emulator | |
# 2. Set correct project | |
functions config set projectId YOUR_PROJECT_ID | |
# 3. Get correct version of Node.js (works for *nix systems) | |
npm install -g n | |
n 6.11.5 |
const config = { | |
sample: { | |
database: { | |
connection: 'projectId:location:dbInstance', | |
name: 'dbName', | |
user: 'dbUser', | |
password: 'dbPassword' | |
} | |
} | |
}; |