Skip to content

Instantly share code, notes, and snippets.

@psprings
psprings / cft-windows-parsec.yaml
Last active February 8, 2021 06:47
cft-windows-parsec.yaml
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
License: Apache-2.0
Description: 'AWS CloudFormation Sample Template ELBGuidedAutoScalingRollingUpdates:
This example creates an auto scaling group behind a load balancer with a simple
health check. The Auto Scaling launch configuration includes an update policy that
will keep 2 instances running while doing an autoscaling rolling update. The update
will roll forward only when the ELB health check detects an updated instance in-service.
**WARNING** This template creates one or more Amazon EC2 instances and an Elastic
Load Balancer. You will be billed for the AWS resources used if you create a stack
@psprings
psprings / docker-compose-prep.sh
Last active October 17, 2017 15:18
Miniature Kafka stack for experimentation locally
RUNNING_MACHINE=$(docker-machine ls --filter state=running -q)
if [ ! -z "$RUNNING_MACHINE" ]; then
echo "$RUNNING_MACHINE"
eval "$(docker-machine env $RUNNING_MACHINE)"
docker-machine config $RUNNING_MACHINE || docker-machine regenerate-certs -f $RUNNING_MACHINE
docker_machine_ip_add="$(docker-machine ip $RUNNING_MACHINE)"
fi
function docker-machine-set() {
RUNNING_MACHINE=$($1 || $(docker-machine ls --filter state=running -q))
eval "$(docker-machine env $RUNNING_MACHINE)"
@psprings
psprings / SonarQube_API_gem.rb
Created August 5, 2016 14:57
Starting a SonarQube Gem. Will be splitting into multiple files/following gem structure soon.
module SonarQube
# Client for the SonarQube API
#
# @see http://docs.sonarqube.org/display/DEV/Web+API
class Client
attr_reader :host, :port, :api_endpoint, :api_token, :username, :password
attr_reader :host, :port, :api_endpoint, :api_token, :username, :password
def initialize(options)
options[:port] ||= 9000
@host = options[:host]
@psprings
psprings / RESULT.yml
Last active July 22, 2016 03:50
Wanted to get a list of Artifactory REST API calls that were available without the Pro version
---
BUILDS:
- name: All Builds
description: Provides information on all builds
usage:
method: GET
path: "/api/build"
- name: Builds Diff
description: Compare a build artifacts/dependencies/environment with an older build
to see what has changed (new artifacts added, old dependencies deleted etc).
@psprings
psprings / chef_data_bag_decrypt.rb
Last active July 28, 2016 16:13
Quick gist for sharing
require 'chef'
config_file ||= '/etc/chef/client.rb'
Chef::Config.from_file(config_file)
secret = Chef::EncryptedDataBagItem.load_secret(Chef::Config[:encrypted_data_bag_secret])
something = Chef::EncryptedDataBagItem.load('some_data_bag', 'some_item', secret)
puts something['sample_key']
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
@psprings
psprings / file1.txt
Created August 19, 2015 19:22
Created via API
Demo