Skip to content

Instantly share code, notes, and snippets.

View srid's full-sized avatar
🌤️
Never not this moment

Sridhar Ratnakumar srid

🌤️
Never not this moment
View GitHub Profile
$ curl -v localhost:3000
* About to connect() to localhost port 3000 (#0)
* Trying 127.0.0.1... connected
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:3000
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/html; charset=utf-8
$ bundle exec thin -p 3001 -V -l thin.log -D -e development start
>> Using rack adapter
REDIS_URL is redis://user:434104c2-2e88-495b-a1dc-19b2e632a436@192.168.68.111:5004/
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in R
ails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initi
alizers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has
-been-released. (called from <top (required)> at /app/app/config/environment.rb:5)
>> Thin web server (v1.5.0 codename Knife)
>> Debugging ON
>> Maximum connections set to 1024
$ bundle exec rails s Puma -p 3001 REDIS_URL is redis://user:434104c2-2e88-495b-a1dc-19b2e632a436@192.168.68.111:5004/=> Booting Puma=> Rails 3.2.12 application starting in production on http://0.0.0.0:3001=> Call with -d to detach=> Ctrl-C to shutdown serverDEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initi
alizers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has
-been-released. (called from <top (required)> at /app/app/config/environment.rb:5)
Puma 1.6.3 starting...
* Min threads: 0, max threads: 16
* Environment: production
* Listening on tcp://0.0.0.0:3001
Started GET "/" for 127.0.0.1 at 2013-02-18 20:44:14 -0800
@srid
srid / fiber-leak.rb
Last active December 13, 2015 19:39
eventmachine fiber leak
require 'eventmachine'
require 'fiber'
DELAY = 1
def spawn_ops
Fiber.new { run_ops }.resume
end
def run_ops
@srid
srid / x.patch
Created February 15, 2013 18:43
commit 5d2220e75b2aee4b8f33404caa1374524c156478
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date: Wed Feb 6 12:52:21 2013 -0800
Bug #97274 - enable postgresql HSTORE extension for all databases
diff --git a/postgresql/lib/postgresql_service/node.rb b/postgresql/lib/postgresql_service/node.rb
index 63ba035..ae39144 100644
--- a/postgresql/lib/postgresql_service/node.rb
+++ b/postgresql/lib/postgresql_service/node.rb
[2013-02-14 14:59:10.543351] fence - pid=13536 tid=d8d2 fid=50ea DEBUG -- container 427379834b9eafff6f28f75cff209701 - allocated IP 192.168.3.62
*** buffer overflow detected ***: /opt/rubies/current/bin/ruby terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f810c29f807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7f810c29e700]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a7be)[0x7f810c29f7be]
/opt/rubies/current/bin/ruby(rb_fd_set+0x19)[0x4bdb6c]
/opt/rubies/current/bin/ruby[0x42a097]
/opt/rubies/current/bin/ruby(rb_ensure+0x7c)[0x417047]
/opt/rubies/current/bin/ruby[0x424b0b]
@srid
srid / x.diff
Created January 17, 2013 17:49
diff --git a/cloud_controller/db/schema.rb b/cloud_controller/db/schema.rb
index 81b0e25..602e6b2 100644
--- a/cloud_controller/db/schema.rb
+++ b/cloud_controller/db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -10,7 +11,7 @@
cli/apps | stackato::client::cli::command::Apps new instances {} json 1 noprompts 0 noframework 0 password {} url {} nostart 0 runtime {} exec {} copyunsafe 0 instance {} canary 0 verbose 0 manifest {} noresources 0 quiet 0 email {} all 0 logtimestamps 1 name {} __options --json prefixlogs 0 follow 0 print 0 bind {} framework {} dry 0 force 0 | 
Request GET, application/json: https://api.stackato-3qhh.local/info
Header AUTHORIZATION: 04085b0849220c7340732e636f6d063a0645546c2b0745f3cb502219708a8105dd92f40d3bf8a1109cf4142b531c1f1b
Header X-VCAP-Trace: 22
Response Code: HTTP/1.1 200 OK
Response Code': 200
Response Status: ok
Response Error:
Response Headers: Server nginx Date {Tue, 11 Dec 2012 00:27:30 GMT} Content-Type {application/json; charset=utf-8} Transfer-Encoding chunked Connection close ETag {"9fa4fe1fb38ba748bbbfeb61bace09e7"} Cache-Control {max-age=0, private, must-revalidate} X-UA-Compatible IE=Edge,chrome=1
successfulCodes := sort.IntSlice([]int{200, 302})
successfulCodes.Sort()
if successfulCodes.Search(resp.StatusCode) != len(successfulCodes) {
return nil, fmt.Errorf("HTTP request with failure code (%d); body -- %v",
resp.StatusCode, body)
}
stackato/server/cluster.go:6: imported and not used: "github.com/srid/log"
stackato/server/cluster.go:20: undefined: log
stackato/server/cluster.go:25: undefined: log