Skip to content

Instantly share code, notes, and snippets.

View dsudduth's full-sized avatar
Building new products

Derek Sudduth dsudduth

Building new products
View GitHub Profile
@dsudduth
dsudduth / Makefile
Last active July 25, 2022 05:24
Makefile to create and publish Docker images to Amazon ECR
# This Makefile is a modified version of the Makefile created by M.Peter (https://gist.github.com/mpneuried)
# For the original, see: https://gist.github.com/mpneuried/0594963ad38e68917ef189b4e6a269db
# To use this Makefile, you need to ensure that the following dependencies are met.
# 1. You have a Dockerfile in the same directory as this Makefile.
# 2. You update the `APP_NAME` variable to match the name of your application.
# 3. You are running this in a Git repository. This is necessary to ensure that the correct version of the application is built.
APP_NAME := app-name
@dsudduth
dsudduth / create-json.ps1
Created August 22, 2021 21:13
Demonstrates how to generate a JSON document in PowerShell.
$AMI = "ami-56666777788889999"
$params = @{
parameters = @(
@{
name = '/AMI/RHEL8_AMI'
value = $AMI
}
)
}
@dsudduth
dsudduth / structured-logging.ps1
Last active July 29, 2021 18:14
An example of structured logging for PowerShell scripts.
<#
.SYNOPSIS
Demonstrates structured logging in PowerShell.
.DESCRIPTION
The PoShLog module provides a simple wrapper around Serilog; a well-known logger for .Net applications.
For more details, see https://github.com/PoShLog/PoShLog/wiki/Getting-started.
.NOTES
Version: 1.0.0
Author: Derek Sudduth
Creation Date: 2021-07-06
@dsudduth
dsudduth / aws_cdk_lambda_trigger_cloudtrail_api.py
Last active November 9, 2020 22:24
AWS CDK example for triggering a Lambda based on CloudTrail API event
from aws_cdk import aws_cloudtrail as cloudtrail
from aws_cdk import aws_events_targets as event_targets
from aws_cdk import aws_lambda as lambda_
from aws_cdk import core
class AlchemyStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
# Replace <search-term> with the package prefix.
pip freeze | grep <search-term> | xargs pip uninstall -y
@dsudduth
dsudduth / macos-bootstrap.sh
Last active June 8, 2020 18:53
Bootstrap script for macOS
#!/usr/bin/env bash
# OSX Bootstrap
# Note: to obtain logs, use the following when running this script.
# command | tee -a "$log_file"
set -e
VERSION="1.0.0"
HOMEBREW_INSTALLER_URL="https://raw.githubusercontent.com/Homebrew/install/master/install"
@dsudduth
dsudduth / README.md
Last active June 20, 2019 03:30
Jenkins - Deleting and Resetting build numbers.

Jenkins Build Delete and Reset

This script is really a fringe case. Use when you want to delete a range of build numbers and want to set the next number in the sequence.

@dsudduth
dsudduth / pycentos3.py
Created August 11, 2017 20:37 — forked from rakanalh/pycentos3.py
Install Python 3 on CentOS
#!/usr/bin/env python
"""
This script compiles and installs Python3 on your CentOS server.
Built based on the steps described by Digital Ocean (https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4)
"""
import os
import subprocess
@dsudduth
dsudduth / remoting.ps1
Created June 28, 2016 23:37 — forked from techniq/remoting.ps1
PowerShell remoting
Enable-PSRemoting
$creds = Get-Credential
Enter-PSSession -ComputerName [NAME] -Credentials $creds
Invoke-Command -ComputerName [NAME] -Credentials $creds { get-UICulture }
http://www.thecodeking.co.uk/2011/02/winrm-with-mixed-domain-environments.html
http://technet.microsoft.com/en-us/library/hh849707.aspx