To use this snippet first replace the _default
in the URL with your environment name if you are using somethign other than the global default. Next in the run list, replace ...
with your cookbook names. Unlike other run lists, you cannot have roles here, and you don't use the 'recipe[foo]'
syntax, just 'foo'
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run #1 - run with just --db sqlite, one test is generated/runs | |
classics-MacBook-Pro-2:sqlalchemy classic$ py.test test/dialect/test_suite.py --db sqlite -k HasTableTest | |
============================================================= test session starts ============================================================== | |
platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2 -- /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python | |
plugins: cov | |
collected 121 items | |
test/dialect/test_suite.py <- lib/sqlalchemy/testing/suite/test_reflection.py:31: HasTableTest_sqlite_pysqlite.test_has_table PASSED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def find_deps(cookbook_dir) | |
nel = Hash.new { |h, k| h[k] = [] } | |
Dir.glob("#{cookbook_dir}/*/").each do |r| | |
deps_for(r, nel) | |
end | |
nel | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ideias on a nicer ActiveResource API | |
= ActiveResource | |
== Guidelines | |
ARes is a platform to build clients to restful-like web services. It maps resources to objects that complies with the ActiveModel API. | |
To enjoy the advantages of being restful (whose discussion is beyond the scope of this gist), ARes should support: | |
* using HTTP verbs, headers and status code as they are meant; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from contextlib import contextmanager | |
@contextmanager | |
def easyprofile(msg): | |
before = time.time() | |
yield | |
print '%s took %0.2fsec' % (msg, time.time() - before) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'xmpp4r' | |
require 'xmpp4r/muc/helper/simplemucclient' | |
# Most of this is borrowed from https://gist.github.com/941931 | |
# Added support for multiple rooms and external handling of messages. | |
# We want the MUC functionality to just handle shit for us. Unfortunately we | |
# have to override/repeat the join method in order to add the directive that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Launch an EC2 instance with Squid configured for user specified network and port and a security group.", | |
"Parameters" : { | |
"SourceNetwork" : { | |
"Description" : "Squid proxies instances in this network. Example: 123.123.123.0/24", | |
"Type" : "String" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/custom_engine1/module1.iml" filepath="$PROJECT_DIR$/custom_engine1/custom_engine1.iml" /> | |
<module fileurl="file://$PROJECT_DIR$/custom_engine2/module2.iml" filepath="$PROJECT_DIR$/custom_engine2/custom_engine2.iml" /> | |
</modules> | |
</component> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_pg_fouine(): | |
info = host_info[env.host_string] | |
db_name = info.tags.get('Name') | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
time.sleep(30) | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
run('gzip -f /tmp/pgfouine.txt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Which | |
Grep="`/usr/bin/which grep`" | |
Awk="`/usr/bin/which awk`" | |
Cat="`/usr/bin/which cat`" | |
Sed="`/usr/bin/which sed`" | |
Curl="`/usr/bin/which curl`" | |
# Scrape Nagios |
OlderNewer