Skip to content

Instantly share code, notes, and snippets.

@danisla
danisla / docker-terraform.bash
Last active November 9, 2017 08:42
Terraform with Docker for Linux, OSX and Google Cloud Shell
function terraform()
{
if [[ -e ${HOME}/.config/gcloud/credentials.json ]]; then
GOOGLE_CREDENTIALS="$(cat ${HOME}/.config/gcloud/credentials.json | tr '\n' ' ')";
fi;
GOOGLE_PROJECT=${DEVSHELL_PROJECT_ID:-$(gcloud config get-value project 2>/dev/null)};
VERSION=latest
docker run -u "${UID}:${UID}" -it --rm -v ${HOME}:${HOME} --env-file <(env|awk '/^.+=/'|grep -v TMPDIR) -e GOOGLE_CREDENTIALS="${GOOGLE_CREDENTIALS}" -e GOOGLE_PROJECT="${GOOGLE_PROJECT}" -w $PWD hashicorp/terraform:${VERSION} $@
}
@danisla
danisla / nf_conntrack_no_hash_resize_preempt-3.16_3.16.43-2.patch
Created July 30, 2017 20:34
Kernel patch to disable nf_conntrack hash resize
--- a/net/netfilter/nf_conntrack_core.c 2017-04-04 21:21:58.000000000 +0000
+++ b/net/netfilter/nf_conntrack_core.c 2017-07-30 18:23:52.951182000 +0000
@@ -1611,6 +1611,12 @@
struct nf_conntrack_tuple_hash *h;
struct nf_conn *ct;
+#ifdef CONFIG_PREEMPT
+ /* Setting hashsize with PREEMPT kernel is not supported. */
+ printk("WARN: nf_conntrack_set_hashsize: not supported with PREEMPT kernel, skipping resize request to: %s", val);
+ return 0;
@danisla
danisla / kernel-upgrade.sh
Created July 28, 2017 15:23
Install PREEMPT kernel on GKE container-vm instance
sudo bash
sudo apt-get update && sudo apt-get install -y build-essential libncurses5-dev bc
mkdir kernel && cd kernel
curl -LO http://http.us.debian.org/debian/pool/main/l/linux/linux-source-3.16_3.16.43-2+deb8u2_all.deb
dpkg -i linux-source-3.16_3.16.43-2+deb8u2_all.deb
@danisla
danisla / spinnaker-local.yml
Last active April 4, 2017 02:22 — forked from viglesiasce/spinnaker-local.yml
Spinnaker local configuration
# This file is intended to override the default configuration in the
# spinnaker.yml file while providing guidance on the mostly likely
# configuration parameters to be changed.
#
# In order for Spinnaker to discover it, it must be copied to a file named
# "spinnaker-local.yml" and placed in the $HOME/.spinnaker directory.
global:
spinnaker:
timezone: 'America/Los_Angeles'
@danisla
danisla / aws.mk
Last active October 25, 2016 22:24
Makefile for AWS Networking
SHELL := /bin/bash
VPC_CIDR ?= 10.240.0.0/16
SUBNET_CIDR ?= 10.240.0.0/24
aws-vars:
ifndef AWS_DEFAULT_REGION
$(error AWS_DEFAULT_REGION is not set)
else ifndef AWS_ACCESS_KEY_ID
$(error AWS_ACCESS_KEY_ID is not set)

Keybase proof

I hereby claim:

  • I am danisla on github.
  • I am disla (https://keybase.io/disla) on keybase.
  • I have a public key ASBcCSEnN7aTEyZrErozduW2IP6qe4wNPuG-H2o88PuTTwo

To claim this, I am signing this object:

@danisla
danisla / startup.sh
Created May 4, 2015 01:50
Startup script for running daemon java process in docker and tail log file
#!/usr/bin/env bash
# Script to run a process that runs in the background,
# then tail the log file in the forground.
# Useful for running apps in Docker container like subsonic, spark or apache.
# Author: [email protected]
function cleanup {
kill `pidof tail` 2>/dev/null
kill `pidof java` 2>/dev/null