Skip to content

Instantly share code, notes, and snippets.

variable "name" {
type = "string"
}
variable "vpc_id" {
type = "string"
default = "vpc-58a29221"
}
variable "region" {
@skuenzli
skuenzli / crashy.md
Last active January 4, 2018 15:37
Generate core files for crashed processes in containers

Overview

This is a simple demonstration of generating core files for crashing processes that happen to be containerized to a known location on CentOS 7.

Terminal 1 - Configure System and Run Process

Configure Linux kernel with a core pattern that puts files at a well-known location.

The location will be interpreted from the crashing process' perspective of file paths [1]

@skuenzli
skuenzli / peek-inside-one-modern-infra-dev-env.md
Last active August 10, 2017 15:18
Talk: Peek inside (one) modern infra development environment

Developing infrastructure code is challenging: quickly-changing tools, ever-higher quality expectations, and fluid teams.

What would life be like if your team had a containerized infra development environment supporting the development process by standardizing the tooling to build, test, and deploy infra code through the stages of the development lifecycle?

We will demonstrate and explore a simple open source project providing a portable infra development environment using Terraform, kitchen-terraform, and rspec. Patterns will be universal.

This talk will dive deeper into the 'Packaged Environment' pattern described at: https://www.qualimente.com/2017/01/17/simple-ways-to-start-using-docker/#Pattern_Packaged_Environment

@skuenzli
skuenzli / plank-picker.sh
Last active April 23, 2017 00:10
A script to help pick the planks for the Giles baby room
#!/usr/bin/env bash
num_planks=${1:-1} #set default number of planks to pick to 1, specify whatever number you like as argument
declare -a colors=('white' 'natural' 'blue' 'red' 'gray' 'brown')
function pick_color(){
local color_idx=$(expr $RANDOM % ${#colors[@]})
echo "${colors[$color_idx]}"
}

Keybase proof

I hereby claim:

  • I am skuenzli on github.
  • I am skuenzli (https://keybase.io/skuenzli) on keybase.
  • I have a public key whose fingerprint is E1F8 1376 942A 8F6E DB51 6C6B 3A25 5F59 747F 3C64

To claim this, I am signing this object:

#!/usr/bin/env bash
set -e
docker-machine create --driver virtualbox docker-birthday
eval $(docker-machine env docker-birthday)
for image in hello-world alpine seqvence/static-site mhart/alpine-node python:2.7-alpine manomarks/worker redis:alpine postgres:9.4; do docker pull ${image}; done;
docker images
// the service that will be automatically injected
final NumberService numberService;
@Inject
public NumberActor(@Named("NumberService") NumberService numberService) {
this.numberService = numberService;
}
@Override
public void onReceive(Object message) throws Exception {
class NumberController {
static final FiniteDuration DURATION_3_SECONDS = FiniteDuration.create(3, TimeUnit.SECONDS)
static final TIMEOUT_3_SECONDS = Timeout.durationToTimeout(DURATION_3_SECONDS)
ActorSystem actorSystem //actorSystem is injected by Spring via standard Grails behavior
def random() {
def requestId = UUID.randomUUID().toString()
@Override
public Actor produce() {
println "produce() called for actorBeanName: ${actorBeanName}"
return (Actor) applicationContext.getBean(actorBeanName);
}
/**
* Create a Props for the specified actorBeanName using the
* SpringActorProducer class.
*
* @param actorBeanName The name of the actor bean to create Props for
* @return a Props that will create the named actor bean using Spring
*/
public Props props(String actorBeanName) {
return Props.create(SpringActorProducer.class, applicationContext, actorBeanName);
}