Skip to content

Instantly share code, notes, and snippets.

@danielwegener
danielwegener / Jenkinsfile
Created January 23, 2017 13:18
Jenkinsfile docker template configuration for jenkins docker plugin
properties([
[$class : 'DockerJobProperty',
cleanImages : true,
dockerJobTemplate: [$class : 'DockerJobTemplateProperty',
cloudname: 'DockerHost-9',
// Supports other properties from https://git.io/vM5wf
template : [$class : 'DockerTemplate',
labelString : 'my-worker-label',
instanceCapStr : '4',
mode : 'EXCLUSIVE',
@joshgarnett
joshgarnett / main.tf
Created November 9, 2016 00:03
Minimal ECS Terraform Example
# Update your region
provider "aws" {
region = "${var.aws_region}"
}
resource "aws_ecs_cluster" "ecs_cluster" {
name = "test-cluster"
}
#
@umidjons
umidjons / connect-remote-mongo-via-ssh-tunnel.md
Last active December 12, 2022 07:24
Create ssh tunnel and connect to the remote mongo database on command line

Create ssh tunnel and connect to the remote mongo database on command line

Assume followings:

/mykeys/.ssh/prodserver.pem - is a certificate file

umid - is a user name

111.111.111.111 - is a remote host, that mongodb runs

@esquireofoz
esquireofoz / cloudfront_pop_locations.psv
Created September 29, 2016 12:41
AWS CloudFront POPs by City and Region
AMS1 | Amsterdam, The Netherlands | Europe
AMS50 | Amsterdam, The Netherlands | Europe
ARN1 | Stockholm, Sweden | Europe
ATL50 | Atlanta, Georgia | United States
ATL52 | Atlanta, Georgia | United States
BOM2 | Mumbai, India | India
BOM51 | Mumbai, India | India
CDG3 | Paris, France | Europe
CDG50 | Paris, France | Europe
DEL51 | Paris, France | Europe
@chrishoffman
chrishoffman / pki-setup.sh
Last active July 19, 2023 15:52
Vault Multi-Level CA Setup
vault mount pki
vault mount -path=pki1 pki
vault mount -path=pki2 pki
vault mount -path=pki3 pki
vault mount-tune -max-lease-ttl=87600h pki
vault mount-tune -max-lease-ttl=87600h pki1
vault mount-tune -max-lease-ttl=87600h pki2
vault mount-tune -max-lease-ttl=87600h pki3
vault write pki/root/generate/internal common_name="Vault Testing Root Authority" ttl=87600h
@dimitrovs
dimitrovs / dockerhost.sh
Last active September 17, 2017 20:36
Add the IP of a dockerhost to the /etc/hosts file of a Docker container if not already there.
#!/bin/bash
if [[ -z $(grep dockerhost /etc/hosts) ]]
then
echo `/sbin/ip route|awk '/default/ { print $3 }'` dockerhost >> /etc/hosts
fi
@trestletech
trestletech / instance-types.sh
Created June 15, 2016 16:41
Get all EC2 Instance Types in All Availability Zones
#!/bin/bash
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
while read -r region; do
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort)
while read -r az; do
#!/bin/bash -e
# Setup a Root CA in vault
# Generate and sign an Intermediate cert
#
# Requires:
# * A running vault server already initialzed and unsealed
# * Environment variable VAULT_TOKEN is set
# * vault cli (https://www.vaultproject.io)
# * httpie (https://github.com/jkbrzt/httpie)
#!/bin/bash
wget https://github.com/gravitational/teleport/releases/download/v0.2.0-beta.1/teleport-v0.2.0-beta.1-linux-amd64-bin.tar.gz
tar -xvzf teleport-v0.2.0-beta.1-linux-amd64-bin.tar.gz
cd teleport
sudo mkdir -p /opt/bin /opt/teleport
sudo cp -af build/* /opt/bin/
sudo cp -fr src/github.com/gravitational/teleport/web/dist/* /opt/teleport/