This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: sample | |
hosts: localhost | |
tasks: | |
- name: create a directory to show ansible is working | |
file: | |
path: /tmp/created-by-ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: My Tomcat Server | |
location: my-first-location | |
services: | |
- type: 'TomcatServer' | |
brooklyn.config: | |
wars.root: >- | |
http://bit.ly/2dcaKIV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "eu-central-1" | |
} | |
resource "aws_s3_bucket" "bucket1" { | |
bucket = "alex-example1-bucket1" | |
acl = "private" | |
} | |
resource "aws_s3_bucket" "bucket2" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json > ec2-pricing.json | |
cat ec2-pricing.json | jq -r '.products[].attributes["instanceType"]' | sort -u | grep '\.' > instances | |
cat ec2-pricing.json | jq -c '[.products[].attributes] | [ .[] | select(.instanceType) | select(.location) | {location,instanceType} ] | group_by(.location) | [{ (.[][0].location): [ .[][].instanceType ] | unique }] | sort' > instance-by-region.json | |
cat instance-by-region.json | jq -r '[ .[] | to_entries | { (.[].key): .[].value | join(", ") } ] > instances-string-by-region.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for l in locations/* ; do | |
ENT=`xmlstarlet sel -t -v "location/locationConfig/callerContext/entityProxy" $l` | |
if [ ! -z "$ENT" ] ; then | |
if [ -z `find . -name $ENT` ] ; then | |
# it's a leak | |
LOC=`basename $l` | |
echo "Detected location $LOC has reference to deleted entity $ENT - removing it" | |
rm $l | |
FILES=`grep -l $LOC locations/*` | |
if [ ! -z "$FILES" ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# displays a summary list of commits in your current repo vs upstream branch and upstream master, | |
# and of working tree changes Added, Modified, Deleted, or not in index ("??") | |
THIS_COMMAND="$0 $@" | |
while true; do | |
case $1 in | |
-o|--offline) | |
OFFLINE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Function2 { int apply(int a, int b); } | |
int factorial(int n) { return applyFromOneToN(new Function2() { int apply(int a, int b) { return a*b; } }, n); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String urlBase = "https://HOSTNAME:8443"; | |
String subUrl = "/"; | |
String password = "PASSWORD"; | |
org.apache.http.client.HttpClient c = new brooklyn.util.http.HttpTool.HttpClientBuilder().https(true).trustAll() | |
.uri(urlBase) | |
.credentials(new org.apache.http.auth.UsernamePasswordCredentials( | |
"admin", password)).build(); | |
brooklyn.util.http.HttpToolResponse r = brooklyn.util.http.HttpTool.httpGet(c, java.net.URI.create( | |
urlBase+subUrl), null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brooklyn.catalog: | |
version: 0.1 | |
description: Sample VM with a demo script | |
name: Alex-AWS-VM-1 | |
location: | |
jclouds:aws-ec2: | |
region: eu-west-1 | |
osFamily: ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: chef-mysql-sample | |
location: | |
jclouds:aws-ec2:us-west-1: | |
minRam: 4gb | |
services: | |
- type: chef:mysql | |
... | |
provisioning.properties: | |
# this will override `minRam` set above | |
minRam: 5046mb |
NewerOlder