cederlof.net
  • Ubuntu Home Assistant Docker

    Oct 28, 2020

    Portainer 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 More
  • Extract .pem and .key from .pfx certificate for Swish

    Oct 11, 2020

    Swish 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 More
  • Docker and ASP.NET MVC

    Dec 18, 2019

    Get 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 More
  • Ubuntu 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 More
  • node-red

    Jan 14, 2019

    Autostart 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 More
  • VIM Simple Vim VSCode VsVim

    Dec 19, 2018

    Cheat 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 More
  • git cheat sheet

    Feb 27, 2018

    merge 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 More
  • Kentor Authservices

    Feb 23, 2018

    Logging 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 More
  • influxdb grafana

    Feb 12, 2018

    https://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 More
  • Home-assistant venv Ubuntu

    Jan 7, 2018

    Upgrade 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 More
  • postgresql

    Nov 21, 2017

    1#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 More
  • hassbian 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 More
  • ESP8266 Arduino Wifi-module

    May 15, 2017

    1 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 More
  • SQL 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 More
  • Powershell - remove old files and folders

    Jun 12, 2016

    Remove 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 More
  • Backup SQL Server databases with T-SQL

    Mar 15, 2016 t-sql sql-server sql

    1DECLARE @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 More
  • Knockout binding to JavaScript-dates and moment-formatting

    Oct 22, 2015

    Data-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 More
  • NHibernate Lazy loading and JSON

    Oct 20, 2015 linq nhibernate sql

    Nä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 More
  • Regex 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 More
  • Chocolatey and Boxstarter

    Jul 8, 2015 windows powershell boxstarter chocolatey

    Download 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
    • ««
    • «
    • 1
    • 2
    • 3
    • »
    • »»

Recent Posts

  • Ubuntu Home Assistant Docker
  • Extract .pem and .key from .pfx certificate for Swish
  • Docker and ASP.NET MVC
  • Ubuntu files backups Onedrive
  • node-red
  • VIM Simple Vim VSCode VsVim
  • git cheat sheet
  • Kentor Authservices

Tags

TFS 4 XML 3 BUILD 2 CI 2 CODE-FIRST 2 ENTITY-FRAMEWORK 2 GIT 2 JAVASCRIPT 2 LINQ 2 SNIPPETS 2 SQL 2 SQL-SERVER 2 SUBLIME-TEXT 2 T-SQL 2
All Tags
ASP.NET1 BATCH1 BOXSTARTER1 BUILD2 C#1 CHEATSHEET1 CHOCOLATEY1 CI2 CODE-COVERAGE1 CODE-FIRST2 COLOR1 DEBUG1 DESIGN1 ENTITY-FRAMEWORK2 GIT2 GROOVY1 IIS1 INDEX1 JAVASCRIPT2 JQUERY1 LINKS1 LINQ2 LOG1 MMC1 MVC1 NHIBERNATE1 OBJECT1 OPENCOVER1 OSX1 PERFMON1 PERFORMANCE1 POWERSHELL1 REPORTGENERATOR1 SNIPPETS2 SOAPUI1 SQL2 SQL-SERVER2 SUBLIME-TEXT2 T-SQL2 TDD1 TEST-COVERAGE1 TFS4 TOOLS2 VIM1 VISUAL-STUDIO2 VISUAL-STUDIO-ONLINE1 WCF1 WEB-DEPLOY1 WEB-SERVICE1 WEB.CONFIG2 WINDOWS1 XML3
[A~Z][0~9]
cederlof.net

Copyright  CEDERLOF.NET. All Rights Reserved