View build-aws-vpc.ps1
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
<# | |
- Creates an Amazon Web Services (AWS) Virtual Private Cloud (VPC) in the us-west-2 (Oregon) region. | |
- VPC contains two public subnets and two private subnets. | |
- NAT Gateway is created to handle outbount Internet traffic from private subnets. | |
- Internet Gateway is created to handle in/outbound Internet traffic for public subnets. | |
- iex (iwr https://gist.githubusercontent.com/pcgeek86/523b3b7c80eb25bd7f993354509268d0/raw).Content | |
#> | |
function Add-EC2NameTag { | |
<# | |
.Synopsis |
View gist:c4c48ed7589b3f6ffa2a8e5c05f9c429
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
#!/bin/bash | |
# Author: Trevor Sullivan <trevor@trevorsullivan.net> | |
# Install pip3 package manager for Python 3.x | |
sudo apt install python3-pip --yes | |
# Upgrade pip3 | |
sudo -H pip3 install --upgrade pip |
View script.ps1
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
$Object = [PSCustomObject]@{ | |
FirstName = 'Trevor' | |
LastName = 'Sullivan' | |
} | |
$Object | |
$Object.PSObject.TypeNames.Add('Person') | |
$FormatData = @' | |
<?xml version="1.0" encoding="utf-8" ?> |
View email-domain-blacklist.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
advidsdesign.cc | |
chinadesels.com | |
crazycybertech.info | |
fleek.co | |
joviasevilla.com | |
veganliftz.com | |
webpronews.com |
View gist:3842663d784f97c767d6ce57c1b2e41e
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
# Trevor Sullivan | |
# trevor@trevorsullivan.net | |
# I want to install Ultimaker Cura on ChromeOS, under the Crostini container environment. | |
# Cura is distributed officially as the Linux AppImage format, not a Debian package. | |
# Crostini doesn't support AppImage as of December 2018, due to dependency on FUSE, which isn't supported. | |
# Crostini is compatible with Debian packages. | |
# There is an Ubuntu Personal Package Archive (PPA) with Debian packages for Cura. | |
# However, Crostini starts as a Debian Stretch environment. | |
# The Cura package is only available for Debian Buster. |
View Get-YouTubeVideoRuntime.ps1
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
$ErrorActionPreference = 'stop' | |
function Get-YouTubeChannel { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] $Username, | |
[Parameter(Mandatory = $true)] | |
[string] $AccessToken | |
) |
View Get-WavBitDepth.ps1
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
# Create an empty Byte array, with a length of 1 byte | |
$Data = [System.Byte[]]::new(1) | |
# Open a FileStream to the specified file path | |
$Stream = [System.IO.File]::Open("$HOME/wav1.wav", [System.IO.FileMode]::Open) | |
# Seek to Byte 35 | |
$null = $Stream.Seek(34, [System.IO.SeekOrigin]::Begin) | |
# Read a single byte, from the current position, into the specified Byte array |
View workspaces.ps1
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
$ErrorActionPreference = 'Stop' | |
Install-Module -Name AWS.Tools.DirectoryService, AWS.Tools.EC2, AWS.Tools.WorkSpaces -Scope CurrentUser -Force | |
Update-AWSToolsModule | |
$VPC = New-EC2Vpc -CidrBlock 10.5.0.0/16 | |
$VPC |
View powershell-ansi-color.ps1
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) { | |
$Red = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255 | |
$Green = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255 | |
$Blue = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255 | |
Write-Host -Object ("$([char]27)[38;2;{0};{1};{2}mtrevor" -f $Red, $Green, $Blue) | |
} |
View test.css
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
body { | |
color: blue; | |
} |