Skip to content

Instantly share code, notes, and snippets.

@stevepereira
stevepereira / initialize.pp
Created January 31, 2012 17:19 — forked from jperras/initialize.pp
Initialization puppet script for puppetmasterless puppet setup.
user { "git":
home => "/var/git",
ensure => present
}
file {
"/var/git":
ensure => directory,
owner => "git",
group => "git",
@stevepereira
stevepereira / README.md
Created October 23, 2012 01:42 — forked from silas/README.md
Vagrant and devstack

Download and install VirtualBox

Download and install Vagrant

Clone devstack repository

    git clone git://github.com/openstack-dev/devstack.git

Switch to devstack directory

worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
echo -ne $B"Do you have an existing key to use? (y/N) "$RESET; read REPLY
REPLY=${REPLY:-N}
case $REPLY in
Yes|Y|y )
PRIVATE_KEY_FILE=`pick_ssh_public_key`
;;
No|N|n|* )
echo -e $B"Creating ssh key"$RESET
if [[ -f $SSH_KEY_FILENAME ]]; then
echo -ne $R"Key ($SSH_KEY_FILENAME) already exists. Delete? (Y/n) "$RESET; read REPLY
@stevepereira
stevepereira / gist:5826918
Created June 20, 2013 21:39
Über-simple generic RHEL/CentOS init script Fill in the indicated bits, drop in /etc/rc.d/init.d/ , chmod +x, and away you go!
#!/bin/bash
# chkconfig: 2345 90 90
# description: program_name
### BEGIN INIT INFO
# Provides: program_name
# Required-Start: network
# Required-Stop: network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program
@stevepereira
stevepereira / elasticsearch.rb
Created July 4, 2013 18:38
ElasticSearch role example
name "elasticsearch"
description "Install and configure elasticsearch"
run_list(
"role[network]",
"role[yum]",
"recipe[java]",
"recipe[elasticsearch]"
)
default_attributes({
input {
file {
path => [ "/var/log/messages", "/var/log/kern.log" ]
type => "linux-syslog"
}
file {
path => "/var/log/apache2/access.log"
type => "apache-access"
}
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"
@stevepereira
stevepereira / gist:6288036
Created August 20, 2013 22:13
I have had this work in the past, but I've recently Berkshelfed all my recipes and I can't figure out why it doesn't work now.
[2013-08-20T22:07:58+00:00] INFO: Processing directory[/opt/logstash/beaver] action create (logstash::beaver line 61)
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver] created directory /opt/logstash/beaver
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver] owner changed to 997
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver] group changed to 997
[2013-08-20T22:07:58+00:00] INFO: Processing directory[/opt/logstash/beaver/etc] action create (logstash::beaver line 72)
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver/etc] created directory /opt/logstash/beaver/etc
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver/etc] owner changed to 997
[2013-08-20T22:07:58+00:00] INFO: directory[/opt/logstash/beaver/etc] group changed to 997
[2013-08-20T22:07:58+00:00] INFO: Processing directory[/var/log/logstash] action create (logstash::beaver line 72)
[2013-08-20T22:07:58+00:00] INFO: directory[/var/log/logstash] created directory /var/log/logst
@stevepereira
stevepereira / gist:6341582
Created August 26, 2013 13:47
Ansible deployment script
vars.yml:
---
project_name: myproject
project_root: /var/projects/myproject
project_repo: [email protected]:username/myproject.git
system_packages:
- build-essential
- git
- libevent-dev
- nginx