Skip to content

Instantly share code, notes, and snippets.

@findchris
findchris / gist:2424421
Created April 19, 2012 21:46
redis-cli info
redis-cli info
redis_version:2.4.7
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.3
process_id:18350
uptime_in_seconds:5674707
uptime_in_days:65
@findchris
findchris / gist:2415544
Created April 18, 2012 18:15
redis-server at 100% CPU
root@domU-12-31-39-14-09-3D:~# /tmp/poor.sh
4
2 pthread_cond_wait@@GLIBC_2.3.2,bioProcessBackgroundJobs,start_thread,clone,??
1 accept,anetGenericAccept,anetTcpAccept,acceptTcpHandler,aeProcessEvents,aeMain,main
root@domU-12-31-39-14-09-3D:~# /tmp/poor.sh
4
2 pthread_cond_wait@@GLIBC_2.3.2,bioProcessBackgroundJobs,start_thread,clone,??
1 open64,_IO_file_fopen,??,redisLog,acceptTcpHandler,aeProcessEvents,aeMain,main
root@domU-12-31-39-14-09-3D:~# /tmp/poor.sh
4
@findchris
findchris / geoiplookup.c
Created April 11, 2012 21:03
Patch to add region name to geoiplookup
\diff --git a/apps/geoiplookup.c b/apps/geoiplookup.c
index bd3c6fc..44a6d8e 100644
--- a/apps/geoiplookup.c
+++ b/apps/geoiplookup.c
@@ -296,7 +296,8 @@ geoiplookup(GeoIP * gi, char *hostname, int i)
printf("%s: IP Address not found\n", GeoIPDBDescription[i]);
}
else {
- printf("%s: %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
+ printf("%s: %s, %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
@findchris
findchris / gist:1441158
Created December 7, 2011 02:29
consumer page easyXDM Rpc
new easyXDM.Rpc(
{
swf: "http://ourstaticcontent/easyxdm.swf",
remote: content_url, // the URL of iframe opened by the consumer
container: container, // the iframe object
onReady: function() {
console.log('activityFrameLoaded: onReady'); // this gets called
}
},
{
@findchris
findchris / gist:1441156
Created December 7, 2011 02:29
easyXDM error
Uncaught TypeError: Cannot call method 'replace' of undefined
resolveUrl in easyXDM.js:281
prepareTransportStack in easyXDM.js:543
easyXDM.Rpc in easyXDM.js:1202
// inside of content URL iframe
new easyXDM.Rpc(
{
swf: "http://ourstaticcontent/easyxdm.swf",
},
{
remote: {
test: {}
},
local: { }
@findchris
findchris / Source files.rb
Created July 22, 2011 01:21
Weird shoulda issue
# app/models/user.rb
class User < ActiveRecord::Base
validates :name, :uniqueness => true, :presence => true
validates :secret, :uniqueness => true, :presence => true
before_validation :assign_secret, :on => :create
private
def assign_secret
require 'find'
Find.find("/users/cjohnson/vids") do |path|
basename = File.basename(path)
dir = File.dirname(path)
extname = File.extname(path)
next if FileTest.directory?(path)
next if basename[0,2] == "._"
next if basename == ".DS_Store"
next unless extname =~ /(m2ts|mts)/i
ubuntu@Production-admin:/srv/pparty$ cloud ssh -n frontend-app -c clouds_qa.rb
PoolParty core loadtime: 0.363369
./clouds_qa.rb:37:in `read': No such file or directory - instance_data/daemon_app_qa_user_data.json (Errno::ENOENT)
from ./clouds_qa.rb:37
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/pool.rb:7:in `new'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/pool.rb:7:in `cloud'
from ./clouds_qa.rb:34
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `instance_eval'
#================================================================
# Configuring Tokyo Tyrant version 1.1.40 (lua).
#================================================================
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes