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
# Send a metric to statsd from bash | |
# | |
# Useful for: | |
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/) | |
# init scripts | |
# sending metrics via crontab one-liners | |
# sprinkling in existing bash scripts. | |
# | |
# netcat options: | |
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed. |
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
# | |
# Cookbook Name:: jenkins | |
# Recipe:: default | |
# | |
# https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu | |
# This is super-simple, compared to the other Chef cookbook I found | |
# for Jenkins (https://github.com/fnichol/chef-jenkins). | |
# | |
# This doesn't include Chef libraries for adding Jenkin's jobs via |
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
knife node configure my_node.example.com |
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
{ | |
"node": { | |
"provider_id": 999, | |
"name": "i-12345678", | |
"state": 2, | |
"details": { | |
"status": ["running"], | |
"productcode": ["[]"], | |
"instanceId": ["i-12345678"], | |
"dns_name": ["ec2-174-123-210-12.compute-1.amazonaws.com"], |
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 | |
# Check on the load times for Ohai plugins. | |
# To disable from chef-solo and chef-client runs see | |
# http://wiki.opscode.com/display/chef/Disabling+Ohai+Plugins | |
require 'benchmark' | |
require 'rubygems' | |
require 'ohai' |
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
<?php | |
// Tweak #1 | |
// Load database settings from PRESSFLOW_SETTINGS environment variable... | |
$pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); | |
$database_settings = $pressflow_settings['databases']['default']['default']; | |
/** MySQL configs */ | |
define('DB_NAME', $database_settings['database']); | |
define('DB_USER', $database_settings['username']); | |
define('DB_PASSWORD', $database_settings['password']); |
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
# First allow pushing to the checked-out branch on the remote repo: | |
# git config receive.denyCurrentBranch ignore | |
# Then add this to sync the working dir to the repo on receive: | |
GIT_WORK_TREE=/opt/titan GIT_DIR=/opt/titan/.git git reset --hard | |
# Then, on the local working dir, add the remote: | |
# git remote add test [email protected]:/opt/titan |
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
# Get the mapping | |
>> curl http://127.0.0.1:9200/graylog2/message/_mapping|python -mjson.tool | |
{ | |
"message": { | |
"properties": { | |
"_hostname": { | |
"type": "string" | |
}, | |
"created_at": { | |
"type": "double" |
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
[root@ncstestonebox plugins]# yum list apache-cassandra1 | |
Loaded plugins: presto | |
Installed Packages | |
apache-cassandra1.noarch 1.0.9-1 @datastax | |
Available Packages | |
apache-cassandra1.noarch 1.0.10-1 datastax | |
[root@ncstestonebox plugins]# yum install apache-cassandra1-1.0.10-1 | |
Loaded plugins: presto | |
Setting up Install Process | |
Resolving Dependencies |
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
wget http://jmxsh.googlecode.com/files/jmxsh-R5.jar | |
java -jar jmxsh-R*.jar -h localhost -p 7199 | |
% [Hit Enter to go into Browse Mode] | |
Select a domain: [Enter number for org.apache.cassandra.net] | |
Select an mbean: [Enter number for org.apache.cassandra.net:type=Gossiper] | |
Select an attribute or operation: [Enter number for unsafeAssassinateEndpoint(String p1)] | |
p1 (String): [Enter IP address of problem node] | |
It may also be possible to run it directly (untested): | |
% jmx_invoke -m org.apache.cassandra.net:type=Gossiper unsafeAssassinateEndpoint <STALE-IP-ADDRESS> |