Skip to content

Instantly share code, notes, and snippets.

View dustinmm80's full-sized avatar

Dustin Collins dustinmm80

  • Kansas City, MO
View GitHub Profile
@dustinmm80
dustinmm80 / secrets.yml
Created June 10, 2015 18:47
secrets.yml example for Summon
AWS_ACCESS_KEY_ID: !var prod/aws/iam/users/fabric/access-key-id
AWS_SECRET_KEY_ID: !var prod/aws/iam/users/fabric/secret-access-key
MONGODB_PASSWORD: !var prod/mongo/deployments/password
@dustinmm80
dustinmm80 / report.sh
Last active August 29, 2015 14:22
Reports from Conjur demos - WIP
#!/bin/bash
DEMO_NAME=$1
TAG_NAME="demo-factory/email"
INSTANCE_ID="`wget -qO- http://instance-data/latest/meta-data/instance-id`"
REGION="`wget -qO- http://instance-data/latest/meta-data/placement/availability-zone | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
TAG_VALUE="`aws ec2 describe-tags --filters "Name=resource-id,Values=${INSTANCE_ID}" "Name=key,Values=${TAG_NAME}" --region ${REGION} --output=text | cut -f5 | tr -d '\n'`"
URL="http://track.hubspot.com/v1/event?_n=000000294287&_a=402893&email=${TAG_VALUE}&_latest_demo_started=${DEMO_NAME}"
@dustinmm80
dustinmm80 / digitas-groups.rb
Last active August 29, 2015 14:25
Starter Conjur policy for Digitas groups
# conjur policy load --as-group security_admin digitas-policy.rb
# Create group 'devops', add user 'dustin' as an admin
devops = group '/devops' do
add_member user('/dustin'), admin_option: true
end
# Create group 'developers', add user 'katie' as a member
developers = group '/developers' do
add_member user('/katie')
@dustinmm80
dustinmm80 / host-factory-policy.rb
Created August 6, 2015 21:27
host-factory in policy
policy 'tomcat_policy' do
security_admin_group = group '/security_admin'
devops_group = group 'devops'
tomcat_hosts_layer = layer 'tomcat_hosts'
tomcat_factory = host_factory 'tomcat_factory',
:layers => [tomcat_hosts_layer],
:roleid => security_admin_group.roleid
@dustinmm80
dustinmm80 / variable_group_example_policy.rb
Last active August 29, 2015 14:27
Example of grouping variables in a Conjur policy
# List of created variables
dev_variables = [...]
# Creating a role of type 'variable_group' with name 'dev-variables'
dev_variables_group = role 'variable_group', 'dev-variables'
# Allow that role to execute the variables
dev_variables.each do |v|
v.permit 'execute', dev_variables_group
end
@dustinmm80
dustinmm80 / authn-ldap-readme.md
Last active September 4, 2015 17:39
User docs for Conjur authn-ldap connector

Conjur Authn-LDAP

Download v0.2.0

A Conjur authenticator which calls out to an external LDAP service to bind.

Configuration with environment variables

Slosilo key setup

@dustinmm80
dustinmm80 / jenkins-build-pipeline.css
Created September 29, 2015 21:15
Custom CSS for Conjur Jenkins build pipeline page
#side-panel {
width: 0;
}
#main-panel {
margin: 0;
}
@dustinmm80
dustinmm80 / gist:1758874
Created February 7, 2012 09:58
psycopg2 error
Traceback (most recent call last):
File "manage.py", line 20, in <module>
execute_manager(settings)
File "/home/dustin/env/INISMO/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/dustin/env/INISMO/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/dustin/env/INISMO/local/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/dustin/env/INISMO/local/lib/python2.7/site-packages/django/core/management/base.py", line 209, in execute
@dustinmm80
dustinmm80 / template.py
Created February 24, 2012 04:17
template tags
class ProfileTimezoneMiddleware(GlobalTimezoneMiddleware):
def get_tz(self, request):
if hasattr(request, 'user') and request.user.is_authenticated() and request.user.has_profile():
profile = request.user.get_profile()
return profile.timezone
return get_tz_from_request(request)
<div class="dealroom-message-timestamp alignright">{{ message.timestamp|to_global_tz|date:'H:i:s' }}</div>
(FOI_ORG)➜ foi_org git:(master) ✗ ./manage.py cms uninstall plugins SlideshowPlugin
Tue, 03 Jul 2012 13:51:31 root INFO Satchmo Started
Tue, 03 Jul 2012 13:51:31 root INFO Satchmo Started
Tue, 03 Jul 2012 13:51:32 configuration DEBUG Could not load default shipping module configuration: fedex_web_services
Tue, 03 Jul 2012 13:51:32 shop.listeners DEBUG Added default shop listeners
Tue, 03 Jul 2012 13:51:32 product.modules.downloadable.listeners DEBUG Added downnloadable product listeners
/Users/dustin/.virtualenvs/FOI_ORG/lib/python2.7/site-packages/django/contrib/localflavor/ca/ca_provinces.py:14: RuntimeWarning: There have been recent changes to the CA localflavor. See the release notes for details
RuntimeWarning
Tue, 03 Jul 2012 13:51:32 iterchoices DEBUG Management command: cms.management.commands.cms
Tue, 03 Jul 2012 13:51:32 iterchoices DEBUG Called model choices initialization function <shipping_choices>