Wordpress: Security check for your Blog

Most of the bloggers ignore various security loop-holes in their Wordpress installation, thinking that the chances of Crackers intruding their small and unpopular websites are slim. Never even think of this. No one is going to check your page rank or Alexa rank before hacking your site, so better secure it now than to regret later. There are a lot of wordpress plugins that will do the job for most users. But if you are a freak like me, keep reading to know how to secure your blog without installing any wordpress plugin. Here is a list of methods that will enhance the security of your blog:

October 15, 2009 · 5 min

PHP: Select HTML elements with more than one css class using XPath

Recently, while working on my project FeedAPI ImageGrabber I came across the issue where I had to select HTML elements by a given css class. The HTML element can have a single CSS class: [cc lang=“php”] [/cc] or multiple CSS classes associated with it. [cc lang=“php”] [/cc] Now if you want to select the HTML elements with class “foo”, this div element would be one of them.

October 2, 2009 · 1 min

Tutorial for FeedAPI Image Grabber

Updates: Feeds Image Grabber has been released to support the new Feeds module. (3 march 2010) Tutorial for Feeds Image Grabber (FIG) published. (6 march 2010) Demonstration Website is available here. (6 march 2010) I get a lot of requests for this, so here is a tutorial explaining the 3 W’s (What, Why and How) of FeedAPI ImageGrabber. Motivation [caption id=“attachment_258” align=“aligncenter” width=“570” caption=“a feed item from google reader”] [/caption] This is a screenshot of a news item from my Google Reader. Anyone who has a moderate knowledge about the feeds would know that the image on the left in the above news-item is actually not published with the feed. In other words, If you refresh any feed on your Drupal website using FeedAPI, you won’t get the image in the posts, unless they are published along with the feed which is quite rare. The purpose of FeedAPI Imagegrabber is to make the feed more informative as well as interesting for the user. As, we all know that “comics are much better than novels”, this module appends the feed-item with an appropriate image from its content URL. The goal of the FeedAPI ImageGrabber is to mimic the thumbnail display of Google Reader for the feeds on your Drupal website. As soon as you refresh the feed, ImageGrabber automatically attaches an appropriate image from the original article to the feed-item node on your website. You don’t even have to press an extra button!!

September 20, 2009 · 5 min

Withdraw PayPal Money Directly to A Bank Account in India

PayPal is used by a lot of online merchants to accept payments for the products they sell online. PayPal can also be used to accept donations for your technical open source projects or charity organization. Recently, I opened an account with PayPal to accept payments from my clients who reside outside India. Before I started, I searched for reviews on PayPal which seemed quite horrible. You can read a lot of them here. But then I needed the payments and had no other option (without spending a huge transaction amount), so gave it a try and I am happy that my experience with them till now is excellent. So, here is a step by step procedure to Withdraw funds to your bank account in India.

September 16, 2009 · 2 min

MYSQL: MINUS (Set Difference) Operator

Often we need MINUS operator as defined by the SQL definitions i.e you have two sets P and Q and you want P-Q which gives all the elements in P that are not in Q. But unfortunately, MYSQL does not have any operator for such an operation (yeah, I had the same reaction when I heard this!!). So here is a way how you can implement it in MYSQL. For simplicity let us consider we have two tables P and Q (we can also have views, joins, etc instead of the tables here) which have atleast one column in common (say id, which usually will be the primary key) and we want to evaluate P - Q which removes all those rows from P whose id is present in Q....

July 16, 2009 · 1 min

MYSQL: Get the Auto-Increment Values after Insert Statement

Until sometime back, I was unaware of how I could get the value of an auto-incremented field after an Insert Statement. But recently I needed it for two of my projects simultaneously, so I explored the possibilities. As one of my project is in Java and other is in PHP, we will go through both of them. So, here is the problem. In general, the PRIMARY KEY field is the AUTO_INCREMENT field. Now wen you insert a row, a new key is generated and you can’t get it through usual way as this row can be accessed only using the primary key. So here is how it can be done:

July 15, 2009 · 2 min

Sorting a 2-Dimensional Array in Java

Recently while working for my project, I came across this situation when I had a 2-D array and I needed to sort it twice on 2 of its columns. Consider the following 2D array: [cc lang=“java”] String[][] testString = new String[][] { {“1”, “2”, “6”}, {“4”, “5”, “3”} }; [/cc] Sorting the above 2D array on zero column will give [cc lang=“java”] { {“1”, “2”, “6”}, {“4”, “5”, “3”} } [/cc] whereas sorting it on second column will give [cc lang=“java”] { {“4”, “5”, “3”}, {“1”, “2”, “6”} } [/cc] I did not want to do the most common as well as tedious thing, i.e. write my own sorting function like this: [cc lang=“java”] public void myOwnSort(String [][] exampleArray) { //code for sorting the array according to my wish. } [/cc] I wanted to avoid this for 2 resons: I would have to write the code for it ( lazy me!!). Secondly, I can possibly never match the efficiency provided by the sorting functions of java.util.Arrays

July 5, 2009 · 3 min

Election 2009: Congress won or BJP lost?

Election results are out, and as I expected Congress completely overruled BJP, grabbing more than 200 seats. Do not shout that my expectations turned in favor of Congress after the election results, for proof you can ask my friends (with whom I kept fighting why BJP should not come to power!!) or just visit FriendsOfBJP where I posted several issues that were wrong in the BJP’s manifesto but unfortunately they were so confident about their views that they(supporters of BJP) kicked me out from the site (and calling me a christian, a fool, etc. ) I would like to clarify that I am not in favor of any political party, but when I have to choose I will never choose BJP over Congress for the following reasons (I am again enumerating them here not to tease the BJP supporters over their loss but so that they can improve for next elections rather than blaming media for bad publicity or congress for enjoying privileges):

May 23, 2009 · 4 min

Sharing and Bookmarking Tools

It takes me quite a lot of time to write a post here, mainly because I have very less going on in my life at the moment. But if you were following this blog closely (I know you weren’t :) ), you might have noticed that I kept playing with the SHARING and BOOKMARKING tools. I started off with the bookmarkify, then tried addthis and then finally settled for tellafriend. Although, I am still thinking of shifting back to Bookmarkify, right now I am sticking with TellaFriend. As far as the features are concerned, they all almost provide the same kind of features. All of them provide access to over 50 Bookmarking sites, not to forget the “Email this” option. Here is a short review on the following Bookmarking tools.

April 14, 2009 · 3 min

Drupal: FeedAPI Imagegrabber

Feeds Image Grabber (FIG) was released on 3rd March 2010, to support the Feeds module. Introduction FeedAPI Imagegrabber is a add-on module for FeedAPI. It consists of a parser which visits the original URL of a new feed item, and retrieves the main image from the post. Once the main image has been retrieved, it is then converted into a thumbnail using the ImageCache module, and stored in the node created by FeedAPI, inside a CCK field. The purpose of FeedAPI Imagegrabber is to make the feed more informative as well as interesting for the user. As, we all know that “comics are much better than novels”, this module appends the feed-item with an appropriate image from its content URL. The goal of the module is to mimic the thumbnail display of websites such as digg.com. This goal is acheived by using FeedAPI to turn RSS feed-items into nodes, and then using FeedAPI Imagegrabber to append these nodes with an appropriate image from the feed-item’s webpage.

April 5, 2009 · 4 min