Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| # do it once | |
| seq 1 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
| # do it twice | |
| seq 2 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
| # do it 4 times, but at 2 a time | |
| seq 4 | parallel -n0 -j2 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
| # you can also put all your commands into a file |
| # After you run this query, it is necessary to cross reference against tax rates we have already sent FA, so get that list | |
| # Rohan or Josh | |
| unequal = [] | |
| subs = SubscriptionEngine::Subscription.active | |
| count = 0 | |
| # Compares sales tax rate on boarding file to current sales tax rate | |
| subs.each do |sub| | |
| count += 1 | |
| package_entry = SubscriptionEngine::FirstAssociatesPackageEntry.where(subscription_id: sub.id).last |
| yum update | |
| yum install epel-release | |
| yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase.x86_64 | |
| wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm | |
| rpm -Uvh erlang-solutions-1.0-1.noarch.rpm | |
| yum update | |
| yum install erlang | |
| cd /usr/local/lib | |
| git clone https://github.com/elixir-lang/elixir.git | |
| cd elixir |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| #!groovy | |
| import groovy.json.JsonOutput | |
| import groovy.json.JsonSlurper | |
| /* | |
| Please make sure to add the following environment variables: | |
| HEROKU_PREVIEW=<your heroku preview app> | |
| HEROKU_PREPRODUCTION=<your heroku pre-production app> | |
| HEROKU_PRODUCTION=<your heroku production app> |
| #!/usr/bin/env bash | |
| read -r -d '' usage << EOM | |
| Usage: | |
| gh-deploy-clone user/repo [ENVIRONMENT] | |
| EOM | |
| [ -z "$1" ] && echo && echo "$usage" && echo && exit 1 |
Let's say alice is a github.com user, with 2 or more private repositories repoN.
For this example we'll work with just two repositories named repo1 and repo2
https://github.com/alice/repo1
https://github.com/alice/repo2
You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.
You want to perform git pull origin master for example, and you want this to happen without asking for a password.
| #!/bin/bash | |
| # | |
| # this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe | |
| # mounted at /mnt. It should be run early on the first boot of the system. | |
| # | |
| # Beware, This script is NOT fully idempotent. | |
| # | |
| METADATA_URL_BASE="http://169.254.169.254/2012-01-12" |
| #!/bin/bash | |
| # Setup | |
| # | |
| # - Create a new Jenkins Job | |
| # - Mark "None" for Source Control Management | |
| # - Select the "Build Periodically" build trigger | |
| # - configure to run as frequently as you like | |
| # - Add a new "Execute Shell" build step | |
| # - Paste the contents of this file as the command |
| Jenkins Best Practices | |
| https://en.wikipedia.org/wiki/Continuous_integration<- Read this! | |
| https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Best+Practices | |
| http://www.slideshare.net/andrewbayer/7-habits-of-highly-effective-jenkins-users | |
| Set up version control of job configurations | |
| Keep jobs simple! Don't put a ton of bash in each job. If a job needs to do something complex, put it in a script in GitHub and check it out as needed. | |
| Use templated builders to simplify common tasks | |
| Keep all scripts in version control - avoid running scripts that live on the Jenkins server filesystem | |
| Don't install unnecessary plugins - plugins are often written by third parties and can interact with each other in strange ways | |
| Use LDAP authentication if possible for traceability - avoid anonymous access |