Skip to content

Instantly share code, notes, and snippets.

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
@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)
View Set-WakeEnabled.ps1
function Set-WakeEnabled
{
<#
.SYNOPSIS
Set WoL on nic
Author: Jan-Henrik Damaschke (@jandamaschke)
License: BSD 3-Clause
Required Dependencies: None
View convertto-cidr.ps1
function convertto-cidr
{
[CmdletBinding()]
param
(
[parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]$netmask
)
$cidr = ''
foreach ($segment in $netmask.split('.'))
View Get-AvailableComObjects.ps1
function Get-AvailableComObjects {
$classesCom = ''
$classes = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SOFTWARE\\Classes').GetSubKeyNames()
[regex]::Matches($classes, '\w+\.\w+').Value | % {if ([Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("SOFTWARE\\Classes\\$_\\CLSID")) {$classesCom += "$_`r`n"}}
$classesCom.Replace("`r`n",' ').Split(' ') | Select-Object -Unique
}
View ServerManagerFeatures.ps1
$xmlpath = 'C:\Temp\DeploymentConfigTemplate.xml'
$features = New-Object -TypeName System.Collections.ArrayList
[xml]$xml = Get-Content $xmlpath
$xml.Objs.Obj.LST.Obj | ForEach-Object {$null = $features.Add($_.GetElementsByTagName('ToString').'#text')}
for ($i = 0; $i -lt $features.Count; $i++)
{
$features[$i] = $features[$i].Substring($features[$i].IndexOf('_') + 1).Replace('_','-')
}
$features
View DeploymentConfigTemplate.xml
<Obj RefId="29">
<TN RefId="9">
<T>Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/ServerManager/ServerComponent_RemoteAccess</T>
<T>Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/ServerManager/MSFT_ServerManagerServerComponentDescriptor</T>
<T>Microsoft.Management.Infrastructure.CimInstance#ServerComponent_RemoteAccess</T>
<T>Microsoft.Management.Infrastructure.CimInstance#MSFT_ServerManagerServerComponentDescriptor</T>
<T>Microsoft.Management.Infrastructure.CimInstance</T>
<T>System.Object</T>
</TN>
<ToString>ServerComponent_RemoteAccess</ToString>
View PullClientV2.ps1
[DscLocalConfigurationManager()]
Configuration PullClientV2 {
param(
[Parameter(Mandatory=$True)]
[String]$ConfigurationNames,
[Parameter(Mandatory=$True)]
[String]$Server
)
Settings
{
View RegisterFileCreationEvent.ps1
# When a document is created in D:\Test with the extension .rtf This script will print its name
Register-CimIndicationEvent -Query "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE
TargetInstance ISA 'CIM_DataFile' AND (TargetInstance.Drive='D:' AND TargetInstance.Path='\\Test\\' AND TargetInstance.Extension='rtf')" -Action {
Write-Host $($Event.SourceEventArgs.NewEvent.TargetInstance.Name)
}
View Get-NtSecurityDescriptor.ps1
function Get-NtSecurityDescriptor {
param
(
[string]$SecurityDescriptor
)
$ntsecdesc = New-Object Byte[] ($SecurityDescriptor.Length)
for ($i = 0; $i -lt $SecurityDescriptor.Length ; $i += 2) {
$ntsecdesc.Set(($i/2),([Byte]::Parse($SecurityDescriptor.Substring($i, 2), [System.Globalization.NumberStyles]::HexNumber)))
}
You can’t perform that action at this time.