Skip to content

Instantly share code, notes, and snippets.

Sunspot.search(Topic) do
keywords(query)
highlight :content
end.hits.each do |hit|
puts hit.highlights(:content)
end
ab -n 10 -c 1 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient).....done
Server Software: SimpleHTTP/0.6
Server Hostname: localhost
Linux domU-12-31-39-00-A0-F5 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Amazon EC2 Debian 5.0.2 lenny AMI built by Eric Hammond
@fizx
fizx / gist:294079
Created February 3, 2010 22:01
jcp
#!/bin/sh
# Recursively generates a list of child jars for the folders provided
# and puts them into a colon-delimited list for the -cp option
#
# Example:
# java -cp `jcp lib dist` com.qf.SomeScript
#
find $@ -name "*.jar" | xargs | sed "s/ /:/g"
#!/bin/sh
for ARG in $*
do
cat ~/.ssh/id_rsa.pub | ssh $ARG "mkdir -p .ssh; touch .ssh/authorized_keys; cat - >> .ssh/authorized_keys"
done
{
"namespace": "org.apache.cassandra.avro",
"protocol": "Cassandra",
"types": [
{"name": "ColumnPath", "type": "record",
"fields": [
{"name": "column_family", "type": "string"},
{"name": "super_column", "type": ["bytes", "null"]},
{"name": "column", "type": ["bytes", "null"]}
kyles-macbook:coffee-script kyle$ cat hello.coffee
puts "hi";
kyles-macbook:coffee-script kyle$ echo "require './hello'" | coffee -i
/Users/kyle/Git/coffee-script,/Users/kyle/Git/coffee-script/lib,/Users/kyle/.node_libraries,/usr/local/lib/node/libraries
coffee> Error: Cannot find module './hello'
at loadModuleSync (node.js:543:13)
at require (node.js:651:12)
at EventEmitter.<anonymous> (eval at readline (/Users/kyle/Git/coffee-script/lib/repl.js:19:25))
at EventEmitter.readline (/Users/kyle/Git/coffee-script/lib/repl.js:19:13)
at node.js:756:9
kyles-macbook:quantifind kyle$ cd dist/
kyles-macbook:dist kyle$ ls
quantifind.jar quantifind.war
kyles-macbook:dist kyle$ mkdir tmp
kyles-macbook:dist kyle$ mv quantifind.war tmp/
kyles-macbook:dist kyle$ cd tmp/
kyles-macbook:tmp kyle$ unzip quantifind.war
Archive: quantifind.war
creating: META-INF/
inflating: META-INF/MANIFEST.MF
do(something); # because
# it's awesome
bye();
** [out :: qf4.quantifind.com] 10/04/05 16:51:49 INFO zookeeper.ZooKeeper: Closing session: 0x127d05e53860007
** [out :: qf4.quantifind.com] 10/04/05 16
** [out :: qf4.quantifind.com] :51:49 INFO zookeeper.ClientCnxn: Closing ClientCnxn for session: 0x127d05e53860007
** [out :: qf4.quantifind.com] 10/04/05 16:51:49 INFO zookeeper.ClientCnxn: Exception while closing send thread for session 0x127d05e53860007 : Read error rc = -1 java.nio.DirectByteBuffer[pos=0 lim=4 cap=4]
** [out :: qf4.quantifind.com] 10/04/05 16:51:49 INFO zookeeper.ClientCnxn: Disconnecting ClientCnxn for session: 0x127d05e53860007
** [out :: qf4.quantifind.com] 10/04/05 16:51:49 INFO zookeeper.ZooKeeper: Session: 0x127d05e53860007 closed
** [out :: qf4.quantifind.com] 10/04/05 16:51:49 INFO zookeeper.ClientCnxn: EventThread shut down