Skip to content

Instantly share code, notes, and snippets.

# File located at ${HOME}/.terraformrc
credentials "app.terraform.io" {
token = "xxxxx.xxxxxxxxx.xxxxxxxxxxxxxx"
}
@mike-ensor
mike-ensor / remote-state-query-provider-example.tf
Last active September 13, 2020 18:36
Sample of Terraform provider before Terraform Cloud implemented
# Providers
provider "google" { }
provider "random" { }
# Terraform configuration
terraform {
# FUTURE STATE
# =========================
# Cut-copy-pasted from the Workspace setup flow on Terraform Cloud
@mike-ensor
mike-ensor / encrypted-git-repo.md
Created August 31, 2020 18:48 — forked from polonskiy/encrypted-git-repo.md
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@mike-ensor
mike-ensor / colorize-maven.sh
Created February 22, 2012 03:55
Colorize Maven output
#!/bin/sh
# Written by Mike Ensor (mike@ensor.cc)
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
#
# To use:
# in your ".bashrc" or ".bash_profile" add the following line:
# source ~/<path to script>/colorize-maven.sh

Overview

This is a quick "how-to" built off of several other's blogs, twitter posts, gists and such. The goal is to create a workable environment for basic GCP (gcloud) development with VSCode.

Note

This installation process takes about 30-45 minutes each time a container is built from scratch (purely based on network performance, so could be faster or slower, this was my experience).

Steps

  1. Enable chromebook for development (https://github.com/lstoll/cros-crostini/blob/master/README.md)
  2. Run the script (vscode-gcloud-chromebook.sh) to setup VSCode + GCloud
  3. Create service account
@mike-ensor
mike-ensor / run-benchmark-tests.sh
Created December 29, 2016 19:54
This script will run benchmark tests in isolation.
mvn clean verify -Pbenchmark
@mike-ensor
mike-ensor / pom.xml
Last active December 29, 2016 19:39
<profile>
<id>benchmark</id>
<properties>
<maven.test.ITests>true</maven.test.ITests>
</properties>
<build>
<plugins>
<!-- Start application for benchmarks to test against -->
<plugin>
<groupId>org.springframework.boot</groupId>
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class SerializationBenchmark {
private RecipeService service;
private Recipe recipe;
private byte[] protoRecipe;
private String recipeAsJSON;
@SpringBootApplication
public class BenchmarkBase {
public static void main(String[] args) throws RunnerException, IOException {
Properties properties = PropertiesLoaderUtils.loadAllProperties("benchmark.properties");
int warmup = Integer.parseInt(properties.getProperty("benchmark.warmup.iterations", "5"));
int iterations = Integer.parseInt(properties.getProperty("benchmark.test.iterations", "5"));
int forks = Integer.parseInt(properties.getProperty("benchmark.test.forks", "1"));
@mike-ensor
mike-ensor / pom.xml
Last active December 29, 2016 18:24
add-jmh-dependencies
<dependencies>
<!-- Other libraries left out for brevity -->
<!-- jmh.version is the lastest version of JMH. Find by visiting
http://search.maven.org -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>