HOWTO: Build a simple REST API using Python and Flask

In this tutorial, I will walk you through how to setup a simple REST API using Python and Flask microframework. We will be hosting our code in Github repo and pushing the code to Heroku.  Continue reading “HOWTO: Build a simple REST API using Python and Flask”

MetalIndia Magazine website launched

It gives me great pleasure to announce the launch of MetalIndia Magazine website.

After being in hiatus for almost a year, extreme metal magazine, MetalIndia Magazine, is back with a vengeance. MetalIndia Magazine is now alive and headbanging at a new location sporting a new killer design and logo. All the content from the old site is now available on the new site and new brutal content has been added for your reading pleasure. You can read the first three MetalIndia Magazine print issues online here.

If you are band/label/manager/fan, send us your updates to be added to the website. If you are a webzine and wish to exchange links/banners/ads, get in touch with us.

You can follow MetalIndia Magazine on Twitter or join us on Facebook or Reverbnation . Do visit the site and let us know your comments/suggestions.

WordPress vs Custom Code

I run a heavy metal music news aggregator website called Sonic Assault. The site has been running since 2003 and displays latest headlines from major news sites like Blabbermouth etc. The site uses screen scrapping technology to gather the headlines and links back to them. A cron job is setup to go out to the sites and grab the headlines and dump them into the database which are then displayed. The code works fine as long as the headlines are published in the proper pattern. However, it is a nightmare to manage if things start to break. I have been considering moving from the screen scapping to parsing RSS feeds. With RSS feeds becoming mainstream with mass adoption and more and more sites providing RSS feeds, it would be a much easier and structured way to get headlines from these sites. I have been contemplating whether to build the site using WordPress or using custom coding using PHP.

WordPress is an excellent CMS tool and has a multitude of plugins which can add functionality and extend it usability. Various plugins like Wp-O-Matic can make fetching RSS feeds easier which is required by my website. So, it is just a matter of developing a theme and using the plugins, we are on our way. On the other hand, building a site from scratch using custom coding can take time as we need to think right from building the database tables, coding the logic, displaying data etc. But with custom code, we have the flexibility to build the site without having to learn about the intricacies of WordPress. In case of future enhancements, coding it in WordPress would have a learning curve whereas with custom code it is much more flexible. In this scenario, WordPress looks like a tactile (short term) solution while custom code is more strategic (long term).

I am still not able to decide which way to go for with the new website. If someone has been in similar situation would appreciate if you could give your inputs. Are there any other alternatives which I should consider like Joomla or Drupal ?

Change GRUB command line

While installing Ubuntu on my old laptop, I had to manually enter the pci=noacpi to the boot parameters so that it would boot. I searched how to add it permanently but the GRUB settings were not the same as I searched. So, I tried to search and change it myself. Here are the steps I performed to add the extra parameters at the end of the boot command.

Open the /etc/default/grub in your favourite editor.

vi /etc/default/grub

Locate the GRUB_CMDLINE_LINUX in the file and add the commands you need between the quotes.

Once this is done, we need to regenerate the grub.cfg file. To do run the following command

sudo update-grub

This updates the

/boot/grub/grub.cfg

file

You are all set. Just reboot and press “e” to check if the new parameters are present and from next boot onwards it should work fine.

OpenSUSE 11.2 Released

OpenSUSE 11.2 GnomeOpenSUSE announced the release of their latest release 11.2 yesterday. The new release has a bucket load of updates and features included. The new release includes KDE 4.3 which is much more stable than before along with new versions of Mozilla Firefox and Openoffice 3.1. The release also includes a new theme designed specially for 11.2 release. Along with KDE, 11.2 release has also got an upgraded version of Gnome, version 2.28. This release includes a brand new theme, Sonar, improved software update application, improvements in GNOME’s Webcam and video application, Cheese, and many other enhancements and improvements to prepare the GNOME platform for GNOME 3.0 in 2010. For the social networking fans, the 11.2 release includes Gnome and KDE microblogging clients like Choqok and Gwibber by default. Nautilus now has a plugin to allow quick and easy file sharing. Just right-click on the folder you’d like to share and select “Sharing Options.” This makes use of Samba, so you need to enable directory sharing under the Samba Server module in YaST.

OpenSUSE 11.2 KDEUnder the hood, the release includes the latest Linux kernel 2.6.31 and next generation Ext4 or btrfs  file system. Another addition to the features is a tool to remotely manage application installation from the web, WebYaST: a web based remote managment tool. Upgrades would become easier using Zypper and users are recommended to do so.

So, if you are interested in trying out the latest OpenSUSE release, head to the software to download and take it for a spin. Download OpenSUSE 11.2 here

Working with Eclipse and Code Igniter

eclipsecodeigniter_ideTill recently I had been using my trusted editor, Notepad++, for doing all my development work. Not that I am not using it anymore, but I was looking for something more powerful and integrated, something like an IDE. I had tried few IDEs including Eclipse before but did not get much into it and hence left it there. I picked up Eclipse again and tried to give it one more try. I also tried out Aptana which is another awesome IDE built on Eclipse with all the web development tools you need built into it out-of-box (PHP, Ruby, jQuery, Python). Continue reading “Working with Eclipse and Code Igniter”

Magic Mime Database Workaround

Timthumb is a very useful PHP script used heavily to resize images on the fly in many WordPress themes. Timthumb uses a PHP function FINFO_OPEN to get info regarding the image. The function FINFO_OPEN uses a magic.mime database, which is basically a text file, to get information regarding the type of image. Many hosts (like mine) do not provide the magic.mime extension and hence the script cannot resize the image on the fly. The magic.mime file if present is present at /usr/share/magic.mime. However, if the host does not provide it, there is a workaround to get the magic.mime file working with the Timthumb script.

The FINFO_OPEN function takes the path to the magic.mime file as a parameter. You could download the file and put it in the same directory as the Timthumb script and test out if the images are being resized. The code which needs to be changed should look like this :

$finfo = finfo_open(FILEINFO_MIME, "./magic.mime");

You could get the magic.mime file from any Apache installation. WP.com does not allow me to upload a .mime extension file or else I would have upload it here directly. Let me know if you need the magic.mime file.

Job Trends: Ruby shows 1200% growth

Job Trends: PHP, Ruby, Python, Perl, C#

In my previous post, I mentioned about the trends in PHP frameworks and was curious to know if there is anyway to know the job market for those frameworks. I did not find any such trends, but what I came across was trends or popularity of programming languages.

Indeed.com is a job search engine site which searches various job sites and shows results. They have an interesting utility to see trends using search terms. I did a comparison of popular programming languages namely PHP, Ruby, Python, Perl, C# and the result is clearly showing Ruby has gained 1200% in the past 4 years. The graph shows “relative” trend (as compared to “absolute” trend) comparing the number of jobs being advertised for Ruby as compared to other languages. The runner ups were Python and PHP. Ruby has gained a lot of popularity in the past 4 years and it is good to see that programming languages are getting popular again specially the open source ones in this struggling economy. Is it time to learn Ruby and Python?