Skip to content

Instantly share code, notes, and snippets.

View halfinhalfout's full-sized avatar

Doug Wilson halfinhalfout

View GitHub Profile
@halfinhalfout
halfinhalfout / bin_deploy-prod
Created April 24, 2020 17:31
ebs_snapshot_purge multi-region
#!/bin/bash
set -e
export AWS_PROFILE="ci-prod"
export STAGE_ENV="prod"
export CLOUDFORMATION_BUCKET="ci-cf-templates-prod-us-east-1"
./bin/deploy
export CLOUDFORMATION_BUCKET="ci-cf-templates-prod-us-east-2"
@halfinhalfout
halfinhalfout / gist:769195c19ddf6d3c2c2a4d09ca6a1e63
Created November 28, 2017 16:09
python script to test rabbitmq credentials
#!/usr/bin/env python
import socket
from kombu import Connection
host = "messaging.stage.cloud.customink.com"
port = 5672
user = "content_automation"
password = "REDACTED"
vhost = "/"
url = 'amqp://{0}:{1}@{2}:{3}/{4}'.format(user, password, host, port, vhost)
with Connection(url) as c:
@halfinhalfout
halfinhalfout / default.rb
Created May 19, 2017 15:12
re-order passenger settings to fix module_path
# Passenger Settings
override['passenger']['version'] = "4.0.60"
override['passenger']['root_path'] = "#{languages['ruby']['gems_dir']}/gems/passenger-#{passenger['version']}"
override['passenger']['module_path'] = "#{passenger['root_path']}/buildout/apache2/mod_passenger.so"
@halfinhalfout
halfinhalfout / s3_buckets.tf
Created May 18, 2017 21:22
failing terraform *bi-directional* Cross Region Replication of S3 buckets (Cycle: aws_s3_bucket.bucket, aws_s3_bucket.destination)
resource "aws_iam_role" "replication" {
name = "tf-iam-role-replication-12345"
assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
@halfinhalfout
halfinhalfout / apache_2.4_allow_all
Created May 11, 2017 16:17
new apache 2.4 syntax for allow_all access to dir
<Directory /opt/assisted_design/current/public>
AllowOverride None
Require all granted
</Directory>
@halfinhalfout
halfinhalfout / gist:99c36d29a46b27d98cd5859ae9917a1b
Last active March 6, 2017 21:14
terraform count start at 3
variable "instance_number" {
default = {
"0" = "03"
"1" = "04"
"2" = "05"
}
}
resource "aws_instance" "supplier_service" {
count = "3"
## directory structure
accounts
└ stage
└ variables.tf
└ us-east-1-prod
└ variables.tf
└ ...
modules
└ vpc
@halfinhalfout
halfinhalfout / p2.7.3.splitmount
Created March 24, 2015 20:17
pyton 2.7.3 and splitmount
root@fe09.staging.customink.com: ~: splitmount gfs01.staging.customink.com proof_images /root/proof_images
Traceback (most recent call last):
File "/usr/local/bin/splitmount", line 9, in <module>
load_entry_point('splitmount==0.1.1', 'console_scripts', 'splitmount')()
File "/usr/local/lib/python2.7/dist-packages/splitmount-0.1.1-py2.7.egg/splitmount/splitmount.py", line 53, in main
orig_vol = rpc.get_volfile(server, volume)
File "/usr/local/lib/python2.7/dist-packages/splitmount-0.1.1-py2.7.egg/splitmount/rpc.py", line 28, in cli_get_volfile
"system","getspec",volume])
File "/usr/lib/python2.7/subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
@halfinhalfout
halfinhalfout / portforwarding_kitchen_openvas
Created October 15, 2014 17:48
portforwarding_kitchen_openvas
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
# - name: centos-6.4
@halfinhalfout
halfinhalfout / gist:9332649
Created March 3, 2014 19:23
memcache hitrate 4 per
nagios_nrpecheck "memcached_hitrate" do
command "/home/nagios/scripts/nagios-plugin-memcached/check_memcached.pl -H localhost -p 11211 -R '<4','<4'"
action :add
end