This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:
main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
| - action: ec2_facts | |
| - apt: pkg=lvm2 state=present | |
| - apt: pkg=mdadm state=present | |
| - pip: name=boto state=latest | |
| - ec2_vol: instance="{{ hostvars[inventory_hostname]['ansible_ec2_instance-id'] }}" | |
| volume_size=20 | |
| device_name="{{ item }}" |
| #!/bin/bash | |
| CONSUL="localhost:8500" | |
| main() { | |
| case "$1" in | |
| info) | |
| curl -s "$CONSUL/v1/kv/$2" | jq -r .[] | |
| ;; | |
| get) |
| # This is an example of the Stack Exchange Tier 1 HAProxy config | |
| # The only things that have been changed from what we are running are: | |
| # 1. User names have been removed | |
| # 2. All Passwords have been remove | |
| # 3. IPs have been changed to use the example/documentation ranges | |
| # 4. Rate limit numbers have been changed to randome numbers, don't read into them | |
| userlist stats-auth | |
| group admin users $admin_user | |
| user $admin_user insecure-password $some_password |
| # | |
| # Makefile to perform "live code reloading" after changes to .go files. | |
| # | |
| # n.b. you must install fswatch (OS X: `brew install fswatch`) | |
| # | |
| # To start live reloading run the following command: | |
| # $ make serve | |
| # | |
| # binary name to kill/restart |
This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:
main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
| #!/bin/bash | |
| vault mount -path=rootpki pki | |
| vault mount-tune -max-lease-ttl="175200h" rootpki | |
| vault write rootpki/root/generate/exported common_name=example.com ttl="175200h" | |
| vault write rootpki/root/generate/internal common_name=example.com ttl="175200h" | |
| vault write rootpki/intermediate/generate/exported common_name=example.com ttl="175200h" | |
| vault write rootpki/intermediate/generate/internal common_name=example.com ttl="175200h" | |
| vault mount -path=intermediatepki pki | |
| vault mount-tune -max-lease-ttl="8760h" intermediatepki |
| #!/bin/bash | |
| function docker_run_shell { | |
| NAME=$1 | |
| DOCKERFILE=$2 | |
| # docker needs a few libraries, but not all - essential libs here | |
| BIND_LIBS=`ldd /usr/bin/docker | grep /lib/ | awk '{print $3}' | egrep '(apparmor|libseccomp|libdevmap|libsystemd-journal|libcgmanager.so.0|libnih.so.1|libnih-dbus.so.1|libdbus-1.so.3|libgcrypt.so.11)'` | |
| ARGS="" | |
| for LIB in $BIND_LIBS; do | |
| ARGS="$ARGS -v $LIB:$LIB:ro" |
| namespace Analogy | |
| { | |
| /// <summary> | |
| /// This example shows that a library that needs access to target .NET Standard 1.3 | |
| /// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
| /// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
| /// </summary>INetCoreApp10 | |
| class Example1 | |
| { | |
| public void Net45Application(INetFramework45 platform) |
| # Add this snippet to the top of your playbook. | |
| # It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
| # gwillem@gmail.com | |
| - hosts: all | |
| gather_facts: False | |
| tasks: | |
| - name: install python 2 | |
| raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
| package main | |
| /* | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define CK_BYTE_PTR unsigned char * | |
| #define CK_ULONG unsigned long long | |
| typedef struct CK_GCM_PARAMS { | |
| CK_BYTE_PTR pIv; | |
| CK_ULONG ulIvLen; |