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
luarocks install lua-requests CRYPTO_INCDIR='/usr/local/Cellar/openssl/1.0.2g/include' OPENSSL_INCDIR='/usr/local/Cellar/openssl/1.0.2g/include' |
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
# This is to install both on OS X if you don't want to use homebrew | |
# xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun | |
xcode-select --install | |
curl -O http://luajit.org/download/LuaJIT-2.0.4.zip | |
unzip LuaJIT-2.0.4.zip | |
cd LuaJIT-2.0.4 | |
make && make install | |
curl -O http://keplerproject.github.io/luarocks/releases/luarocks-2.3.0.tar.gz |
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 boto.sqs | |
import time | |
conn = boto.sqs.connect_to_region("us-east-1") | |
q = conn.create_queue("myqueue") | |
while(True): | |
for m in q.get_messages(): | |
print m.get_body() | |
q.delete_message(m) |
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
## curl -d '{"test":"data","friend":"tim"}' 'http://127.0.0.1:4151/put?topic=test' | |
import nsq | |
import json | |
buf = [] | |
def process_message(message): | |
global buf | |
message.enable_async() | |
msg = json.loads(message.body) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
echo "vm.swappiness=0" >> /etc/sysctl.conf | |
echo "kernel.randomize_va_space=1" >> /etc/sysctl.conf | |
echo "vm.dirty_ratio=3" >> /etc/sysctl.conf | |
echo "vm.dirty_background_ratio=2" >> /etc/sysctl.conf | |
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf | |
echo "vm.mmap_min_addr=4096" >> /etc/sysctl.conf |
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
# Class to install SQL Server, set its configuration, create an | |
# instance, as well as a sample DB. | |
class app_sqlserver ( | |
$source = 'F:/', | |
$admin_user = 'Administrator', | |
$db_instance = 'MYINSTANCE', | |
$sa_pass = 'MySecretPASSWORD', | |
$db_name = 'sampledb', | |
) { |
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 | |
PATH="/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/opt/puppet/bin:$PATH" | |
declare -x PE_CERT=$(puppet agent --configprint hostcert) | |
declare -x PE_KEY=$(puppet agent --configprint hostprivkey) | |
declare -x PE_CA=$(puppet agent --configprint localcacert) | |
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure" |
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 | |
PATH="/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/opt/puppet/bin:$PATH" | |
declare -x PE_CERT=$(puppet agent --configprint hostcert) | |
declare -x PE_KEY=$(puppet agent --configprint hostprivkey) | |
declare -x PE_CA=$(puppet agent --configprint localcacert) | |
declare -x PE_CERTNAME=$(puppet agent --configprint certname) | |
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure" |
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
class yum_nginx_api ( | |
$git_ver = 'latest', | |
$git_dir = '/opt/yum-nginx-api', | |
) { | |
# Install git client | |
package { 'git': | |
ensure => $git_ver, | |
} |
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
class run_noop ( | |
$git_dir = '/opt/my_puppet_module', | |
) { | |
# Install git puppet repo into git directory | |
vcsrepo { $git_dir: | |
ensure => latest, | |
provider => git, | |
source => 'https://github.com/user/my_puppet_module.git', | |
revision => 'master', |