Skip to content

Instantly share code, notes, and snippets.

@actionjack
actionjack / gist:d6bf82324bbce267b8803e1a0bb51d94
Created August 22, 2019 08:12 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path
@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
Start-Date: 2018-11-19 14:23:29
Commandline: apt-get -y install less vim
Install: vim-common:amd64 (2:8.0.0197-4+deb9u1, automatic), vim-runtime:amd64 (2:8.0.0197-4+deb9u1, automatic), vim:amd64 (2:8.0.0197-4+deb9u1), xxd:amd64 (2:8.0.0197-4+deb9u1, automatic), libgpm2:amd64 (1.20.4-6.2+b1, automatic), less:amd64 (481-2.1)
End-Date: 2018-11-19 14:23:37
Start-Date: 2018-11-19 14:25:58
Commandline: apt-get remove vim
Remove: vim:amd64 (2:8.0.0197-4+deb9u1)
End-Date: 2018-11-19 14:25:59
@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.