Skip to content

Instantly share code, notes, and snippets.

View aidansteele's full-sized avatar
🏠
Working from home

Aidan Steele aidansteele

🏠
Working from home
View GitHub Profile
From 6eea25f98c361458e2840b03cea256f8a4e790fa Mon Sep 17 00:00:00 2001
From: Aidan Steele <[email protected]>
Date: Fri, 3 Jul 2015 09:58:37 +1000
Subject: [PATCH] change
---
compile.c | 13 ++++++++++---
load.c | 16 ++++++++++++++++
2 files changed, 26 insertions(+), 3 deletions(-)
import maker
import streams
makeFormat(MachData):
f(firstField, int32, default: 4)
f(secondField, string, length: firstFiend)
f(thirdField, string, length: firstField + 6, value: abc)
let s = "\x05\x00\x00\x00abcxxxdefxxx"
let stream = newStringStream(s)
@aidansteele
aidansteele / Dockerfile
Last active August 29, 2016 10:39
perfect template
FROM swiftdocker/swift:latest
RUN sudo sed -i 's/archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y \
libcurl3-dev \
openssl \
uuid-dev
WORKDIR /app
def hockeyApiToken = '<elided>'
node('xcode8') { // node() is how we specify which build agent we want to run on
color {
stage('checkout') { // stage() is how we label parts of our pipeline. they can be visualised in the web ui.
checkout scm // we have to pull our code down from git first!
}
stage('bundler') {
// we use ruby's bundler to ensure our versions of cocoapods and fastlane are correct
@aidansteele
aidansteele / Program.cs
Created October 26, 2016 05:01
docker shell shenanigans
using System;
using System.Diagnostics;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
var startInfo = new ProcessStartInfo {
# escape=`
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command"]
RUN Set-ExecutionPolicy -ExecutionPolicy Bypass
ENV chocolateyUseWindowsCompression false
RUN iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
RUN choco feature enable -n allowEmptyChecksums
RUN choco install -y -r nuget.commandline
@aidansteele
aidansteele / automation.yml
Created September 4, 2017 00:21
aws-updatewindowsami in yaml
---
schemaVersion: '0.3'
description: Updates a Microsoft Windows AMI. By default it will install all Windows
updates, Amazon software, and Amazon drivers. It will then sysprep and create a
new AMI. Supports Windows Server 2008 R2 and greater.
assumeRole: "{{ AutomationAssumeRole }}"
parameters:
SourceAmiId:
type: String
description: "(Required) The source Amazon Machine Image ID."
MacBookPro2017:linkerd aidan$ time ./sbt compile
Getting org.scala-sbt sbt 0.13.16 ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.16/jars/sbt.jar ...
[SUCCESSFUL ] org.scala-sbt#sbt;0.13.16!sbt.jar (5481ms)
downloading https://jcenter.bintray.com/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.jar ...
[SUCCESSFUL ] org.scala-lang#scala-library;2.10.6!scala-library.jar (2939ms)
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.16/jars/main.jar ...
[SUCCESSFUL ] org.scala-sbt#main;0.13.16!main.jar (6141ms)
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.16/jars/compiler-interface.jar ...
[SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.16!compiler-interface.jar (5975ms)
@aidansteele
aidansteele / sort_ecs_tasks_by_mem.py
Created February 27, 2018 22:11
sort ecs tasks in a cluster by memory reservation
#!/usr/bin/env python3
import boto3
import json
import sys
import os
import itertools
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
@aidansteele
aidansteele / userdata.sh
Created March 26, 2018 07:58
userdata to use nvme disk for docker instead of ebs
set -euxo pipefail
service docker stop
vgextend docker /dev/nvme0n1
lvremove -f /dev/docker/docker-pool
vgreduce docker /dev/sdcz1
lvcreate -T docker -n docker-pool -L 200G
lvcreate docker -n scratch -L 200G
mkfs.ext4 -E nodiscard /dev/docker/scratch
mkdir /mnt/scratch