Pages

Thursday 16 February 2012

Local Server to Public

Most of time we need to communicate public ip for our system so external/3rd party services can communicate with our local running server. One of the solution can be requesting your ISP or Network service provider to redirect a particular port to your local machine, this is on old way which i use to develop my first facebook application.

But now thanks to localtunnel (though have some problem) is a good one to use a public domain at run time so your local server is accessible by public.

Very simple steps https://github.com/progrium/localtunnel described here.

just install them gem of localtunnel and run the command  localtunnel -k ~/.ssh/id_rsa.pub 8080 for first time and afterwards localtunnel 8080 in response it will give you like this Port 8080 is now publicly accessible from http://8bv2.localtunnel.com ...


That's it show your local server to public and make them happy by looking traces of the crashes ;)

Friday 3 February 2012

Redis Memory Issue with Resque

Resque maintains its information/traces/jobs in Redis, a very pupular and fast in-memory key value storage.

After shifting to heroku the redis memory starts getting increase day by day and the temporary solution was to keep adding more powerful redis add-ons which was a poor approach and expensive one.

So decided to flush the old memory as there is no need to keep the old processed jobs data by resque. Thanks to Heroku's support time that they put the right direction for flush all of memory.


 uri = URI.parse(ENV["REDISTOGO_URL"])
 redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
 redis.flushall

It will clear all your redis contents and if you look to resuque web console all counters and queues jobs has been reset and going to start from their seed values.

:)