Author: admin
-
Home Assistant update
$ sudo systemctl stop home-assistant@homeassistant.service $ sudo su -s /bin/bash homeassistant $ source /srv/homeassistant/bin/activate $ pip3 install –upgrade homeassistant $ exit $ sudo systemctl start home-assistant@homeassistant.service
-
Scsi Autoloader commands
mtx -f /dev/sg5 status mtx -f /dev/sg5 unload Ladda band från slot 4 mtx -f /dev/sg5 load 4 Listar scsi devices med sg namn lsscsi -g
-
Hassbian update
$ sudo systemctl stop home-assistant@homeassistant.service $ sudo su -s /bin/bash homeassistant $ source /srv/homeassistant/bin/activate $ pip3 install –upgrade homeassistant $ exit $ sudo systemctl start home-assistant@homeassistant.service
-
Micropyhton esp8266 JSON client
# Sample code to request the state fron JSON service. API_PASSWORD = ‘YOUR_PASSWORD’ URL = ‘http://x.x.x.x:xxxx/api/states/’ ENTITY = ‘sensor’ TIMEOUT = 30 PIN = 5 def get_data(): import urequests url = ‘{}{}’.format(URL, ENTITY) headers = {‘x-ha-access’: API_PASSWORD, ‘content-type’: ‘application/json’} resp = urequests.get(URL, headers=headers) return resp.json()[‘state’] def main(): import machine import time pin = machine.Pin(PIN, machine.Pin.OUT)…
-
Start network on esp8266
Configure network as client import network wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect(‘ssid’, ‘password’) Show IP-adress wlan.ifconfig() Configure network as access Point import network ap = network.WLAN(network.AP_IF) ap.active(True) ap.config(essid=”network-name”, authmode=network.AUTH_WPA_WPA2_PSK, password=”abcdabcdabcd”)
-
Backup of MSSQL database
Create stored procedure. // Copyright © Microsoft Corporation. All Rights Reserved. // This code released under the terms of the // Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.) USE [master] GO /****** Object: StoredProcedure [dbo].[sp_BackupDatabases] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO — ============================================= — Author: Microsoft — Create date: 2010-02-06 — Description: Backup Databases…
-
Install Tomcat 8 on Ubuntu 16.04
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04