Skip to main content

Posts

Showing posts from June, 2011

Deals You Can't Miss

1 Year Subscription

Kill process listening/bound to specific port

Step 1: Identify the process     For this you can use either of the command below: lsof -w -n -i tcp:<port_number> where, -w implies suppression of warning messages -n option inhibits the conversion of network numbers to host names for network files. Inhibiting conversion may make lsof run faster. It is also useful when host name lookup is not working properly. -i[i] option selects the listing of files any of whose Internet address matches the address specified in i. If no address is specified, this option selects the listing of all Internet and x.25 (HP-UX) network files.       If -i4 or -i6 is specified with no following address, only files of the indicated IP version, IPv4 or IPv6, are displayed. (An IPv6 specification may be used only if the dialects supports IPv6, as indicated by "[46]" and "IPv[46]" in lsof's -h or -? output.) Sequentially specifying -i4, followed by -i6 is the same as specifying -i, and vice-versa. Specifying -i4, or -i6

When you see Gem error like - "'': uninitialized constant Gem::SilentUI (NameError)"

I just created a new Rails 3 project called dashboard and tried having bundler install all the required basic gems for this project using the command - bundle install. Damn!, I got the error that is the title for this blog post. Below is the snap shot of the command and the error: karthik@cloud:~/MyRubyProjects/beach_projects/dashboard$ bundle install /home/karthik/.rvm/gems/ ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:56:in '<class:UI>': uninitialized constant Gem::SilentUI (NameError) from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:2:in `<module:Bundler>' from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:1:in `<top (required)>' from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/cli.rb:16:in `initialize' from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `new' fro

How to find the method definition - one that is invoked at runtime?

During the QnA session after my talk at RubyConf India 2011, one avid Ruby enthusiast asked me a question, "How to find the method definition - one that is invoked at runtime?". I confessed that in all my experience (for the last eight and odd months) with Ruby, I have been doing the grep-ing for the method name and then figure out which method definition would be the last to over-ride every other ones declared earlier. No sooner did I finish answering, boooooooooom came a greatly handy tip from a very respectable and renowned geeky person in the crowd - Ola Bini . He adviced to use Ruby's "method" method to figure out the source of the method that was invoked at runtime. What an easier and neater approach! Hearty thanks to both the folks - one who questioned and the other who answered. This blog post is my attempt to elaborate more on the tip that Ola Bini had adviced. Back home after the conference, I googled on these lines and found the following re

Ruby Conf India 2011

I happened to be one of the speakers in this international conference that was held at Bangalore. What pleasure and privilege! The subject of my talk was Deciphering the Ruby Object Model , aimed to help fellow ruby enthusiasts level up their understanding and appreciation of Ruby as a programming language. The talk was well received by many a folks who had attended my session. I wish to thank every one who had personally come over to me for sharing their feedback with me. You can download the presentation from any of the below mentioned locations: Slideshare  (PPT version only) RubyConfIndia  (Both PPT and PDF versions available here)  Once the conference videos are published, I'll be glad to add its link here ;) Okie, it is now published, so please find it below: Deciphering The Ruby Object Model from Innovation & Technology Trust on Vimeo . For all the positive feedback I had received, I intend to very soon publish a couple of blog posts detailing on specif