-
Create new cookbook example
knife cookbook create example
-
Create file name foo.py, Open Editor for examples/files/default/foo.py
#!/usr/bin/python # Author: Sanjay Lokhande <sanjay.lokhande@opexsoftware.com>
import os
#!/usr/bin/env ruby | |
# @Author: Ravi Bhure <ravibhure@gmail.com> | |
require 'chef/cookbook/metadata' | |
metadata_file = ARGV.first || 'metadata.rb' | |
# read in metadata | |
metadata = Chef::Cookbook::Metadata.new | |
metadata.from_file(metadata_file) |
Create new cookbook example
knife cookbook create example
Create file name foo.py, Open Editor for examples/files/default/foo.py
#!/usr/bin/python
# Author: Sanjay Lokhande <sanjay.lokhande@opexsoftware.com>
import os
#!/bin/bash | |
# Author: Ravi Bhure <ravibhure@gmail.com> | |
# Date: 13/10/2014 | |
# This script dumps a "orders" database, compresses, encrypts and timestamps it, then saves it to netapp storage local mount. Ideal for a cronjob. | |
# It uses symmetric encryption, so guard your password carefully. | |
# | |
# NOT RECOMMENDED FOR LARGE DATABASES! | |
# Set your variable.. | |
my_server=db.example.com |
#!/bin/bash | |
# Installing elasticsearch from source | |
# https://gist.github.com/rajraj/1556657#file-es-sh | |
# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.2.tar.gz | |
cd ~ | |
sudo yum -y install java-1.7.0-openjdk | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.1.zip | |
unzip elasticsearch-0.90.1.zip |
# time sh gibench.sh | |
dir=gitemp | |
rm -rf $dir &> /dev/null | |
mkdir $dir | |
cd $dir | |
for (( c=1; c<=5000; c++ )) | |
do | |
mkdir $c | |
cd $c |
Chef Metal now supports LXC! All the benefits of Metal, including idempotent, versioned, reusable cluster definitions can be realized. You can use LXC containers for testing, or you can use them as a part of your application stack. You can now write a Metal recipe like so:
chef-metal is still alpha software. People are experimenting with it and contributing to it, but it is still evolving.
require 'chef_metal_lxc'
As Chef Metal approaches 1.0, we've landed a huge configuration and driver interface improvement intended to enable:
Herein I want to talk about the Driver interface and how it is used by provisioning programs like the machine resource or kitchen, and driver implementors.
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?
#!/usr/bin/perl | |
# HAProxy Performance Statistics | |
# by Steve Kamerman | |
# | |
# To use, pipe your HAProxy log with timing information (like "0/0/1/1/3 200") to | |
# this script. It will output min, max, med, avg and a latency distribution graph. | |
# | |
# Info on timing logging in HAProxy: http://code.google.com/p/haproxy-docs/wiki/TimingEvents | |
# |