Original text from http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html
From: Mark Jason Dominus <[email protected]>
Date: Jul 28, 2005 11:16 PM
Subject: Re: HOP -vs- SICP
#!/usr/bin/ruby -W | |
def get_local_timezone_str | |
if File.exist?("/etc/timezone") | |
tz = File.read("/etc/timezone").chomp | |
elsif File.symlink?("/etc/localtime") | |
tz = File.readlink("/etc/localtime").sub(%r{.*/usr/share/zoneinfo}, '').lines.first.chomp | |
else | |
raise "Olson time zone could not be determined" | |
end |
module AuthHelper | |
def http_login | |
user = 'username' | |
pw = 'password' | |
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
end | |
end | |
module AuthRequestHelper | |
# |
#!/bin/bash | |
# Get current swap usage for all running processes | |
# Erik Ljungstrom 27/05/2011 | |
# Modified by Mikko Rantalainen 2012-08-09 | |
# Pipe the output to "sort -nk3" to get sorted output | |
# Modified by Marc Methot 2014-09-18 | |
# removed the need for sudo | |
SUM=0 | |
OVERALL=0 |
Original text from http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html
From: Mark Jason Dominus <[email protected]>
Date: Jul 28, 2005 11:16 PM
Subject: Re: HOP -vs- SICP
{ | |
"Version": "2014-08-27", | |
"Statement": [ | |
{ | |
"Sid": "BarnDoor", | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:*" | |
], | |
"Resource": [ |
# Puppet definition: | |
exec {"Clone a copy of ${scm_uri}": | |
command => "git clone ${scm_uri} ${source_checkout_dir}", | |
path => ['/usr/local/bin'], | |
cwd => $::nexus::nexus_root, | |
user => $::nexus::nexus_user, | |
creates => $source_checkout_dir, | |
require => Package['git'], | |
unless => "/usr/bin/test -e ${source_checkout_dir}/.git", | |
} |
#!/usr/bin/env bash | |
# Compress MySQL tables on disk. | |
# Author: Andrew Berry, [email protected] | |
# | |
# Compress all tables in a MySQL InnoDB database using compression from the | |
# Barracuda table format. Tables have to already be in the Barracuda file | |
# format to actually compress tables, otherwise the table setting is ignored. | |
# | |
# innodb_file_per_table = 1 MUST be set in my.cnf for compression to work. |
describe LeadService do | |
LeadService.configure(:test) do | |
before { settings.set(:instance, self) } | |
end | |
# Required for Rack::Test | |
# | |
def app | |
LeadService |
# ... | |
it { should contain_file('/etc/statsd/config.js') | |
.with( | |
:ensure => 'file', | |
:require => 'Package[nodejs-statsd]', | |
) | |
} | |
describe '/etc/statsd/config.js' do | |
before :each do |
class profile::sensu::client { | |
class {'sensu': | |
use_embedded_ruby => true, | |
safe_mode => false, | |
client => true, | |
server => false, | |
api => false, | |
dashboard => false, | |
log_level => hiera('sensu::client::log_level', 'info'), |