Skip to content

Instantly share code, notes, and snippets.

View elmer's full-sized avatar
:octocat:
exploring

Elmer Rivera elmer

:octocat:
exploring
View GitHub Profile
in puppet.conf add (not needed in recent puppet versions, 3.5+ or something):
cadir = $ssldir/ca { mode = 775 }
cacert = $cadir/ca_crt.pem { mode = 664 }
csrdir = $cadir/requests { mode = 775 }
signeddir = $cadir/signed { mode = 775 }
in apache site add (change /etc/puppet/ssl to your ssldir path):
# Add fixture lib dirs to LOAD_PATH. Work-around for PUP-3336
#
if Puppet.version < "4.0.0"
Dir["#{fixture_path}/modules/*/lib"].entries.each do |lib_dir|
$LOAD_PATH << lib_dir
end
end
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2009 The Authors
@elmer
elmer / gist:241140
Created November 23, 2009 15:56 — forked from anonymous/gist:161265
system admin 101
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }
@elmer
elmer / bundler-header.rb
Created March 18, 2010 22:56 — forked from leehambley/bundler-header.rb
bundle setup
begin
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
# Fallback on doing the resolve at runtime.
require "rubygems"
require "bundler"
Bundler.setup
end
@elmer
elmer / Tests Is Wrong
Created April 10, 2010 13:00 — forked from rtomayko/Tests Is Wrong
Why "require 'rubygems'"...
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
$projectroot = '/path/to/gitosis/repositories';
$gitosis_conf = '/path/to/gitosis/repositories/gitosis-admin.git/gitosis.conf';
$username = $cgi->remote_user;
$export_auth_hook = sub {
my $projectdir = shift;
if($projectdir =~ (/(.*?)\.git/)) {
my $projectname = basename($1);
open FILE, $gitosis_conf or die 'Could not open gitosis config file. Please make sure that $gitosis_conf is set properly';
my $project_match = 0;
my $user_match = 0;
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(function() {
MIN_ANSWERS = 2
MAX_ANSWERS = 10
MIN_ANSWERS_MSG = "Minimum of two(2) answers required."
MAX_ANSWERS_MSG = "Maximum of ten(10) answers only."
TOP_ANSWER_MSG = "Can't go up answer is on the top list."
#!/usr/bin/env bash
function manage_user()
{
user=$1
password=$2
shift; shift;
out=`ralsh user $user password='$password' ensure=present`
echo $out | grep 'notice.*changed password'