Ruby Under a Microscope

Finally, I’ve started reading the book Ruby Under a Microscope written by Pat Shaughnessy. I was eagerly waiting for this book for quite long time. When it released recently, I saw that I can’t buy it using PayPal. I emailed the author asking how can I pay using PayPal. To surprise me most, the author sent me a copy of the book with the reply email. I guess, he could feel my interests to read this book. I can’t be more happy.

I’ve just started reading it and yet to complete the first chapter. I am loving what I’m reading. I’m feeling indebted to Ruby seeing how far it goes with my written codes :-). I had no idea that, internally, it cares so much about my code and does so many things before returning me what I expect.

Continue reading →

Get free SMS alert on your server down (or something else)!

Well, first thing first. This blog may be little bit immoral even if it is not illegal by the provider terms of service. So, if you read this or later sentences, the responsibilities are on you.

—————-

I am going to share an idea that I’ve personally used a bit ago (2009) in my previous office to monitor the server and get notified when any server/service is down. I wrote a small PHP application that would do the tasks. Though I planned that time to blog about it, apparently, I forgot about it. The steps of the idea is:

  • A php chunk checks server status
  • If it finds something unexpected (or may be expected; depends on your logic :)) it creates an event in your google calendar which is due just 1-3 minutes from now
  • If your SMS alert is setup in Google Calender, Google will email you about the event.

Here I will not show how to write a PHP script to monitor server. I just told it as I applied this idea for same purpose. I guess you will get lots if you google it. However, the initial version that I developed just checked site’s homepage (using CURL) and if they were returning 200 response within a sensible time limit. If the response was not 200, it would create the event for me.

How to create Event?

It’s very simple. First of all download the following classes from phpclasses.org

Put them in your project path. Create a php file. Lets assume it is createevent.php. Now include the wrapper file in createevent.php.

Continue reading →

PunBB Twitter – Twitter Updater for PunBB Forum

This morning I got this idea to make an extension for PunBB forum engine that will update twitter status upon new posts and other activities. Few hours back I have completed it.  It may need many many improvements. But yep, its ready for testing.

Current Version: 0.8

Current features:

  1. Configurable account
  2. Update on creation of new topic
  3. Update on reply on topic
  4. Update on new registration (future)
  5. Control update types (v0.5)
  6. URL shortening using to.ly (v.06)
  7. Skip forums. Updates not posted in twitter when posted on those forums.

Do you have any other update idea? please share me. I will add that too.

Click here to see a demo!

Download here. Feedback is appreciated.

Special thanks to Lee Findlow. I have used his class for updating posting message in twitter.