Skip to content

Instantly share code, notes, and snippets.

View dhcgn's full-sized avatar

Daniel dhcgn

View GitHub Profile
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}
$header = @{
"__RequestVerificationToken"="511771675"
"Content-type"="text/xml"
}
$content = "<request><mode>1</mode></request>"
$result = Invoke-WebRequest -Uri 'https://192.168.8.1/api/device/mode' -Headers $header -Body $content -Method Post
$result.Content
-----BEGIN PGP PUBLIC KEY BLOCK-----
mJMEWjZ+qhMJKyQDAwIIAQENBAMElzH1RKwq/TAxn0Jqw5Z7Q7qsGqk5WH14enf3
C+0XabTSr2rFjRtiqEeZ1yCD416fUx5QSwsbaolHUNqd7gmBBz/evJy8pEH4osgy
7c8skKs9yh+TPSckPA+xoRWrW5o6fW6bmAyXVsccdPjn1Vr5g7WrPFqs+EDPnbOw
w/yShji0EWRoY2duQG1haWxib3gub3JniNYEExMKAD4WIQTKny4PQgy64gt4jap+
Ye/YtipvYQUCWjZ+qgIbAwUJACiuBgULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAK
CRB+Ye/YtipvYd6YAfsHfgzAKRHse9szClZ0JOLOMDQ/YZ2B42ddt0fgtqRsI4Qy
tSDHRvvAF7CvYYeijmAwHX6ClgySQIFZL/C8jpGEAf9nUcVVV7emB8A6DOV2z3Ez
AXXUK4SxF91zNLNwlyiPJV8xQfp6hkiTLe9F3yTRY7PCaxnLoTJZpwuqnHm7FGiy
@dhcgn
dhcgn / add_netwatch.rsc
Last active December 31, 2017 13:59
Send Mail zu PushOver Api in RouterOS (Mikrotik)
/tool netwatch
add comment="PushOver - Device XYZ" down-script=":local subject \"Mik\
rotik - Network Device\";\r\
\n:local body \"Device XYZ - New State is DOWN\";\r\
\n\r\
\n/tool e-mail\r\
\nset address=smtp.gmail.com\r\
\nset port=587\r\
\nset from=________@gmail.com\r\
\nset user=________@gmail.com\r\
PS C:\DEV\console\bin\RELEASE\netcoreapp2.0\linux-x64> tree /F
Auflistung der Ordnerpfade
Volumeseriennummer : 64D4-0233
C:.
│ console
│ console.deps.json
│ console.dll
│ console.pdb
│ console.runtimeconfig.dev.json
│ console.runtimeconfig.json
@dhcgn
dhcgn / Find-BoxCryptorCredentialsFromProcess.ps1
Last active July 8, 2018 10:02
Find-BoxCryptorCredentialsFromProcess.ps1
<#
.SYNOPSIS
Find the password with a hint in clear text from a runnung BoxCryptor instance
.DESCRIPTION
A proof that BoxCryptor stores the users credentails in clear text in memory.
System.Security.SecureString would be best practise.
You need to input the first chars of your password.
.NOTES
@dhcgn
dhcgn / cmds
Last active September 22, 2018 10:25
Homematic CCU3 (commands, init.d, cronetab, uname)
ReGaHss fc-scan lsusb setlgwkey.sh
ReGaHss.community fc-validate lz4 setlogcons
ReGaHss.normal fdflush lz4c setpriv
SetInterfaceClock fdformat lz4cat setserial
[ fdisk lzcat setsid
[[ fgrep lzma sfdisk
addgroup filan lzopcat sftp
adduser file mail-lock sh
agentxtrap filefrag mail-touchlock
@dhcgn
dhcgn / gist:44965387e581dfc893f6bb0f568b233d
Last active June 8, 2023 14:04
ipfs.service on ubuntu
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz
tar -zxvf ipfs-update_v1.5.2_linux-amd64.tar.gz
cd ipfs-update/
sudo sh ./install.sh
ipfs-update install latest
ipfs init --profile server
ipfs key gen --type=ed25519 --size=256 tools
wget https://download.sysinternals.com/files/SysinternalsSuite.zip
unzip SysinternalsSuite.zip -d SysinternalsSuite
@dhcgn
dhcgn / gist:7de68dc363c0f4d2a92a3d9aa3dccc16
Created October 12, 2018 08:44
Beyond Compare Filter for Visual Studio Solutions
-*.vspscc;-*.user;-*.vssscc;-\_ReSharper.Caches\;-\obj\;-\bin\;-\packages\;-\.vs\
var body = Microsoft.AspNetCore.WebUtilities.QueryHelpers.AddQueryString("", new Dictionary<string, string>()
{
{"token", "XXX"},
{"user", "XXX"},
{"title", ""},
{"message", ""},
});
body = body.Substring(1);
HttpContent content = new StringContent(body);