Skip to content

Instantly share code, notes, and snippets.


Trevor Sullivan pcgeek86

View GitHub Profile
pcgeek86 / linode-images.txt
Last active March 15, 2023 14:58
List of Linode virtual machine images, to use with Terraform CLI, as of March 2023
View linode-images.txt
pcgeek86 / main.go
Created August 26, 2022 11:39
Run External Command in Golang
View main.go
package main
import (
func main() {
// NOTE: mycmd will contain a byte array, not string output
mycmd, _ := exec.Command("ls", "-lGa", "/").Output()
pcgeek86 / sha3-american-top100-firstnames.json
Last active July 19, 2022 21:23
Words with SHA-3 256-bit and SHA-3 512-bit hashes
View sha3-american-top100-firstnames.json
"name": "James",
"hash_512": "02c56351888fa73ff825ffd65526b264ebefe7916fa5d8d5c58e766bfdd1de8e85b68bf12599b9d21eca6683d4abfa8616acfa6834e7c478e394374a7b015898",
"hash_256": "9621e7b29ee7509cb6140e96245ab956cdc3a9d474062ec4cd2af334cc179935"
"name": "Mary",
"hash_512": "1cfdb0f78ae767f055f1bc2bd7bb2f913e19419710c6969766ea2c43f1f56061403bb95853df6ae3fd3c263b631a8f0337a0977d7cc0464664d3b060b21f64c9",
"hash_256": "cdb285a9a3c1ab32647e27c94be4e525cbe8415079042bb0f8fb3ab1c88afef3"
pcgeek86 /
Last active November 22, 2021 17:01
Install MySQL Shell utility into MySQL official Docker container image
# Use these commands to install MySQL Shell utility into a container running
# the official MySQL distribution via Docker Hub.
# docker pull mysql:8.0.26
# export CONTAINER_ID=$(docker run --detach --env MYSQL_ROOT_PASSWORD=12345 mysql:8.0.26)
# docker exec --interactive --tty $CONTAINER_ID bash
apt update && apt-get install httpie --yes
# Use the Debian or Ubuntu package
pcgeek86 / build-aws-vpc.ps1
Last active July 20, 2021 16:32
2021-07-15 Use PowerShell Imperative Commands to Create EC2 VPC with Two Public Subnets and Two Private Subnets with Internet Access
View build-aws-vpc.ps1
- 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
function Add-EC2NameTag {
pcgeek86 / script.ps1
Created June 16, 2020 18:07
Use PowerShell PSTypeNames and custom FormatData to limit default properties emitted from objects
View script.ps1
$Object = [PSCustomObject]@{
FirstName = 'Trevor'
LastName = 'Sullivan'
$FormatData = @'
<?xml version="1.0" encoding="utf-8" ?>
pcgeek86 / email-domain-blacklist.txt
Created May 26, 2020 19:57
My personal list of blacklisted e-mail domains who have sent me spam.
View email-domain-blacklist.txt
pcgeek86 / AWS Cleanup.ps1
Last active March 7, 2022 20:34
AWS Cleanup script using PowerShell
View AWS Cleanup.ps1
Call this script:
foreach ($Region in (Get-AWSRegion).Region) {
Set-DefaultAWSRegion -Region $Region
iex (iwr
Get-LMFunctionList | Remove-LMFunction -Force
pcgeek86 / Get-YouTubeVideoRuntime.ps1
Created February 7, 2020 19:51
Retrieves your YouTube video run-time, in hours, using dependency-free PowerShell code
View Get-YouTubeVideoRuntime.ps1
$ErrorActionPreference = 'stop'
function Get-YouTubeChannel {
param (
[Parameter(Mandatory = $true)]
[string] $Username,
[Parameter(Mandatory = $true)]
[string] $AccessToken
pcgeek86 / Get-WavBitDepth.ps1
Created February 6, 2020 15:41
Get WAV file bit depth using PowerShell
View Get-WavBitDepth.ps1
# 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