Skip to content

Instantly share code, notes, and snippets.

View lkwg82's full-sized avatar

Lars K.W. Gohlke lkwg82

View GitHub Profile
ClientGetter playClientGetter = new ClientGetter() {
private int playPort;
private String playHost;
{
String portString = System.getenv("PLAY_PORT");
if (portString == null)
portString = "9000";
playPort = Integer.parseInt(portString);
playHost = System.getenv("PLAY_HOST");
@ambakshi
ambakshi / iam-assume-role.sh
Last active October 25, 2021 15:50
Assume an IAM role. An interesting way of doing IAM roles is to give the instance permissions to assume another role, but no actual permissions by default. I got this idea while setting up security monkey: http://securitymonkey.readthedocs.org/en/latest/quickstart1.html#setup-iam-roles.
#!/bin/bash
#
# Assume the given role, and print out a set of environment variables
# for use with aws cli.
#
# To use:
#
# $ eval $(./iam-assume-role.sh)
#
@kennym
kennym / blogspot_to_jekyll.rb
Created July 30, 2011 18:14
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@dsyer
dsyer / startup.md
Last active October 30, 2023 07:41
Notes on Spring Boot startup performance

Anatomy of Spring Boot Start Up Timing

When a Spring Boot app starts up with default (INFO) logging, there are some noticeable gaps (pauses). It's worth focusing on the gaps when looking for efficiency savings because of the amount of time they take, and because no-one bothered to log anything, so the chances are the app is doing something repetitive. We can tweak the logging levels to try and fill in the gaps and find out what is going on in there.

Basic empty web app with actuators has three such gaps:

0                                                                        1410ms
|------|---------------------------|-----|------|---------|--------|--------|
       |           578             |     |144(5)|         | 133(6) |
@woods
woods / gen-key-script
Last active March 12, 2024 12:00
Creating gpg keys non-interactively
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: root@handbook.westarete.com
Expire-Date: 0