Skip to content

Instantly share code, notes, and snippets.

View jeremypruitt's full-sized avatar
:octocat:
@ Waabi.ai

Jeremy Pruitt jeremypruitt

:octocat:
@ Waabi.ai
View GitHub Profile
@jeremypruitt
jeremypruitt / gist:d973fabe87c3a57a6d8c
Created September 27, 2014 22:10
Loop over AWS hosts in a jinja2 template with Ansible
{% for host in hosts['tag_Name_' + application.name + '-' + Version %}
IP: {{ hostvars[host] }}
{% endfor %}
<!DOCTYPE html>
<html lang="ja">
<head>
<title>AWS Javascript Browser SDK Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css">
<script src="//sdk.amazonaws.com/js/aws-sdk-2.0.16.min.js"></script>
</head>
<body>
@udondan
udondan / include_vars_merged
Last active June 15, 2023 17:57
Ansible action plugin "include_vars_merged". Same as "include_vars" but merges hashes instead of overriding

Why?

Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg. ansible/ansible#9116

This action plugin will merge hashes no matter how you have configured your hash_behaviour.

How to setup:

Save include_vars_merged.py to library/plugins/action/include_vars_merged.py

Save include_vars_merged to library/custom/include_vars_merged

@tkinz27
tkinz27 / file.ps1
Created September 25, 2014 04:27
ansible file.ps1
#!powershell
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@tkinz27
tkinz27 / copy.ps1
Created September 25, 2014 04:26
ansible copy.ps1
#!powershell
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ajfisher
ajfisher / _readme.md
Last active November 21, 2023 16:28
Auto WiFi detection and hotspot creation in boot for RPI

Auto WiFi detection or wifi hostpot creation during boot for RPI

Note: These are rough notes and there may be some variance as versions of raspbian get updated but should be pretty reliable as a guide.

This gist provides some instructions and config in order to have your Raspberry PI automatically connect to a roamed network, however if it fails to discover an available network it will set itself up as a wireless access point for you to connect to.

@stuartstevenson
stuartstevenson / jenkins-job-dsl.groovy
Created September 16, 2014 07:50
Jenkins job dsl with distributed job config files. The seed.groovy file scans stash repo branches for jenkins-job-dsl.groovy files and runs them centrally.
Closure job = {
// Job Name
name "${stashProjectKey}-${projectName}-${branchSimpleName}"
// Where should jenkins run the job
label ('master')
// Where should Jenkins get the source code from
scm {
git {
@hardyoyo
hardyoyo / Vagrantfile
Created September 5, 2014 16:11
Vagrant-DSpace with generic Vagrant-Cachier plugin set up for Maven, attempt 1
# -*- mode: ruby -*-
# vi: set ft=ruby :
####################################
# Vagrantfile for DSpace Development
#
# WARNING: THIS IS A WORK IN PROGRESS. IT DOES NOT YET FULLY INSTALL DSPACE VIA VAGRANT!
#
# DO NOT USE IN PRODUCTION. THIS IS FOR DEVELOPMENT/TESTING PURPOSES ONLY.
#
@julianeon
julianeon / apisender.rb
Created August 26, 2014 23:51
A script that creates an incident using the PagerDuty API.
#!/usr/bin/env ruby
subdomain="CHANGE_THIS"
api_key="CHANGE_THIS"
incident_key="SORIA82E"
endpoint="https://events.pagerduty.com/generic/2010-04-15/create_event.json"
service_access_key="a9c73c38e9cf4fa197802c7f2eb25b78"
subject="This is a check_cron alert. This service is not running."
@yuta-imai
yuta-imai / cognito-identity-sample.js
Last active August 29, 2015 14:05
The sample code for using CognitoIndentityCredentials to retrieve AWS Credentials.
//現状CognitoはUS_EAST_1にしか無いので一度こちらを設定
AWS.config.region = 'us-east-1';
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
AccountId: 'YOUR_AWS_ACCOUNT_ID',
IdentityPoolId: 'COGNITO_IDENTITIY_POOL_ID',
RoleArn: 'IAM_ROLE_ARN'
});
//その後、利用したいリージョンに設定を変更
AWS.config.region = 'ap-northeast-1';