Skip to content

Instantly share code, notes, and snippets.

View sheldonhull's full-sized avatar
👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this

sheldonhull sheldonhull

👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this
View GitHub Profile
@sheldonhull
sheldonhull / README.md
Created June 9, 2021 17:20
[Python 3 Virtual Env Basics] quick example of using python3 venv to install tools and stuff in a self-contained virtual env in the current project directory #python #windows

Getting Started Tips for Windows & Terminal

  • don't use cmd prompt for anything, use PowerShell
  • install latest windows terminal from store, don't use default terminals, they are terrible and less featured.
  • Suggest installing PowerShell 7 as your normal windows base terminal to use.
  • Install Scoop to make this super easy to install. scoop install pwsh
  • Open pwsh (PowerShell 7) as your default in Terminal

Use Py

@sheldonhull
sheldonhull / azure-cli-pipelines.md
Last active March 25, 2024 20:04
[Azure Pipelines Link from CLI] configure a new pipline without having to do through browser #azurepipelines

Originally From colinsalmcorner

Example 10: Creating a YML Pipeline

To create a YML pipeline, you'll need a name as well as the repository, branch and path to the YML file within the repo (the path relative to the root path of the repo):

az pipelines create -p $ProjectName --org $orgUrl --name $PipelineName --description $PipelineDescription --repository $RepoName --repository-type tfsgit --branch master --skip-first-run --yml-path $YmlPath
@sheldonhull
sheldonhull / 01-diagram-vpc-example.py
Last active February 11, 2022 16:21
[Diagrams As Code] Paired with blog post, this is supporting code for generating diagrams via code #python #devops #cloud #aws #diagrams
import argparse, sys, os
from diagrams import Cluster, Diagram, Edge
from diagrams.aws.compute import ECS, Fargate,EC2
from diagrams.aws.network import (
VPC,
PrivateSubnet,
PublicSubnet,
InternetGateway,
)
from diagrams.aws.security import WAF
@sheldonhull
sheldonhull / main.go
Last active April 26, 2021 19:21
[Go Starter Template] For new projects, this gives logging and a nice testable structure based on blog posts by Matt Ryer #go #template
package main
import (
"errors"
"flag"
"fmt"
"io"
"os"
"strings"
"time"
@sheldonhull
sheldonhull / dev-setup.md
Last active April 26, 2021 18:55
[My macOS Dev Setup] My personal dev tools and favorite utilities over time #dev #tools

Everyday Usage

One-Off Utilities

Services

@sheldonhull
sheldonhull / Get-ImageAge.ps1
Last active March 19, 2021 01:02
[AWS.Tools.EC2 Evaluate Image Aging] aging by image #powershell #aws #awstools
#requires -Version 7 -Modules PSFramework, AWS.Tools.Common, AWS.Tools.EC2, ImportExcel
$ec2 = (Get-EC2Instance -InstanceId $InstanceIds).Instances
$Images = Get-EC2Image -ImageId $ec2.ImageId
$report = $ec2 | Select-PSFObject * -ScriptProperty @{
Name = @{
get = { $this.Tags.GetEnumerator().Where{ $_.Key -eq 'Name' }.Value }
}
ImageCreationDate = @{
get = {
@sheldonhull
sheldonhull / cases_test.go
Last active February 15, 2021 19:49
[exercism.io hamming distance] Solving Hamming distance problem on exercism.io #golang #puzzles #algorithms
‎‎​
@sheldonhull
sheldonhull / invoke-ssm-automation.tasks.ps1
Last active January 30, 2021 00:39
[Invoke-Build tasks] useful examples of InvokeBuild tasks to automate all things using AWS SDK or other #powershell
#Requires -Modules PowerShellHumanizer, AWS.Tools.Common, AWS.Tools.SimpleSystemsManagement, InvokeBuild
# Example of using InvokeBuild with Invoking an SSM Automation Document and waiting for a response
# Ideally this would be good to have in seperate functions, but for quick adhoc work this works well.
task ssm-test-aws-ssm-automation {
@(
'Aws.Tools.Common'
'AWS.Tools.SimpleSystemsManagement'
@sheldonhull
sheldonhull / install-ssm-agent.ps1
Last active January 27, 2021 20:55
[Install SSM Agent Manually on Windows] #aws #powershell #windows
# https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html
$ProgressPreference = 'SilentlyContinue'
Write-Host 'Downloading installer'
$InstallerFile = Join-Path $env:USERPROFILE 'Downloads\SSMAgent_latest.exe'
$invokeWebRequestSplat = @{
Uri = 'https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe'
OutFile = $InstallerFile
}
Invoke-WebRequest @invokeWebRequestSplat
@sheldonhull
sheldonhull / Dockerfile
Last active January 26, 2021 20:55
[mkdocs] My favorite dockerfile config for mkdocs with lots of cool plugins #mkdocs #markdown
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.141.0/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version: 3, 3.8, 3.7, 3.6
ARG VARIANT="3.8"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = 'true' ]; Then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi