Skip to content

Instantly share code, notes, and snippets.

View pcgeek86's full-sized avatar
🍺
🥓

Trevor Sullivan pcgeek86

🍺
🥓
View GitHub Profile
@pcgeek86
pcgeek86 / email-domain-blacklist.txt
Created May 26, 2020 19:57
My personal list of blacklisted e-mail domains who have sent me spam.
advidsdesign.cc
chinadesels.com
crazycybertech.info
fleek.co
joviasevilla.com
veganliftz.com
webpronews.com
@pcgeek86
pcgeek86 / gist:3842663d784f97c767d6ce57c1b2e41e
Last active March 18, 2020 22:44
WIP: Install Ultimaker Cura on ChromeOS v71 with Crostini (Linux apps) container support
# 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.
@pcgeek86
pcgeek86 / Get-YouTubeVideoRuntime.ps1
Created February 7, 2020 19:51
Retrieves your YouTube video run-time, in hours, using dependency-free PowerShell code
$ErrorActionPreference = 'stop'
function Get-YouTubeChannel {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $Username,
[Parameter(Mandatory = $true)]
[string] $AccessToken
)
@pcgeek86
pcgeek86 / Get-WavBitDepth.ps1
Created February 6, 2020 15:41
Get WAV file bit depth using PowerShell
# 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
@pcgeek86
pcgeek86 / workspaces.ps1
Created January 19, 2020 21:48
Create VPC, AWS Directory Service, and Amazon WorkSpace, using AWS PowerShell module
$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
body {
color: blue;
}
@pcgeek86
pcgeek86 / AWSStepFunctions-UserOnboarding.json
Created October 17, 2018 16:19
Very basic AWS Step Functions example for user on-boarding workflow
{
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Pass",
"Result": "Hello World!",
"Next": "ITSupport"
},
"ITSupport": {
"Type": "Parallel",
@pcgeek86
pcgeek86 / Update-AWSPowerShell-Module.ps1
Created December 21, 2017 22:49
Blog: Creates a launchd job that updates the AWS PowerShell .NET Core module on a daily basis.
<#
.Description
This PowerShell script will create and register a new launchd job that keeps the AWSPowerShell.NetCore module
up-to-date on your MacOS system.
If you receive an error upon registration, it's probably just because the service doesn't already exist.
This script tries to unload and reload the service, whether or not it exists, hence the error on initial run.
#>
$PListFile = @'
###############################################################################
# Author: Trevor Sullivan
#
# Date: October 28, 2009
#
# Lessons learned:
#
# 1. ADSI property names are lower case using DirectorySearcher or DirectoryEntry
# 2. Must explicitly cast 64-bit integers from AD
# 3. The Excel API is terrible (already knew that) #
@pcgeek86
pcgeek86 / Dockerfile
Created October 27, 2017 18:37
Install Python 3.6 and Boto3 package on Windows Server container
FROM microsoft/windowsservercore
MAINTAINER Trevor Sullivan <tsulli@amazon.com>
SHELL ["powershell", "-Command"]
ENV PYTHON_DOWNLOAD https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe
ENV PYTHON_FILE python-3.6.3-amd64.exe
COPY Install-Boto3.py c:/Amazon/