Ubuntu Home Assistant Docker
Oct 28, 2020Portainer 1$ docker volume create portainer_data 2$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce Home Assistant 1cd ~/homeassistant-docker 2 3#start 4docker-compose up -d 5 6#restart 7docker-compose …
Read MoreSwish with PHP and curl requires original .pem and additionaly the extracted .key, which was a hassle to extract on Windows. To extract the key: import the .pem-cert into windows cert store on the machine that created the CSR and then export it to pfx with keys. Then do number two below. 1. .pfx to .pem openssl pkcs12 …
Read MoreDocker and ASP.NET MVC
Dec 18, 2019Get started choco install docker-desktop Open Docker desktop verify it is starting Right click icon in taskbar and: Switch to Windows containers ####Docker cheat sheet Get Running containers docker container ls Run a command inside the container docker container exec XX ls (XX är id för containern, kanske funkar med …
Read MoreUbuntu files backups Onedrive
Dec 8, 2019###OneDrive Använder fork av skilion/onedrive https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md Config: sudo vim ~/.config/onedrive/config 1systemctl enable onedrive@<username>.service 2systemctl start onedrive@<username>.service To view the status of the service running for the user, use the …
Read Morenode-red
Jan 14, 2019Autostart capability using SystemD 1sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service 2sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start …
Read MoreVIM Simple Vim VSCode VsVim
Dec 19, 2018Cheat sheet for Simple Vim in VSCode https://marketplace.visualstudio.com/items?itemName=jpotterm.simple-vim Move around 1Ctrl+b page up 2Ctrl+f page down 3$ end of line 4% matching bracket 5[{ previous bracket or next: ]} 6* or # Jump to next/prev occurrence of word under cursor 7A Move to end of line and enter Insert …
Read Moregit cheat sheet
Feb 27, 2018merge PR into fork 1git remote add pr-source https://github.com/<user-providing-pull-request>/<repo-name> 2git fetch pr-source 3git merge pr-source/<pull-request-branch-name> checkout commit 1git checkout <sha1> sync fork with remote master 1git clone …
Read MoreKentor Authservices
Feb 23, 2018Logging events public class ElmahLoggerAdapter : Kentor.AuthServices.ILoggerAdapter { public void WriteInformation(string message) { LogText(message); } public void WriteError(string message, Exception ex) { LogText(ex + Environment.NewLine + message); } public void WriteVerbose(string message) { LogText(message); } …
Read Moreinfluxdb grafana
Feb 12, 2018https://community.home-assistant.io/t/complete-guide-on-setting-up-grafana-influxdb-with-home-assistant-using-official-docker-images/42860 https://snillevilla.se/snygg-statistik-i-home-assistant-med-grafana-och-influxdb/ access grafana on http://IP-ADRESS:3000 admin/admin start influxdb container 1docker run -d \ …
Read MoreHome-assistant venv Ubuntu
Jan 7, 2018Upgrade Python to 3.5.4 https://sgrudadh.blogspot.se/2017/12/upgrading-python-virtual-environment.html Install hass in venv https://sgrudadh.blogspot.co.uk/2017/12/installing-home-assistant-in-virtual.html You can watch Home Assistant start (and run) with: 1$ sudo journalctl -f -u home-assistant You can stop watching …
Read Morepostgresql
Nov 21, 20171#change to user postgres 2sudo -i -u postgres 3 4#get into sql-mode 5psql 6 7#create new role 8createuser --interactive 9 10#list dbs 11\l 12 13#select db 14\c database-name 15 16#list tables 17\dt 18 19#exit postgres 20\q …
Read Morehassbian Home Assistant
Sep 5, 2017####Docker (tamarind) https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04 https://home-assistant.io/docs/installation/docker/ 1 #config: /home/erik/docker-conf 2 3 docker run --rm -d --name="home-assistant" -v /home/erik/docker-conf:/config -v …
Read MoreESP8266 Arduino Wifi-module
May 15, 20171 2AT+CWJAP= “Wi-FiNetwork”,“Password” 3 4OK 5AT+CIPMUX=1 6 7 8OK 9AT+CIPSERVER=1,80 10 11 12OK 13AT+CIFSR 14 15+CIFSR:STAIP,"192.168.1.230" 16+CIFSR:STAMAC,"a0:20:a6:0e:ac:af" 17 Source: http://www.instructables.com/id/Getting-Started-With-the-ESP8266-ESP-01/ 1Try to connect The GPIO0 with a 10k …
Read MoreSQL Server cheat sheet
Sep 20, 2016######Reset auto-increment Key to 1 1DBCC CHECKIDENT ('[dbo].[ServiceIntegrations]', RESEED, 0) 2GO ######Drop constraint with unknown name 1DECLARE @ObjectName NVARCHAR(100) 2SELECT @ObjectName = OBJECT_NAME([default_object_id]) FROM SYS.COLUMNS 3WHERE [object_id] = …
Read MorePowershell - remove old files and folders
Jun 12, 2016Remove files older than X days, and remove empty folders. 1# set folder path 2$dump_path = "c:\Temp\remove-files-ps" 3 4# set min age of files 5$max_days = "-20" 6 7# get the current date 8$curr_date = Get-Date 9 10# determine how far back we go based on current date 11$del_date = …
Read More1DECLARE @name VARCHAR(50) -- database name 2DECLARE @path VARCHAR(256) -- path for backup files 3DECLARE @fileName VARCHAR(256) -- filename for backup 4DECLARE @fileDate VARCHAR(20) -- used for file name 5DECLARE @debug BIT = 0 6 7-- specify database backup directory 8SET @path = 'c:\temp\db-backup\' --must …
Read MoreData-binding an input-field or text-field to a JavaScript date is not implemented by default in Knockout. Here is a solution using MomentJS for formatting the date. /* * use like this: data-bind="date: dateVariable, format: 'YYYY-MM-DD'" */ ko.bindingHandlers.date = { init: function(element, valueAccessor, …
Read MoreNär man arbetar med NHibernate mot databas så är lazy-loading aktiverat per default. var session = sessionFactory.OpenSession(); var users = session.Query<User>() .ToList(); Denna query hämtar Users-tabellen och ingenting annat. Trots att man gjort ToList() är inte kopplingen mot sessionen bruten, så går man ner …
Read MoreRegex cheatsheet
Oct 9, 2015####Search-replace i Sublime Text: County = "03", Ersätt med: <County>03</County> Search: County = "([0-9]*"), Replace: <MasterCounty>\1</MasterCounty> https://github.com/dmikalova/sublime-cheat-sheets/blob/master/cheat-sheets/Regular%20Expressions.cheatsheet
Read MoreDownload Boxstarter: http://boxstarter.org/Learn/SimplePackage Install setup.bat with admin-rights. Open up powershell and run BoxstarterShell.bat. Install a boxstarter-script (.ps1) with: Install-BoxstarterPackage -PackageName C:\bin\boxes\hej.ps1 Boxstarter script # Boxstarter options $Boxstarter.RebootOk=$true # …
Read More