Skip to content

Instantly share code, notes, and snippets.

View 40a's full-sized avatar

40a

View GitHub Profile
@40a
40a / AllowSSHFromIP.php
Created July 8, 2018 17:59 — forked from HSPDev/AllowSSHFromIP.php
Complementary code and IAM policy for "You don't need that Bastion host"
<?php
// For laravel 5 based systems
// /path/to/project/app/Console/Commands/AllowSSHFromIP.php
namespace App\Console\Commands;
use Aws\Ec2\Ec2Client;
use Carbon\Carbon;
use Illuminate\Console\Command;
@40a
40a / rabbitmq add user
Created July 5, 2018 13:20 — forked from tvlooy/rabbitmq.sh
RabbitMQ add user
rabbitmqctl add_user someuser somepass
rabbitmqctl set_user_tags someuser administrator
rabbitmqctl set_permissions -p / someuser ".*" ".*" ".*"
Enable admin:
rabbitmq-plugins enable rabbitmq_management
rabbitmqadmin list queues
@40a
40a / delete-dockerhub-images.sh
Created June 19, 2018 23:12 — forked from jriguera/delete-dockerhub-images.sh
Delete Docker images on DockerHub
#!/bin/bash
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
@40a
40a / dockerhub-v2-api-user.sh
Created June 19, 2018 22:44 — forked from kizbitz/dockerhub-v2-api-user.sh
Get the list of images and tags for a Docker Hub user account.
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all imagas and tags associated with a Docker Hub user account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username and password
UNAME=""
UPASS=""
@40a
40a / dockerhub-v2-api-user.sh
Created June 19, 2018 22:44 — forked from kizbitz/dockerhub-v2-api-user.sh
Get the list of images and tags for a Docker Hub user account.
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all imagas and tags associated with a Docker Hub user account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username and password
UNAME=""
UPASS=""
@40a
40a / dockerhub-v2-api-organization.sh
Created June 19, 2018 22:44 — forked from kizbitz/dockerhub-v2-api-organization.sh
Get the list of images and tags for a Docker Hub organization account
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
ORG=""
@40a
40a / redis-ha-manual-failover.md
Created May 28, 2018 13:31 — forked from micdenny/redis-ha-manual-failover.md
Redis - High Availability - Manual Failover

Waiting until the support for slave-read-only on StackExchange.Redis, I would like to share my solution to fail-over a node with a minimum write interruption, maintaining data consistency, reducing (eliminating?) possible false write acknowledgment (on the node that is failing). You can lose some write because there's a window where both nodes are slaves. I feel that you can still have some false write ack because you can receive an ack while setting the master as slave and that write could be lost.

redis-slaveof-kvs01.txt

MULTI
SLAVEOF kvs01 6379
CONFIG REWRITE
PUBLISH "__Booksleeve_MasterChanged" "*"
EXEC
@40a
40a / prometheus.yml
Created April 25, 2018 10:39 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@40a
40a / infra-secret-management-overview.md
Created April 16, 2018 13:16 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@40a
40a / jenkins-home-git.sh
Created April 11, 2018 13:25 — forked from cenkalti/jenkins-home-git.sh
Backup Jenkins home periodicallly with git.
#!/bin/bash
# Setup
#
# - Create a new Jenkins Job
# - Mark "None" for Source Control Management
# - Select the "Build Periodically" build trigger
# - configure to run as frequently as you like
# - Add a new "Execute Shell" build step
# - Paste the contents of this file as the command