Skip to content

Instantly share code, notes, and snippets.

@actionjack
actionjack / cf_create_or_update.py
Created August 14, 2019 14:51 — forked from svrist/cf_create_or_update.py
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore
@actionjack
actionjack / _nginx_docker_config.md
Created July 29, 2019 07:40 — forked from KostyaEsmukov/_nginx_docker_config.md
Nginx configuration sample for docker

Nginx production configuration sample

This config assumes that nginx is run from docker image _/nginx.

docker commands

docker network create nginx

mkdir -p /etc/myproject/nginx

cd /etc/myproject/nginx

@actionjack
actionjack / README.md
Created February 14, 2019 14:15 — forked from mllrjb/README.md
Jenkins init.groovy.d LDAP Authentication

Usage

Set LDAP_BIND_USER and LDAP_BIND_PASSWORD environment variables in the system (e.g. when creating your Docker container, etc).

@actionjack
actionjack / createashardedmongodbincosmosdb.sh
Created November 26, 2018 17:02 — forked from olandese/createashardedmongodbincosmosdb.sh
Create a sharded MongoDB in CosmosDB using the Azure CLI
#!/bin/bash
resourceGroupName="cosmosdbshardedtest"
name="mongodboncosmosdb"
databaseName="mongodb"
collectionName="mongodbcoll"
kind="MongoDB"
partition="/'\$v'/YourShardID/'\$v'"
az login
@actionjack
actionjack / fluent-filebeat-comparison.md
Created November 13, 2018 11:58 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
if (it =~ /deploy-to/) {
q.cancel(it.task)
}
}
@actionjack
actionjack / groovy.groovy
Created October 10, 2018 14:51 — forked from adampats/groovy.groovy
Jenkins groovy script to execute shell command
def cmd = 'hostname'
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = cmd.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println sout
@actionjack
actionjack / pr_etiquette.md
Created September 24, 2018 12:09 — forked from mikepea/pr_etiquette.md
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@actionjack
actionjack / README-oneshot-systemd-service.md
Created September 7, 2018 15:17 — forked from drmalex07/README-oneshot-systemd-service.md
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@actionjack
actionjack / pd-event.sh
Created July 17, 2018 08:41 — forked from alperkokmen/pd-event.sh
Simple script to trigger, acknowledge, and resolve incidents via PagerDuty Integration API.
#!/bin/bash
CONTENT_TYPE="application/json"
DESCRIPTION="bad things™ are happening"
URL="https://events.pagerduty.com/generic/2010-04-15/create_event.json"
if [ $# -ne 3 ]; then
echo "Usage: pd-event.sh [TYPE] [SERVICE KEY] [INCIDENT KEY]"
echo " - TYPE: [t]rigger | [a]cknowledge | [r]esolve"
echo " - SERVICE KEY: unique identifier for service"