Categories
PHP

Forwarding Google Page Rank to New URL

Hello everyone! 😀

As many of you might already know that I’ve been blogging for a long time now. First on Blogspot, then on wordpress.com and later to my self hosted wordpress 🙂 A few days back, I purchased a new domain — http://masnun.me is the new URL. I first hosted it on Google App Engine and kept my wordpress blog on masnun.com. I wrote a custom publication engine on GAE to make posts. I added a good number of features to it. But later I realized that GAE has no support for full text search. This pissed me off! I know I can hack to bypass that restriction (may be storing all keywords in a StringList type) but WordPress is amazing! Moreover, I realized that WP is already seo google, has a Google page rank 3 and most importantly earns me money from advertisements.

I finally decided to host masnun.me on my Umbrahosting account. Installed a fresh copy of WordPress, imported all previous data and then deleted the old blog. But what about the search engine factor? The previous blog had PR3 while the new one is not yet recognized in Google 🙁 Well, looks like I’m not out of luck properly. If Google finds certain URLs to forward to a new location with a “HTTP/1.1 301 Moved Permanently” response header, it’ll crawl the new pages and forward all attributes (PageRank included) to the new URL.

So, in my previous WP Directory, I have kept my WordPress .htaccess file intact and changed the contents of the index.php file to send a “HTTP/1.1 301 Moved Permanently” header and then forward to the new URL.

Here’s the code:

Update: If your blog was on a sub directory – “blog”, delete that directory and put the following codes in the index.php file on the root of your previous URL:

It’s working just fine! 🙂

Categories
Uncategorized

Get random desktop wallpaper from Bing on Windows 7 :D

Have you heard about Bing? Yes, the wonderful search engine from Microsoft! Have you used it ? Yes? Then you probably know that Bing features a beautiful photo everyday as it’s background image and provides information snippets on different position on the image. You should check this thing if you haven’t already. The photos are just amazing!

I used to leech those photos to make my Desktop wallpaper by right clicking and saving the background images. 😛 But now we have something interesting! You just don’t need to go to Bing daily and save the images manually. You can get random photos from Bing set as your desktop background by installing a theme named “Bing Dynamic”. It downloads Bing photos from the internet and rotates on your desktop. Cool, eh? 😉

Get the “Bing Dynamic” from the official Windows 7 themes page and install it on your PC. Apply the theme and enjoy! 😀

Categories
Python

.NET Framework and IronPython

I am a Python programmer and a Python enthusiast. I love the expressive syntax of the language. I have used it for automating my tasks and developing web sites. I have developed PyQT desktop apps as well. Today I am going to focus on IronPython, another cool distribution of Python programming language. It’s based on the .NET platform introduced by Microsoft. It aims at providing a dynamic runtime language for the .NET platform.

I am using genuine Windows 7 on my Notebook PC. I’ve been trying to install Microsoft Visual Studio 2008 for the last couple of days. But I failed every time. I guess it’s happening because I am using Windows 7 64bit edition. After repeated failure with VS2008, I decided to try .NET platform with Python. So, I went to IronPython home page (see link at the bottom) and browsed the downloads section. By default, it prompted me to get IronPython 2.6 for .NET framework 4.0. I didn’t have v4.0 of .NET installed, so I downloaded the one for .NET 2.0 instead. Tell you what, .NET 4.0 is more than 40 MB download and I am running a bit tight on available data transfer 😛

The setup was pretty easy. I ran the MSI file and it installed for me. But in case, you don’t have .NET 2.0 installed, you’ll need to get that. (See link at the bottom).

After installing IronPython, I noticed a cool looking IPY (IronPython :P) console. It works just like the interactive python shell. Remember, the version I installed didn’t put IPY in the system path. So, typing “ipy ” on the command line will simply fail. Please go to: Control Panel\System and Security\System > Advanced System Setting > Environment Variables. Then append the path of IronPython to the “PATH” variable. Now restart “cmd” 😀 Now, you can execute any Python script with IPY.

Here’s a sample “Hello World!” GUI I wrote to test IPY:

You have to import the “clr” module first. Add a reference to the .NET namespace you want to use. Then use that namespace just like a Python module.

Cool. Isn’t it? So, why should you use IronPython? Good question. Most windows users will by now have .NET framework 2.0 or later installed. The IPY installer is only 6 MB. The end user of your application will need to download less and install less. Please remember PyQT and wxPython are pretty heavy. JAVA requires a huge installation as well. IronPython cares both about you and your users. You get a fantastic expressive language and an excellent platform. Your users get the ease and comfort of installation. Also remember, with Mono, IPY is now cross platform. So your programs will run on other operating systems as well.

With IronPython you can do so many things — develop ASP.NET web sites, work with Robotics and Silverlight, develop games with XNA and build robust programs. So if you’re a Python programmer, come on and mix up .NET and your python wizardry to create something awsome 😉

Resources / Links:
IronPython Home Page
IronPython Download
.NET framework 2.0 Redistributable Package
IronPython Cookbook