Skip to content

Instantly share code, notes, and snippets.

View tylerapplebaum's full-sized avatar
☁️
AWS + Networking

Tyler Applebaum tylerapplebaum

☁️
AWS + Networking
View GitHub Profile
@tylerapplebaum
tylerapplebaum / Get-Traceroute.ps1
Last active April 21, 2024 09:08
MTR for Powershell
<#
.SYNOPSIS
An MTR clone for PowerShell.
Written by Tyler Applebaum.
Version 2.1
.LINK
https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2
http://www.team-cymru.org/IP-ASN-mapping.html#dns
@tylerapplebaum
tylerapplebaum / Create-HiddenDirectories
Created October 24, 2019 21:15
Create Hidden Directories
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
tylerapplebaum / Clear-RecentItems
Last active April 5, 2024 18:05
Remove recent files and jump list entries on Windows 10
Function Clear-RecentItems {
$Namespace = "shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}"
$QuickAccess = New-Object -ComObject shell.application
$RecentFiles = $QuickAccess.Namespace($Namespace).Items()
$RecentFiles | % {$_.InvokeVerb("remove")}
Remove-Item -Force "${env:USERPROFILE}\AppData\Roaming\Microsoft\Windows\Recent\*.lnk"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackDocs" -Value 0 -PropertyType DWORD
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackDocs"
@tylerapplebaum
tylerapplebaum / Add-TestUsers.ps1
Last active April 5, 2024 11:11
Create test users in Active Directory with realistic data from https://randomuser.me
<#
.SYNOPSIS
Create realistic-looking Active Directory accounts.
Written by Tyler Applebaum.
Version 0.2
Last Updated Jun 17 2020
.LINK
https://gist.github.com/tylerapplebaum/d692d9d2e1335b8b111927c8292c5dac
https://randomuser.me/
@tylerapplebaum
tylerapplebaum / UACBypass.inf
Last active March 27, 2024 19:42 — forked from api0cradle/CorpVPN.cmp
CMSTP.exe scripts and files
; No longer needed - embedded in script now
[version]
Signature=$chicago$
AdvancedINF=2.5
[DefaultInstall]
CustomDestination=CustInstDestSectionAllUsers
RunPreSetupCommands=RunPreSetupCommandsSection
[RunPreSetupCommandsSection]
@tylerapplebaum
tylerapplebaum / index.html
Last active June 15, 2023 20:13
HTML5 and some light CSS. Useful for my AWS testing.
<!DOCTYPE html>
<html lang=en>
<head>
<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">
<style>
body {background-color: AliceBlue;}
@tylerapplebaum
tylerapplebaum / Sync-Items.ps1
Created July 2, 2021 22:53
Sync items using a PowerShell wrapper around robocopy
#https://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx
#http://www.luisrocha.net/2008/12/robocopy-error-error-5-0x00000005.html
# 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
#/XD - exclude directory
@tylerapplebaum
tylerapplebaum / ffrouting-install.sh
Last active May 28, 2021 22:38 — forked from chriselsen/ffrouting-install.sh
FFRouting on Ubuntu 20.04
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
# Dependencies
sudo apt-get install -y \
git autoconf automake libtool make libreadline-dev texinfo \
pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
libc-ares-dev python3-dev libsystemd-dev python-ipaddress python3-sphinx \
install-info build-essential libsystemd-dev libsnmp-dev perl libcap-dev \
@tylerapplebaum
tylerapplebaum / Test-LDAPS.ps1
Last active August 14, 2020 13:25
Test LDAPS connection to AD DC
Function Test-LDAPS {
[CmdletBinding()]
param (
[Parameter(Mandatory=$True)]
[string]$ADServer
)
$LDAPS = "LDAP://" + $ADServer + ":636"
try {
$global:Connection = [ADSI]($LDAPS)
}
@tylerapplebaum
tylerapplebaum / VPC CLI.ps1
Created December 6, 2019 23:40
Create an AWS VPC with public, private IPv4 and IPv6 subnets, NAT GW, Internet GW, Egress-Only IGW, and all routes
#To-do
# Create security group for private subnet and allow ICMPv4, ICMPv6 and SSH from public subnet.
$SubnetIncrement = 1
$SubnetIPv4CIDR = "172.31.0.0/16"
$VPC = aws ec2 create-vpc --cidr-block $SubnetIPv4CIDR --amazon-provided-ipv6-cidr-block --region us-west-2 | ConvertFrom-Json | Select-Object -ExpandProperty Vpc
aws ec2 create-tags --resources $VPC.VpcId --tags Key=Name,Value=TFC-Study