Skip to content

Instantly share code, notes, and snippets.

View austoonz's full-sized avatar

Andrew Pearce austoonz

View GitHub Profile
@potatoqualitee
potatoqualitee / getguid.ps1
Created December 28, 2021 12:32
Get GUID / Product Id / Registration ID from Windows Update EXE Executable
# Install WIX toolset
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.Compression.dll"
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\\Microsoft.Deployment.Compression.Cab.dll"
$cab = New-Object Microsoft.Deployment.Compression.Cab.Cabinfo "$home\Downloads\file\dotnet-sdk-5.0.404-win-x64_a943fac999a30b3eb83580112b793d37de0c0700.exe"
$cab.UnpackFile("0","C:\temp\0.xml")
$a = [xml](Get-Content "C:\temp\0.xml")
$guid = [guid]$a.BurnManifest.Registration.Id
@LawrenceHwang
LawrenceHwang / Set-TaskbarFontSize.ps1
Created October 14, 2021 04:57
Helper function to set the taskbar icon size
function Set-TaskbarIconSize {
# Sets the windows 11 task bar icon size. Default value is medium.
[CmdletBinding()]
param(
[validateset("small", "medium", "large")]
[string]$Size = "medium"
)
$sizeChart = @{
"small" = 0
"medium" = 1
@darko-mesaros
darko-mesaros / cloud9-repo.yml
Created May 26, 2020 05:43
Adds a repo to Cloud9 that is automatically cloned at startup
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
EnvName:
Type: String
Description: Enter the name for your IDE
Default: please-change-me
Resources:
Oblak9:
@darko-mesaros
darko-mesaros / github_cfn.yml
Created May 25, 2020 09:32
Creation of GitHub repositories via AWS CloudFormation
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
RepoName:
Type: String
Description: Enter the name for your repository
Default: please-change-me
Resources:
MyGitHubRepo:
@dbyr
dbyr / query.py
Last active June 5, 2024 17:14
A demonstration of a request to AWS's DynamoDB (in this case, a query) that does not use boto3. In benchmark tests this script outperforms boto3 in regards to time to complete a query.
import sys, os, base64, datetime, hashlib, hmac
import requests
import json
from typing import *
# based on the example python code found here:
# https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
# call this method to query all items for a given primary hash key in a table
# endpoint: the DynamoDB endpoint to query (for AWS servers, this is "https://dynamodb.{region}.amazonaws.com/")
@danilop
danilop / template.yaml
Last active February 29, 2024 12:50
Sample AWS SAM Template using Provisioned Concurrency with Application Auto Scaling
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Sample SAM Template using Application Auto Scaling + Provisioned Concurrency
Globals:
Function:
Timeout: 30
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
your-api
SAM Template for your API
Globals:
Api:
Cors:
@IISResetMe
IISResetMe / PSTextEncodingConverter.class.ps1
Created May 28, 2019 18:32
System.Text.Encoding converter to easy argument conversion
using namespace System.Management.Automation
using namespace System.Text
class PSTextEncodingConverter : PSTypeConverter {
hidden
[hashtable]
$ConversionTable = @{
'ASCII' = [System.Text.Encoding]::ASCII
'ANSI' = [System.Text.Encoding]::ASCII
@cgoering
cgoering / template.yaml
Created April 26, 2019 18:28
AWS Lambda memory usage metric in CloudFormation
CustomMetric:
Type: AWS::Logs::MetricFilter
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}
FilterPattern: '[str="REPORT", ..., str="Max", str="Memory", str="Used:", MaxMemoryUsed, str="MB"]'
MetricTransformations:
- MetricNamespace: Organization/Project/Service
MetricName: MaxMemoryUsed
MetricValue: $MaxMemoryUsed
@scrthq
scrthq / 1. SSM Document Example.ps1
Last active March 8, 2019 05:48
VaporShell Snippets
# Recreation of the example found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html
$ssmDocContent = [PSCustomObject]@{
schemaVersion = "1.2"
description = "Join instances to an AWS Directory Service domain."
parameters = @{
directoryId = @{
type = "String"
description = "(Required) The ID of the AWS Directory Service directory."
}