Skip to content

Instantly share code, notes, and snippets.

View leepa's full-sized avatar

Lee Packham leepa

View GitHub Profile
@leepa
leepa / buildspec.yml
Last active March 8, 2024 20:15
A buildspec for CodeBuild... for cross platform building with buildx - enjoy :)
version: 0.2
phases:
install:
runtime-versions:
docker: 19
commands:
- docker version
- curl -JLO https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64
- mkdir -p ~/.docker/cli-plugins

SSO Sync

Helping you populate AWS SSO directly with your Google Apps users

Runs on any platform that Go can build for.

Why?

As per the AWS SSO Homepage:

const cluster = new bottle.BottlerocketCluster(this, 'Cluster');
const ami = ssm.StringParameter.valueForStringParameter(this, '/aws/service/bottlerocket/aws-k8s-1.15/x86_64/latest/image_id');
cluster.node.findAll().forEach(s => {
if (s instanceof asg.CfnLaunchConfiguration) {
const asg = s as asg.CfnLaunchConfiguration;
asg.imageId = ami;
}
});
import cdk = require('@aws-cdk/core');
import autoscaling = require('@aws-cdk/aws-autoscaling');
import ec2 = require('@aws-cdk/aws-ec2');
import eks = require('@aws-cdk/aws-eks');
import iam = require('@aws-cdk/aws-iam');
import fs = require('fs');
import path = require('path');
import { safeLoadAll, safeLoad } from 'js-yaml';
@leepa
leepa / pythondtrace-patch.diff
Created August 21, 2012 13:50
Python 2.7.3 dtrace patch from http://bugs.python.org/issue13405 - modified for Homebrew (had to remove one file)
diff -r 70274d53c1dd -r 56ac083c60dc Doc/library/debug.rst
--- a/Doc/library/debug.rst Mon Apr 09 19:04:04 2012 -0400
+++ b/Doc/library/debug.rst Tue Jul 03 03:19:10 2012 +0200
@@ -14,4 +14,5 @@
profile.rst
hotshot.rst
timeit.rst
- trace.rst
\ No newline at end of file
+ trace.rst
extern crate lambda_runtime as lambda;
#[macro_use]
extern crate log;
extern crate simple_logger;
extern crate serde_derive;
extern crate chrono;
use lambda::{error::HandlerError, lambda};
@leepa
leepa / s3.rs
Created December 5, 2018 12:00
Partial - this is the structure for S3 events
#[derive(Deserialize, Debug)]
struct S3Event {
#[serde(rename = "Records")]
#[allow(dead_code)]
records: Vec<S3EventRecord>,
}
#[derive(Deserialize, Debug)]
struct S3EventRecord {
#[serde(rename = "eventVersion")]
FROM amazonlinux:1
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.30.1
RUN set -eux; \
yum update -y ;\
yum install -y wget ;\
@leepa
leepa / symbolizecrashlog.sh
Created May 1, 2011 10:33
Probably the most important shell script for an iOS developer...
#!/bin/bash
AWK_SCRIPT=/tmp/symbolizecrashlog_$$.awk
SH_SCRIPT=/tmp/symbolizecrashlog_$$.sh
if [[ $# < 2 ]]
then
echo "Usage: $0 [ -arch <arch> ] symbol-file [ crash.log, ... ]"
exit 1
fi
Interval 10
LoadPlugin logfile
<Plugin logfile>
LogLevel debug
File STDOUT
Timestamp true
PrintSeverity true
</Plugin>