This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the following commands to bind/unbind SSL cert | |
# netsh http add sslcert ipport=0.0.0.0:443 certhash=3badca4f8d38a85269085aba598f0a8a51f057ae "appid={00112233-4455-6677-8899-AABBCCDDEEFF}" | |
# netsh http delete sslcert ipport=0.0.0.0:443 | |
$HttpListener = New-Object System.Net.HttpListener | |
$HttpListener.Prefixes.Add("http://+:80/") | |
$HttpListener.Prefixes.Add("https://+:443/") | |
$HttpListener.Start() | |
While ($HttpListener.IsListening) { | |
$HttpContext = $HttpListener.GetContext() | |
$HttpRequest = $HttpContext.Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Upload | |
&{ | |
$ErrorActionPreference = 'Stop' | |
$AWSRegion = "us-east-1" | |
$AWSAccessKeyId = "TODO: Access Key" | |
$AWSSecretAccessKey = "TODO: Secret Access Key" | |
$BucketName = "TODO: Bucket Name" | |
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.ShowDialog() | Out-Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
def parseCraigslistRssFeed(url): | |
listings = [] | |
xml = etree.parse(url) | |
channel = xml.getroot().find('{*}channel') | |
items = xml.getroot().findall('{*}item') | |
for item in items: | |
title = item.find('{*}title').text | |
desc = item.find('{*}description').text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&{ | |
# Configure Windows Explorer Options | |
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' | |
Set-ItemProperty $key Hidden 1 | |
Set-ItemProperty $key HideFileExt 0 | |
Set-ItemProperty $key ShowSuperHidden 1 | |
Set-ItemProperty $key AlwaysShowMenus 1 | |
Set-ItemProperty $key AutoCheckSelect 0 | |
Stop-Process -ProcessName explorer | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ServiceExe = "MyService.exe" | |
$ServiceName = "MyService" | |
$ServiceDisplayName = "MyService DisplayName" | |
$ServiceBinPath = [System.IO.Path]::GetFullPath($ServiceExe) | |
& sc.exe delete $ServiceName | |
& sc.exe create $ServiceName binPath= "`"$ServiceBinPath`"" DisplayName= "`"$ServiceDisplayName`"" | |
& sc.exe start $ServiceName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&{ | |
(New-Object System.Net.WebClient).DownloadFile( | |
"https://download.sysinternals.com/files/SysinternalsSuite.zip", | |
"$env:TEMP\SysinternalsSuite.zip") | |
$Shell = New-Object -com shell.application | |
$Zip = $Shell.NameSpace("$env:TEMP\SysinternalsSuite.zip") | |
New-Item -ItemType Directory -Force -Path "$env:ProgramFiles\SysinternalsSuite" | |
$Shell.Namespace("$env:ProgramFiles\SysinternalsSuite").CopyHere($Zip.Items()) | |
[Environment]::SetEnvironmentVariable( | |
"Path", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&{ | |
# Select PFX file dialog | |
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.Title = "Select SSL Certificate in PFX format" | |
$OpenFileDialog.Filter = "Personal Information Exchange (*.pfx)|*.pfx" | |
$OpenFileDialog.ShowDialog() | Out-Null | |
$PFXFile = $OpenFileDialog.FileName | |
# Get password dialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 1500 ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem C:\ -Recurse -ErrorAction 'silentlycontinue' | Where-Object {$_.Length -gt 100MB} | Sort-Object -Property Length -Descending | Select-Object -First 10 | Format-Table -AutoSize -Wrap -Property FullName,Length | Out-String -Width 4096 | Out-File "foo.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo -n "Enter the host name and press [ENTER]: " | |
read host | |
echo | openssl s_client -connect $host:443 2>/dev/null | openssl x509 -noout -text |
NewerOlder