Skip to content

Instantly share code, notes, and snippets.

🕵️
Investigating a better artifact workflow

Jake Morrison techthoughts2

View GitHub Profile
@techthoughts2
techthoughts2 / route53.yml
Created Mar 22, 2019
Creates an Amazon Route 53 hosted zone
View route53.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an Amazon Route 53 hosted zone
Parameters:
DomainName:
Type: String
Description: The DNS name of an Amazon Route 53 hosted zone e.g. jevsejev.io
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-)
ConstraintDescription: must be a valid DNS zone name.
Resources:
DNS:
@techthoughts2
techthoughts2 / S3Site.yml
Created Mar 22, 2019
Creates an S3 bucket configured for hosting a static website, and a Route 53 DNS record pointing to the bucket
View S3Site.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an S3 bucket configured for hosting a static website, and a Route
53 DNS record pointing to the bucket
Parameters:
DomainName:
Type: String
Description: The DNS name of an existing Amazon Route 53 hosted zone e.g. jevsejev.io
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-)
ConstraintDescription: must be a valid DNS zone name.
FullDomainName:
@techthoughts2
techthoughts2 / StaticSite.yml
Created Mar 22, 2019
Resources for hosting a static website (generated with Hugo for example) on Amazon Simple Storage Service (S3) & CloudFront.
View StaticSite.yml
AWSTemplateFormatVersion: 2010-09-09
Description: >
Resources for hosting a static website (generated with Hugo for example) on
Amazon Simple Storage Service (S3) & CloudFront.
###############################################################################
Parameters:
###############################################################################
AcmCertificateArn:
View psParameters
#---------------------------------------------------------------
# Evaluating if a Parameter Set has been used
if ($PSCmdlet.ParameterSetName -eq 'InstanceId') {
$target = @{Key = 'instanceids'; Values = $managedInstanceId}
}
else {
$target = @{Key = "tag:$tagName"; Values = $TagValue}
}
#---------------------------------------------------------------
#controlling multiple dependencies of parameter choices example
View PSProfile
#_________________________________________________________________________________________
Write-Host "Initializing the Shell..." -ForegroundColor DarkCyan -BackgroundColor White
$global:sysvars = Get-Variable | Select-Object -ExpandProperty Name
$global:sysvars += 'sysvars'
$greetings =
'Welcome back Jake',
'Glad to see you Jake!',
'Happy coding Jake!',
View Microsoft.VSCode_profile
#Microsoft.VSCode_profile.ps1
Write-Host -ForegroundColor Gray ("Loading up the EditorServicesCommandSuite...")
try {
# Place this in your VSCode profile
Import-Module EditorServicesCommandSuite
Import-EditorCommand -Module EditorServicesCommandSuite
Write-Host "EditorServicesCommandSuite loaded." -ForegroundColor Magenta
}
catch{
Write-Host "Jake, EditorServicesCommandSuite has failed." -ForegroundColor DarkRed
View cfn_task
{
"version": "2.0.0",
"tasks": [
{
"label": "CF Resource List",
"type": "process",
"command": "chrome.exe",
"windows": {
"command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
},
@techthoughts2
techthoughts2 / install_python
Last active Feb 10, 2019
Chocolatey install of python on windows
View install_python
#from admin console window
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install python
#now setup for cf-lint
python -m pip install --upgrade pip
pip install cfn-lint
View Get-FreeDriveLetter
function Get-FreeDriveLetter {
$regex = "[A-Z]:"
$netuseOutput = net use
$driveArray = @()
$providers = Get-PSDrive -PSProvider FileSystem
$psdriveDriveLetters = $providers.Name
$driveArray += $psdriveDriveLetters
$netuseDriveLetters = ($netuseOutput | Select-String -Pattern $regex).Matches.Value
$netuseDriveLetters = $netuseDriveLetters -replace ':', ""
$driveArray += $netuseDriveLetters
@techthoughts2
techthoughts2 / git_commands
Last active Jan 5, 2019
Collection of Git Commands
View git_commands
git clone https://repo_address.git
git add .
git add --all
git commit -m "Initial commit"
git push origin master
git pull origin master
git config user.name "Jake"
You can’t perform that action at this time.