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
# add to Vagrantfile config | |
config.ssh.forward_x11 = true |
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
VBoxManage clonehd /Users/paulo/VirtualBox\ VMs/devtools_1338568497/box-disk1.vmdk --format VHD ~/Desktop/cururu.vhd |
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
How to install Statsd + Graphite on Centos 5.X | |
https://gist.github.com/889297 | |
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager |
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
dbus-uuidgen |
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
Plugin |
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
# Memcached config | |
memcache_config = YAML.load_file("#{RAILS_ROOT}/config/memcached.yml")[RAILS_ENV] | |
if memcache_config.nil? | |
raise ArgumentError.new("[ environment.rb ] Memcached configurations could not be found for RAILS_ENV => #{RAILS_ENV}") | |
end | |
require 'memcache' | |
CACHE = MemCache.new(:namespace => "abril-id-#{RAILS_ENV}") | |
CACHE.servers = memcache_config['servers'] | |
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
# base config | |
base_cache: &base_cache | |
expires: 86400 #session expired after 24 hours | |
servers: | |
- '127.0.0.1:11211' | |
cucumber: | |
<<: *base_cache | |
# local |
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 'net/telnet' | |
cache_dump_limit = 100 | |
localhost = Net::Telnet::new("Host" => "172.16.10.196", "Port" => 11211, "Timeout" => 3) | |
slab_ids = [] | |
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c| | |
matches = c.scan(/STAT items:(\d+):/) | |
slab_ids = matches.flatten.uniq | |
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
cluster.name: logs | |
# Puppet-ism to put in the hostname and IP | |
node.name: <%= @hostname %> | |
network.host: <%= @ipaddress %> | |
# Turn off multicast autodiscovery | |
discovery.zen.ping.unicast.hosts: 172.1.1.100:9300, 172.1.1.101:9300 | |
index.number_of_shards: 4 | |
index.routing.allocation.total_shards_per_node: 1 |
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
// FROM: http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29 | |
// | |
// db.collection.update( criteria, objNew, upsert, multi ) | |
// criteria - query which selects the record to update; | |
// objNew - updated object or $ operators (e.g., $inc) which manipulate the object | |
// upsert - if this should be an "upsert"; that is, if the record does not exist, insert it | |
// multi - if all documents matching criteria should be updated | |
// | |
// SQL VERSION: | |
// UPDATE myTable SET dateField = '2011-01-01' WHERE condField = 'condValue' |
OlderNewer