Skip to content

Instantly share code, notes, and snippets.

Jan-Henrik Damaschke itpropro

Block or report user

Report or block itpropro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View multiplePip.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"defaultValue": "proxyVm",
"metadata": {
"description": "Name of the VM"
}
View mostGitAdditions.ps1
$commitOffset = 1
$additionThreshold = 50
$commits = git diff HEAD HEAD~$commitOffset --numstat | ConvertFrom-Csv -Header 'Additions','Deletions','File' -Delimiter "`t"
$commits = $commits | ? {$_.Additions -ne '-' -and $_.Additions -ne '0'}
$commits | % { $_.Additions = [int]$_.Additions; $_.Deletions = [int]$_.Deletions }
$commits = $commits | ? {($_.Additions - $_.Deletions_) -gt $additionThreshold}
View hexoPostlist.ps1
hexo list post | sls '^(\d*-\d*-\d*)[ ]{2}([\w\s-_\\\/.,()]+?)[ ]{2,}([\w\s-_\\\/.,()]+?)[ ]{2,}([\w\s-_\\\/.,()]+?)([ ]{2,}([\w\s-_\\\/.,()]+?))*$' -allmatches | % {[array]$postList += [pscustomobject]@{'Date' = [DateTime]::Parse($_.matches.groups[1].value);'Title' = $_.matches.groups[2].value; 'Path' = $_.matches.groups[3].value; 'Categories' = $_.matches.groups[4].value; 'Tags' = $_.matches.groups[6].value }}
View UdpPortTest.ps1
$target = '8.8.8.8'
$udpPort = 53
$packetSize = 64
### Using UdpClient
[byte[]]$packet = [byte[]]::new($packetSize)
$udpClient = [System.Net.Sockets.UdpClient]::new()
$udpClient.Client.ReceiveTimeout = 1000
$ipEndPoint = [System.Net.IPEndPoint]::new([System.Net.IPAddress]::Any, 0)
View IcmpSocket.ps1
$socket = [System.Net.Sockets.Socket]::new([System.Net.Sockets.AddressFamily]::InterNetwork, [System.Net.Sockets.SocketType]::Raw, [System.Net.Sockets.ProtocolType]::Icmp)
View PsLogger.ps1
enum SyslogSeverity
{
Emergency = 0
Alert = 1
Critical = 2
Error = 3
Warning = 4
Notice = 5
Informational = 6
Debug = 7
View WriteToPipeline.ps1
# Test to write messages to current pipeline. Can be used when in other scope or runspace.
param($msg)
$runspace = [System.Management.Automation.Runspaces.Runspace]::DefaultRunspace
$command = 'Write-Verbose "{0}"' -f $msg
$runspace.CreateNestedPipeline($command, $false).Invoke()
View AdvancedPing.ps1
Class AdvancedPing
{
hidden [string]$_packets
hidden [string]$_duration
hidden [string]$_hostName
hidden [string]$_ip
hidden [int]$_bytes = 64
hidden [int]$_ttl = 57
hidden [int]$_timeout = 120
hidden [int]$_interval = 1000
@itpropro
itpropro / umlauts.ahk
Created Feb 10, 2019
Example shortcuts for german umlauts on en-us keyboards
View umlauts.ahk
SetTimer,UPDATEDSCRIPT,1000
UPDATEDSCRIPT:
FileGetAttrib,attribs,%A_ScriptFullPath%
IfInString,attribs,A
{
FileSetAttrib,-A,%A_ScriptFullPath%
SplashTextOn,,,Script was updated,
Sleep,500
Reload
}
@itpropro
itpropro / autohotkey_bruteforce.ahk
Created Feb 10, 2019
Example script, how to implement small (and of course slow) buteforce scripts with autohotkey
View autohotkey_bruteforce.ahk
SendMode Input
!z::
loop 26 {
i := Asc("a") + A_Index - 1
loop 26 {
j := Asc("a") + A_Index - 1
loop 26 {
k := Asc("a") + A_Index - 1
l := Chr(i)
m := Chr(j)
You can’t perform that action at this time.