Homebridge example file, Home Assistant and ffmpeg

{
   "bridge":{
      "name":"HomebridgeDocker",
      "username":"CC:22:3D:E3:CE:30",
      "port":51826,
      "pin":"031-45-154"
   },
   "description":"This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
   "accessories":[
 
   ],
   "platforms":[{
		"platform": "HomeAssistant",
		"name": "HomeAssistant",
		"host": "http://ha.domain.com:8123",
		"supported_types": ["automation", "binary_sensor", "climate", "cover", "device_tracker", "fan", "group", "input_boolean", "light", "lock", "media_player", "remote", "scene", "sensor", "switch"],
		"default_visibility": "hidden",
		"logging": false
	},
      {
         "platform":"Camera-IP",
         "cameras":[
            {
               "name":"Kamera1",
               "videoConfig":{
                  "source":"-re -i rtsp://Username:Password@192.168.10.23:554/Streaming/channels/102/",
                  "stillImageSource":"-i http://Username:Password13@192.168.10.23/Streaming/channels/1/picture",
                  "maxStreams":2,
                  "maxWidth":1280,
                  "maxHeight":720,
                  "maxFPS":30
               }
            },{
               "name":"Kamera2",
               "videoConfig":{
                  "source":"-re -i rtsp://Username:Password13@192.168.10.24:554/Streaming/channels/102/",
                  "stillImageSource":"-i http://Username:Password13@192.168.10.24/Streaming/channels/1/picture",
                  "maxStreams":2,
                  "maxWidth":1280,
                  "maxHeight":720,
                  "maxFPS":30
               }
            }
         ]
      }
   ]
}
Posted in Uncategorized | Comments Off on Homebridge example file, Home Assistant and ffmpeg

Windows Live Photo Gallery database location

%userprofile%\AppData\Local\Microsoft\Windows Live Photo Gallery

To clear the database, close the program and remove all files under here.

Posted in Windows | Comments Off on Windows Live Photo Gallery database location

Active Directory performance counters, Security System-Wide Statistics

Problem:
You cannot see the counterset “Security System-Wide Statistics” with powershell when you run the command Get-Counter -ListSet “Security System-Wide Statistics”

Or when you run the “Get-Counter “\Security System-Wide Statistics\Kerberos Authentications” you get “Internal performance counter API call failed. Error: c0000bb8”

Soloution:
Start powershell.exe with Run asAdministrator. The UAC prevents the ListSet from being displayed.

Posted in Active Directory, Performance | Comments Off on Active Directory performance counters, Security System-Wide Statistics

Autoenrollment is not working.

Problem:
Group Policy says that autoenrollment is switched on but the autoenrollment function is not working. None of your Root, Issuing or Machine certificates are enrolled.

If you try to trigger the autoenrollment process you get an error.
certutil -pulse
CertUtil: -pulse command FAILED: 0x80070002 (WIN32: 2)
CertUtil: The system cannot find the file specified.

Problem:
In som cases this is due to a folder missing. Check if the folder C:\Windows\System32\Logfiles\Scm exists. If not create it and restart the computer

 

Posted in PKI, Windows | Comments Off on Autoenrollment is not working.

Set proxy for machine account

netsh winhttp set proxy proxy.domain.com:8080 “*.domain.com;*.domain2.com”

Posted in Windows | Comments Off on Set proxy for machine account

Test network ports with Powershell

#Create socket object
$Socket = New-Object Net.Sockets.TcpClient
 
#Connect
$Socket.Connect("172.22.2.10", "8888")
 
#Check if connected
$Socket.Connected
 
#Close connection
$Socket.Dispose()
Posted in Network | Comments Off on Test network ports with Powershell

Base64 encoding with certutil

Encode
certutil -encode inputFileName encodedOutputFileName

Decode
certutil -decode encodedInputFileName OutputFileName

Posted in PKI | Comments Off on Base64 encoding with certutil

Smartcard – Force reading all certificates on smartcard

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider]
“ForceReadingAllCertificates”=dword:00000001 

Posted in PKI, Windows | Comments Off on Smartcard – Force reading all certificates on smartcard

Powershell Hash and Arrays

Two ways of making a table of hash tables and arrays.

#Alt1
$Array = New-Object System.Collections.ArrayList
#Foreach ()
{
	$Hash = New-Object -TypeName PSObject -Property @{
	    Status = "Ok"
	    DisplayName = "Test"
 
	}
$Array.Add($Hash) | Out-Null
Remove-Variable $Hash -ErrorAction SilentlyContinue
#} 
$Array | Out-GridView
 
 
#Alt2
$Array = New-Object System.Collections.ArrayList
$Hash = New-Object PSObject
#Foreach ()
#{
$Hash | Add-Member -NotePropertyName "Status" -NotePropertyValue "Ok"
$Hash | Add-Member -NotePropertyName "DisplayName" -NotePropertyValue "Test"
$Array.Add($Hash)
Remove-Variable Has -ErrorAction SilentlyContinue
#}
 
$Hash | Out-GridView
Posted in Powershell | Comments Off on Powershell Hash and Arrays

Powershell – Path and filename

[io.path]::GetFileNameWithoutExtension("c:\temp\myfile.txt")
[io.path]::GetDirectoryName("c:\temp\myfile.txt")
[io.path]::GetTempPath()
Some simple examples on how to get filename and folder out of a path with powershell and .Net

Posted in Powershell | Comments Off on Powershell – Path and filename