I hereby claim:
- I am dhcgn on github.
- I am dhcgn (https://keybase.io/dhcgn) on keybase.
- I have a public key ASAnHmjKvQUr0KeI6M62iH50npaQA7HajANhF_hFcrf2jwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Net.Pkcs11Interop.Common; | |
using Net.Pkcs11Interop.HighLevelAPI; | |
using Net.Pkcs11Interop.HighLevelAPI.MechanismParams; | |
using NUnit.Framework; | |
namespace HsmTry | |
{ |
private const string LibraryPath = @"C:\Windows\System32\opensc-pkcs11.dll"; | |
public static byte[] Derive(string privateEc, string publicEc) | |
{ | |
Func<string, Session, CKO, ObjectHandle> getObjectHandle = (label, session, keyType) => | |
{ | |
var objectAttributes = new List<ObjectAttribute> | |
{ | |
new ObjectAttribute(CKA.CKA_CLASS, keyType), | |
new ObjectAttribute(CKA.CKA_LABEL, label), |
$homematicUrl = 'http://192.168.10.21:2001' | |
$body = @' | |
<?xml version="1.0"?> | |
<methodCall> | |
<methodName>listDevices</methodName> | |
</methodCall> | |
'@ | |
$response = Invoke-WebRequest -Uri $homematicUrl -Method Post -Body $body |
$homematicUrl = 'http://192.168.10.21:2001' | |
$destination = 'http://192.168.10.105:5050' | |
$interfaceId = '1' | |
$body = @' | |
<?xml version="1.0"?> | |
<methodCall> | |
<methodName>init</methodName> | |
<params> |
# http://stackoverflow.com/a/35089747 | |
# Solution 2: Delete installation cache | |
gci 'c:/programdata/package cache/' -Include *.msi,*.cab -Recurse | Remove-Item -Force | |
# Solution 3: Delete temporary file data stored on your computer | |
Resolve-Path "C:\Users\*\AppData\Local\Microsoft\VSCommon" | Remove-Item -Recurse -Force | |
Resolve-Path "C:\Users\*\AppData\Local\Microsoft\VisualStudio" | Remove-Item -Recurse -Force |
# First find the device | |
sudo fdisk -l | |
# Disk /dev/sdq: 372.6 GiB, 400088457216 bytes, 781422768 sectors | |
# Units: sectors of 1 * 512 = 512 bytes | |
# Sector size (logical/physical): 512 bytes / 512 bytes | |
# I/O size (minimum/optimal): 512 bytes / 512 bytes | |
# Disklabel type: dos | |
# Disk identifier: 0x00000000 |
$Path = $env:TEMP; ` | |
$Installer = 'chrome_installer.exe'; ` | |
Invoke-WebRequest 'http://dl.google.com/chrome/install/375.126/chrome_installer.exe' -OutFile $Path\$Installer; ` | |
Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; ` | |
Remove-Item $Path\$Installer |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace FileCopyAndHash |
gci *.png | Measure-Object Length -Sum | %{$_.Sum / 1kb} | |
# 8.402 kb | |
gci *.png | %{."C:\Program Files\ImageMagick-7.0.6-Q16\convert.exe" $_.FullName -strip $_.FullName } | |
gci *.png | Measure-Object Length -Sum | %{$_.Sum / 1kb} | |
# 9.665 kb | |
gci *.png | Measure-Object Length -Sum | %{$_.Sum / 1kb} |