Skip to content

Instantly share code, notes, and snippets.

Networking + PowerShell + AWS

Tyler Applebaum tylerapplebaum

Networking + PowerShell + AWS
Block or report user

Report or block tylerapplebaum

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
tylerapplebaum / Sync-Documents.ps1
Created Oct 24, 2019
Robocopy wrapper to mirror directory to backup drive. Includes path validation.
View Sync-Documents.ps1
#Robocopy switches used:
#/MIR - mirror directory structure (including empty)
#/COPY:DT - excludes copying permissions
#/XA:H - excludes hidden files
#/W:5 - wait 5 seconds on a failure
#/XJD - exclude junction points
View Create-HiddenDirectories
ForEach ($Folder in @("Folder 1","Folder A","Folder A-Z")) {
New-Item -ItemType Directory -Path $DestDir -Name $Folder | Set-ItemProperty -Name Attributes -Value Hidden
tylerapplebaum / Remove-HTMLEncoding.ps1
Last active Nov 4, 2019
A fix for my wife's annoying CSV download issues :)
View Remove-HTMLEncoding.ps1
[Parameter(HelpMessage="Specify the path to the CSV file",Mandatory=$True)]
$FileName = Split-Path $CSVPath -Leaf
$FilePath = Split-Path $CSVPath
$FileNameArr = $FileName.Split('.')
$NewFileName = $FileNameArr[0] + "_fixed." + $FileNameArr[1]
tylerapplebaum /
Last active Aug 13, 2019
Bootstrap for Amazon Linux 2 EC2 instances
sudo yum install httpd
usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www
sudo systemctl restart httpd.service
sudo systemctl enable httpd.service
public_ipv4=$(curl -s "")
sudo echo $public_ipv4 > /var/www/html/public-ipv4.txt
cd /var/www/html
curl -O
View JtR_Notes.txt
.\zip2john.exe "C:\Users\derp\Downloads\" | Out-File C:\Users\derp\Downloads\Tester.hash -Encoding utf8
& type C:\Users\derp\Downloads\Tester.hash
.\john.exe C:\Users\derp\Downloads\Tester.hash
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 8 OpenMP threads
Proceeding with single, rules:Single
tylerapplebaum / Get-DirectoryInfo.ps1
Last active Oct 19, 2019
Identify directories with and without files
View Get-DirectoryInfo.ps1
Function Get-SubdirectoryInfo {
[Parameter(HelpMessage="Specify the top level directory to search")]
#Find subdirectories with files
$Items = Get-ChildItem $TopLevelDir | Where-Object Attributes -ne Directory | Select-Object DirectoryName,Name,Length
tylerapplebaum / Snippets.js
Created Jun 11, 2019
Chrome Dev Tools Utilities
View Snippets.js
// Paste these into the Developer Tools Console
// Calculate DNS lookup time in milliseconds
var pageNavArr = performance.getEntriesByType("navigation");
var pageResArr = performance.getEntriesByType("resource");
var pageArr = pageNavArr.concat(pageResArr);
pageArr.forEach(function(element) {
var dnsTime = element.domainLookupEnd - element.domainLookupStart;
if (dnsTime > 0) { // Don't display cached DNS entries
tylerapplebaum / index.html
Last active Aug 13, 2019
HTML5 and some light CSS. Useful for my AWS testing.
View index.html
<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AWS Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
body {background-color: AliceBlue;}
View gist:0a82343a53c34b6f0d27724154fbfabe
[Parameter(HelpMessage="Specify the path to the CSV file")]
[Parameter(HelpMessage="Specify one of OCHIN's supported drivers")]
[ValidateSet("HP LaserJet 4100 Series PCL6", "HP Universal Printing PCL 5 (v5.7.0)", "Kyocera TASKalfa 7551ci", "Sharp MX-3500N", "Xerox Global Print Driver PCL")]$Driver
You can’t perform that action at this time.