apt-get install pv nginx-extras \
php-fpm php-gd php-mbstring php-cli php-mysql php-zip php-xml \
mariadb-server mariadb-client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scale out | |
resource "aws_cloudwatch_metric_alarm" "high-cpu-jenkins-slaves-alarm" { | |
alarm_name = "high-cpu-jenkins-slaves-alarm" | |
comparison_operator = "GreaterThanOrEqualToThreshold" | |
evaluation_periods = "2" | |
metric_name = "CPUUtilization" | |
namespace = "AWS/EC2" | |
period = "120" | |
statistic = "Average" | |
threshold = "80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- docker-compose.yml | |
jenkins: | |
build: . | |
restart: always | |
ports: | |
- "8080:8080" | |
- "5000:5000" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from __future__ import print_function | |
''' | |
analyze /proc/<pid>/smaps | |
doc | |
http://liutaihua.github.io/2013/04/25/process-smaps-analysis.html |
Random query recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Provide key uid from `gpg --list-keys` | |
# Based on: https://blog.tersmitten.nl/how-to-ultimately-trust-a-public-key-non-interactively.html | |
KEY_NAME="" | |
echo "$( \ | |
gpg --list-keys --fingerprint \ | |
| grep "${KEY_NAME}" -B 1 | head -1 \ | |
| tr -d '[:space:]' | awk 'BEGIN { FS = "=" } ; { print $2 }' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# AWS Instance Termination Notice Handler | |
# Based on: https://blog.fugue.co/2015-01-06-spot-termination-notices.html | |
while true; do | |
# get meta-data HTTP headers | |
HEADER=$(curl -Is http://169.254.169.254/latest/meta-data/spot/termination-time) | |
# HTTP 404 - not marked for termination | |
if [ -z $(echo $HEADER | head -1 | grep 404 | cut -d \ -f 2) ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Keeps latest X tags of every Docker Image | |
KEEP_IMAGES_BACK=2 | |
echo Retrieving local images available | |
# get all images | |
IMAGES=$(docker images | sort | awk '{print $1}' | uniq | grep -v "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph architecture { | |
rankdir=LR; | |
// Storage - #303F9F (dark blue) | |
node[fillcolor="#303F9F" style="filled" fontcolor="white"]; | |
database[label="DB"]; cache[label="Redis"]; | |
// Client-side Apps - #FFEB3B (yellow) | |
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"]; | |
front_end[label="Front-end App"]; extension[label="Browser Extension"]; |