AWS have released a new featue called CloudWatch Events, which lets you configure events fired by cloudwatch and direct them to SNS, Lambda functions, etc. Here's the blog post
Here's the motivational image:
| # Mathieu Blondel, February 2012 | |
| # License: BSD 3 clause | |
| # Port to Python of examples in chapter 5 of | |
| # "Introductory Statistics with R" by Peter Dalgaard | |
| import numpy as np | |
| from scipy.stats import ttest_1samp, wilcoxon, ttest_ind, mannwhitneyu | |
| # daily intake of energy in kJ for 11 women |
AWS have released a new featue called CloudWatch Events, which lets you configure events fired by cloudwatch and direct them to SNS, Lambda functions, etc. Here's the blog post
Here's the motivational image:
| #!/bin/bash | |
| set -x | |
| TERRAFORM_VERSION="0.9.11" | |
| PACKER_VERSION="1.0.2" | |
| # install pip | |
| pip install -U pip && pip3 install -U pip | |
| if [[ $? == 127 ]]; then | |
| wget -q https://bootstrap.pypa.io/get-pip.py |
| curl -XPOST http://localhost:9200/test/articles/1 -d '{ | |
| "content": "The quick brown fox" | |
| }' | |
| curl -XPOST http://localhost:9200/test/articles/2 -d '{ | |
| "content": "What does the fox say?" | |
| }' | |
| curl -XPOST http://localhost:9200/test/articles/3 -d '{ | |
| "content": "The quick brown fox jumped over the lazy dog" | |
| }' | |
| curl -XPOST http://localhost:9200/test/articles/4 -d '{ |
| curl -XDELETE http://localhost:9200/test/articles | |
| curl -XPUT http://localhost:9200/test/_mapping/articles -d '{ | |
| "properties": { | |
| "content": { | |
| "type": "string", | |
| "position_offset_gap": 100 | |
| } | |
| } | |
| }' |
| curl -XDELETE http://localhost:9200/blog | |
| curl -XPUT http://localhost:9200/blog -d '{ | |
| "settings" : { | |
| "index" : { | |
| "number_of_shards" : 1, | |
| "number_of_replicas" : 0 | |
| } | |
| }, | |
| "mapping": { |
| # The database recipe should be included by any server running a DB. It creates | |
| # a /data directory and, if on EC2, will mount an EBS volume here | |
| directory '/data' do | |
| mode '0755' | |
| end | |
| if node[:app][:ec2] || node[:cloud][:provider] == 'ec2' | |
| aws = data_bag_item('aws', 'main') | |
| include_recipe 'aws' |
| # Remove foreman | |
| yum remove remove foreman foreman-installer foreman-proxy | |
| rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs | |
| rm /etc/httpd/conf.d/foreman.conf | |
| # Remove puppet | |
| yum remove puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release | |
| rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet | |
| rm /etc/apache2/conf.d/puppet.conf |
| # knife cheat | |
| ## Search Examples | |
| knife search "name:ip*" | |
| knife search "platform:ubuntu*" | |
| knife search "platform:*" -a macaddress | |
| knife search "platform:ubuntu*" -a uptime | |
| knife search "platform:ubuntu*" -a virtualization.system | |
| knife search "platform:ubuntu*" -a network.default_gateway |
| require 'base64' | |
| require 'time' | |
| require 'digest/sha1' | |
| require 'openssl' | |
| require 'net/https' | |
| require 'json' | |
| class ChefAPI | |
| # Public: Gets/Sets the http object. |