Skip to content

Instantly share code, notes, and snippets.

sudo xfs_growfs -d /dev/md0
meta-data=/dev/md0 isize=256 agcount=17, agsize=6553536 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=104857344, imaxpct=25
= sunit=64 swidth=256 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal bsize=4096 blocks=32768, version=1
= sectsz=512 sunit=0 blks, lazy-count=0
realtime =none extsz=1048576 blocks=0, rtextents=0
data size unchanged, skipping
@loe
loe / reset_session_fix.rb
Created April 23, 2012 21:06
Monkey Patch Rails 2.3 reset_session to work correctly (especially if you use something like Intercession)
class ActionController::Request
def reset_session
by = session.instance_variable_get(:@by)
session.destroy if session and session.respond_to?(:destroy)
self.session = ActionController::Session::AbstractStore::SessionHash.new(by, @env)
end
end
# rabbitmq-collectd-plugin - rabbitmq_info.py
#
# Author: Daniel Maher (http://www.dark.ca/)
# Description: This plugin uses collectd's Python plugin to obtain Rabbitmq metrics.
#
# Loosely based on Garret Heaton's "redis-collectd-plugin"
# https://github.com/powdahound/redis-collectd-plugin
import collectd
require 'puppet'
require 'net/http'
require 'net/https'
FOREMAN_HOST = 'your.domain.com'
FOREMAN_PORT = 443
Puppet::Reports.register_report(:foreman) do
Puppet.settings.use(:reporting)
desc "Sends reports directly to Foreman"
# Query Foreman
# example usage:
#
# query for hosts
# ~~~~~~~~~~~~~~~
# $myhosts = foreman("hosts","facts.domain ~ lab")
# returns all hosts which have lab as part of their domain.
#
# or a more complex search term
# $myhosts = foreman("hosts", "hostgroup ~ web and environment = production and status.failed = 0 and facts.timezone = EST and last_report < \"1 hour ago\""
# Have the Source use the main_search database if it exists.
module ThinkingSphinx
class Source
def set_source_database_settings(source)
config = @database_configuration
source.sql_host = config[:main_search] || config[:host] || "localhost"
source.sql_user = config[:username] || config[:user] || 'root'
source.sql_pass = (config[:password].to_s || "").gsub('#', '\#')
source.sql_db = config[:database]
@loe
loe / my.cf
Created November 1, 2011 17:17
[client]
loose-default-character-set = utf8
[server]
max_allowed_packet = 128M
default-character-set = utf8
default-collation = utf8_general_ci
innodb_buffer_pool_size = 256M
innodb_file_per_table
Rubinius Crash Report #rbxcrashreport
Error: signal SIGILL
[[Backtrace]]
0 rbx 0x0000000100022511 _ZN8rubiniusL12segv_handlerEi + 241
1 libSystem.B.dylib 0x00007fff803da1ba _sigtramp + 26
2 ??? 0x70080cc000000000 0x0 + 8072716350834868224
3 rbx 0x000000010013d7d6 _ZN8rubinius7Channel4sendEPNS_2VMEPNS_6ObjectE + 422
4 rbx 0x0000000100082232 _ZN8rubinius10Primitives12channel_sendEPNS_2VMEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE + 242
Jun 8 21:05:49 domU-12-31-39-0C-CD-A3 postfix/smtpd[5618]: connect from domU-12-31-39-0C-CD-A3.onehub.com[127.0.0.1]
Jun 8 21:05:49 domU-12-31-39-0C-CD-A3 postfix/smtpd[5618]: 5A0E2746B9: client=domU-12-31-39-0C-CD-A3.onehub.com[127.0.0.1]
Jun 8 21:05:49 domU-12-31-39-0C-CD-A3 postfix/cleanup[5672]: 5A0E2746B9: message-id=<4defe42d42e4c_cfd8473e4a172b@domU-12-31-39-0C-CD-A3.tmail>
Jun 8 21:05:49 domU-12-31-39-0C-CD-A3 postfix/qmgr[5531]: 5A0E2746B9: from=<ws@reply.onehubmaster.com>, size=5186, nrcpt=1 (queue active)
Jun 8 21:05:49 domU-12-31-39-0C-CD-A3 postfix/smtpd[5618]: disconnect from domU-12-31-39-0C-CD-A3.onehub.com[127.0.0.1]
Jun 8 21:05:51 domU-12-31-39-0C-CD-A3 postfix/smtp[5675]: 5A0E2746B9: to=<loe+messages@onehub.com>, relay=aspmx.l.google.com[74.125.93.27]:25, delay=1.7, delays=0.11/0/0.04/1.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1307567151 f11si1758327qck.134)
Jun 8 21:05:51 domU-12-31-39-0C-CD-A3 postfix/qmgr[5531]: 5A0E2746B9: removed
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.apache.activemq</string>
<key>Program</key>
<string>/opt/local/lib/apache-activemq-5.2.0/bin/activemq</string>