Thursday, December 29, 2011

PyCK - A New Python Web Framework

I have started developing a new python web framework based on Pyramid. Work done so far is at github: PyCK at github. Here's a quick summary and reasoning:

INTRODUCTION

PyCK (Python Code Karigar); prounounced 'pick' is/would be a web development framework aiming to provide an easy to use yet powerful and flexible web framework for python developers.

BACKGROUND

Of course, there are already a lot of great frameworks present for python like Pylons, Django, Pyramid, BlueBream (Previously Zope), TurboGears2 that provide really cool features for developing web applications in python, I feel like there was still something missing for my taste. So you can say that this project is starting to satisfy a personal itch.

Why Create PyCK?

Of all the frameworks mentioned above I liked some features of one framework and other features of another framework. Unfortunately I wasn't able to find all those features I like in any existing framework. For example Django probably is the most popular framework in python and for good reason, it has pluggable apps, extensible extensions like its admin panel, a lot of useful documentation and great community support. One of its biggest strengths is that a lot of apps are available for it which can be "plugged" into a new project to get things started really quickly. The problem is that django is very "opnionated", the choices like ORM, templating language, URL dispatching mechanism are all made for the developer and you are mostly stuck with them unless you are willing to put in a lot of extra effort into it.

Consider the following scenario, my favorite ORM is SQLAlchemy and for good reason. I can develop command line applications, traditional GUIs in GUI toolkits like Qt, GTK etc all using SQLAlchemy as the ORM to interact with the database. Now if I decide to use django, I need to learn and use its ORM, why can't I use the one I already am familiar and proficient with? Though I can but that breaks a lot of stuff in Django.

Pylons and Pyramid on the other hand are very "non-opinionated" frameworks. They both are very flexible and I really like the way things are done in these frameworks. I can use SQLAlchemy or any other ORM like SQLObject etc if I like. I can choose the templating language I want to use (which BTW would be Mako). I can choose the URL handling mechanism (in Pyramid) be it URLDispatch or Traversal. But this flexiblity comes at a cost, building "ready-made" components for such frameworks isn't easily possible because we are not sure what the framework user will pick as technologies. So having pluggable apps or pre-built admin panels etc because tough.

So the solution? at least for me; I decided to build a framework based on Pyramid that makes the choices for the developers. If your choices are the same as mine, this framework would be ideal for you. Or if you are a new developer looking into python frameworks you can start here (just not right now since the work has only started yet).

FEATURE PLAN

And what exactly are the choices?

  • Use SQLAlchemy as the ORM
  • Use Mako as the templating language
  • Use URLDispatch as the resource location - URL to code mapping mechanism
  • Design should support Pluggable applications similar to Djano
  • Should have easily extendible components like an admin panel, etc
  • Allow web applications to be easily Themable
  • Use Dojo for UI components, AJAX etc
  • Ability to easily specify separate view templates for mobile devices (using Dojox.mobile)
  • Automatic form generation from database/SQLAlchemy models (looking into possible options like sprox, formalchemy, wtforms, deform, etc)

Sunday, October 16, 2011

My QRCode for use with any QRCode reader.

and a smaller version

Saturday, October 15, 2011

Shell scripting notes

I have uploaded some lecture slides for bash shell scripting that give an introduction to shell scripting on Linux. These are shared at google docs and can be accessed at:


https://docs.google.com/leaf?id=0B46eQU9qyhwrODJlMDdjNzUtMDNkNS00ODczLTk0MTUtYTIxZDhiOTlhNjYy&hl=en_US

Tuesday, February 1, 2011

setting up VMware 7.1 with kernel 2.6.36.x

If you are reading this post, you probably know what virtualization is and that VMWare is the most popular virtualization solution. You can use VMWare player (free) to run virtual machines already created by others for you or you can try VMWare server (free) or VMWare workstation (paid) to create your own virtual machines.

There is one problem though, VMWare 7.1.x releases (the latest at the time of this writing) are incompatible with 2.6.36[.x] kernel series. In order to run correctly VMWare products compile a few kernel modules that they use upon first startup. The process normally works without a problem if you are using a stock kernel from your distribution but may fail if you have a different kernel (my case). The error you get is:

"Unable to build kernel module.

See log file /tmp/vmware-root/setup-NNNNN.log for details"

Fear not as there is a patch out there for solving exactly this problem. Here is what you need to do.

1. Download the patch from


2. Save the patch to your /usr/lib/vmware/modules/source directory.

3. Extract the sources:

tar xf vmblock.tar; tar xf vmci.tar; tar xf vmmon.tar; tar xf vmnet.tar; tar xf vsock.tar

4. Apply the patch:

patch -N -p1 < vmware-7.1-2.6.36-generic.patch

5. Compress the archives again:

tar cf vmblock.tar vmblock-only; tar cf vmci.tar vmci-only; tar cf vmmon.tar vmmon-only; tar cf vmnet.tar vmnet-only; tar cf vsock.tar vsock-only;

6. Now just start your VMWare product and it should compile the modules without any problems. You can also compile and install the modules from the command line using the command:

vmware-modconfig --console --install-all

Many thanks to Ad0@#vmware [freenode] & archangelamael, balding_parrot, pure_hate@#backtrack-linux[freenode] for their help, tips and guidance.

Thursday, December 30, 2010

Miss Slax? Meet Salix

If you miss the old slackware linux based live cd distribution slax, you should give a try to Salix.

http://www.salixos.org/wiki/index.php/Home

Very nice distribution keeping the slackware philosophy in mind. There are various flavors and a few interesting installation options. Specially check out the live cd modifier and installer programs.

Sunday, December 12, 2010

Moving public work to Github

Just started moving my OpenSource utility code modules and other projects to GitHub - yes I have converted from SVN to Git.

My repository can be found at: https://github.com/kashifpk