Skip to content

Instantly share code, notes, and snippets.

View lusis's full-sized avatar

John E. Vincent lusis

View GitHub Profile
@lusis
lusis / gateway-copier.sh
Created October 18, 2015 06:49
rundeck executor and copy scripts to access nodes behind nat in VPC
#!/bin/bash
# This script requires the following settings
# node attributes:
# file-copier: script-copy
# destdir: /tmp
# project properties:
# plugin.script-copy.default.command=/data/rundeck_scripts/gateway-copier.sh ${node.ssh-keypath} ${node.jumpNode_user} ${node.jumpNode} ${node.username} ${node.hostname} ${file-copy.destination} ${file-copy.file}
# plugin.script-copy.default.remote-filepath=${node.destdir}/${file-copy.filename}
KEYPATH=$1
shift
#Disk partitioning information
clearpart --all --initlabel
part /boot --fstype ext4 --size 512 --asprimary
part swap --size 1024
part pv.01 --size 1 --grow
volgroup sysvg pv.01
logvol / --fstype ext4 --vgname=sysvg --size=20000 --name=root
logvol /tmp --fstype ext4 --vgname=sysvg --size=5000 --name=temp
logvol /home --fstype ext4 --vgname=sysvg --size=10000 --name=home
logvol /var --fstype ext4 --vgname=sysvg --size=100000 --name=var
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1444712245000",
"Effect": "Allow",
"Action": [
"ec2:ModifyImageAttribute"
],
"Condition": {
@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@lusis
lusis / openldap_passwd.py
Last active September 11, 2015 18:02 — forked from rca/openldap_passwd.py
Python hashing and test functions for user passwords stored in OpenLDAP.
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
@lusis
lusis / conf.toml
Created August 20, 2015 00:47
sample config file idea
[modules.aws_backup]
enabled = false
[modules.aws_backup.options]
bucket = "sp-lb-backup"
encrypt = false
encryption_key = "s3kr1t!"
region = "us-east-1"
[modules.local_backup]
enabled = false
robot.respond /rundeck (?:ad[ -]?hoc) ([\w -_]+) ([\w-]+)/i, (msg) ->
name = msg.match[1]
params = { argString: "-nodename #{msg.match[2].trim().toLowerCase()}" }
query = "?#{querystring.stringify(params)}"
robot.authorize msg, rundeck.adminRole, ->
rundeck.jobs().run name, query, (job, results) ->
if job
» touch tmp.rb
» /opt/chefdk/embedded/bin/ruby -W2 -c tmp.rb
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/defaults/operating_system.rb:15: warning: method redefined; discarding old user_dir
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb:75: warning: previous definition of user_dir was here
Syntax OK
»
@lusis
lusis / ngx.log
Created December 11, 2014 14:48
etcd watch + nginx dynamic lbs
2014/12/11 14:45:28 [info] 11#0: [lua] etcd.lua:41: list(): 11 got initial listing, context: ngx.timer
2014/12/11 14:45:28 [info] 11#0: [lua] etcd.lua:74: wait(): 11 initial backends list: {
["/lbs/backends/node3"] = "1.1.1.4",
["/lbs/backends/node5"] = "1.1.1.5"
}, context: ngx.timer
2014/12/11 14:45:58 [info] 11#0: [lua] etcd.lua:87: wait(): 11 got an error: timeout, context: ngx.timer
2014/12/11 14:45:58 [info] 11#0: [lua] etcd.lua:92: wait(): 11 lock held for 0, context: ngx.timer
2014/12/11 14:45:58 [info] 11#0: [lua] etcd.lua:64: wait(): 11 got lock, context: ngx.timer
2014/12/11 14:46:03 [info] 11#0: [lua] etcd.lua:106: wait(): 11 got a response on watch, context: ngx.timer
2014/12/11 14:46:03 [info] 11#0: [lua] etcd.lua:109: wait(): 11 adding new backend: /lbs/backends/node6 [1.1.1.7], context: ngx.timer
@lusis
lusis / link_header.lua
Created December 6, 2014 04:29
Parsing the Link HTTP header with lpeg