Skip to content

Instantly share code, notes, and snippets.

View seigel's full-sized avatar

James Seigel seigel

View GitHub Profile
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
require 'digest/sha1'
class String
def hash
Digest::SHA1.hexdigest self
end
def bit
"%0160b" % to_i(16)
end
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'
require 'rubygems'
require 'rack'
require 'redis'
class ApiThrottling
def initialize(app, options={})
@app = app
@options = {:requests_per_hour => 60}.merge(options)
end
org.apache.hadoop.hbase.client.RegionOfflineException: region offline: BaseProfile,6715050A60106F4DE57E755202612104-848357177-v,1300423695547.fb327f120339394a50fc85a187573b9f.
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:738)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:590)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1114)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatchOfPuts(HConnectionManager.java:1234)
at org.apache.hadoop.hbase.client.HTable.flushCommits(HTable.java:819)
at org.apache.hadoop.hbase.client.HTable.doPut(HTable.java:675)
at org.apache.hadoop.hbase.client.HTable.put(HTable.java:660)
at org.apache.hadoop.hbase.mapreduce.TableOutputFormat$TableRecordWriter.write(TableOutputFormat.java:126)
at org.apache.hadoop.hbase.mapreduce.
2011-03-18 00:00:58,653 WARN org.apache.hadoop.ipc.HBaseServer: IPC Server Responder, call multi(org.apache.hadoop.hbase.client.MultiAction@2fb65c0a) from 10.5.240.241:33574: output error
2011-03-18 00:00:58,653 WARN org.apache.hadoop.ipc.HBaseServer: IPC Server handler 14 on 60020 caught: java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:126)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
at org.apache.hadoop.hbase.ipc.HBaseServer.channelWrite(HBaseServer.java:1339)
at org.apache.hadoop.hbase.ipc.HBaseServer$Responder.processResponse(HBaseServer.java:727)
at org.apache.hadoop.hbase.ipc.HBaseServer$Responder.doRespond(HBaseServer.java:792)
at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1083)
@seigel
seigel / gist:887242
Created March 25, 2011 17:37
I run this: ant -Dforrest.home=/Users/seigel/Documents/Projects/OtherWork/apache-rrest-0.9 package
[exec] Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/messaging/MessageHandler
[exec] at org.apache.cocoon.serialization.FOPSerializer.configure(FOPSerializer.java:122)
[exec] at org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)
[exec] at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:289)
[exec] at org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.newPoolable(InstrumentedResourceLimitingPool.java:655)
[exec] at org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.get(InstrumentedResourceLimitingPool.java:371)
[exec] at org.apache.avalon.excalibur.component.PoolableComponentHandler.doGet(PoolableComponentHandler.java:198)
[exec] at org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:381)
[exec] at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.select(ExcaliburComponentSe
@seigel
seigel / email_sent_count.rb
Created November 4, 2011 05:32
Resque on Cloudfoundry
# shell for the real worker in the other project
class EmailSentCount
@queue = :high
end
@seigel
seigel / nginx_site
Created March 8, 2012 06:12 — forked from nicolasblanco/nginx_site
My Sprinkle script to setup a Continuous Integration server with Ruby 1.9/Jenkins/nginx/PostgreSQL
# Sprinkle setup script for our CI server (Ruby 1.9/Git/PostgreSQL/nginx reverse proxy)
#
package :build_essential do
description 'Build tools'
apt 'build-essential' do
# Update the sources and upgrade the lists before we build essentials
pre :install, ['aptitude update', 'aptitude safe-upgrade', 'aptitude full-upgrade']
end
end