zoot

if it has code, tweak it. otherwise, tweak it.

The web2py web application framework

Monday April 13, 2009 @ 11:20 AM (GMT)

This post relates to my original blog post regarding my search for a suitable web application framework.

I have chosen to give web2py a thorough whirl.

Surprisingly, I have chosen a framework which I hadn’t considered then and one which is built upon the Python scripting language which I have never used before! My language preference has always been Perl, but I’m venturing out of familiar territory. I am by no means a power user of Perl, but have used it extensively in writing web/CGI/FastCGI and sysadmin code. This will be a challenging experiment … learning to code in Python while learning to build web applications in web2py and growing and running my own business, amongst other things :)

This is why I chose web2py, in no particular order:

  • Open source licence
  • Built using a prolific, powerful open source programming language
  • Super simple to setup! (hell yes!)
  • Fast and scalable (apparently)
  • Automatically generated database admin pages for applications
  • PostgreSQL support
  • An opportunity to learn Python
  • Authentication libraries included
  • Intuitive web based IDE

I will post further discoveries, thoughts and experiences as I proceed.

zootzone.com and bandwidth monitoring

Friday March 13, 2009 @ 09:38 AM (GMT)

It’s been a while since my last post; I’ve been busy with my business’ new website zootzone.com. Now that the cosmetic changes of the new brand have been implemented, we’re ready to start introducing more technical enhancements to our service offerings. The most pressing item on the todo list is to automate sign-up and link payments to our merchant facility so that customers are charged to their credit cards.

Having recently moved into our new office premises, a few challenges have arisen. As before, we’re sharing a building with other businesses who also require Internet connectivity, so it makes financial sense to share access, be it a single line, or the bundling of several lines for redundancy. I’m building a bandwidth monitoring application, which will reside on a router, between the internal network and the gateway router; this will record bandwidth consumption per host associated with each business in the building. The system will record traffic associated with each connected host’s MAC address. There are several Linux and BSD based firewall and router options, but most are over-kill for the requirements, or don’t offer fine-grained traffic accounting. I’ll post more on the solution implemented at a later stage, but it is likely to include the use of Perl, BASH and iptables chains on a Linux system. This system will also be enhanced and used on our hosting platform to monitor customer bandwidth use.

Simplify to savour your experiences.

Wednesday November 05, 2008 @ 07:40 AM (GMT)

Cut out the fat – the unnecessary activities, chores, belongings and even people, where their presence in your life only serves to weigh you down. It seems I’m cottoning onto one of the (not so secret) ingredients to a happier, healthier existence. This little pearl of wisdom has been emphasised by seers, religious figures and gurus as a necessary practice in the path to enlightenment.

Isn’t this familiar? – “I’ll call you back, so-and-so is on the other line”, or “I’m not sure I can make it, I may have something else on”. If you haven’t seen how this phenomenon can dominate the social landscape, then perhaps you’re too caught up in it already. People take on too much and in so doing have little time to savour their experiences.

I believe the whole era of “supersize it” with as much sauce, or bling and complexity as possible, is coming to an end. I’m not just talking about my own perspective, but a trend which I’ve noticed popping up all over the place, particularly on the Internet. Simpler on-line applications are starting to take over – not the ones with a million features, but the ones with only the essential features.

Slow down, cut out the clutter and watch the transformation in your experience. I’ve begun to focus on taking my own advice, for a change, and it’s working :)

Tour de Kaap and Double Century

Monday September 29, 2008 @ 07:24 AM (GMT)

The past three days were spent on a bike camp, organised by a friend, Jean van Wyk, as part of our preparation for the Coronation Double Century which is a 205km team time-trial race, to be held on 22 November 2008.

Five of us cycled from Cape Town to Hermanus on the first day, then Hermanus to Franschoek on the second day and finally from Franschoek to Paarl on the third day. We were very lucky with the weather, given that the forecast had been ominously unfavourable. We’re very blessed with spectacular countryside in this part of the world, which contributed to a fantastic few days on the road, from ocean views to rolling Kanola seed fields and awesome climbs to mountain tops.

Unfortunately, road rage ended our bike camp unexpectedly, when a prize idiot purposefully swerved into Greig at 50km/h, because the driver was irritated at being unable to overtake immediately, knocking him off his bike; fortunately he survived, without any broken bones. It amazes me how fellow human beings can be so irreverant and callous towards others.

My business zootzone.com is sponsoring our Double Century team, aiming to finish in 5h50, which should place us in the top 10 out of 200 teams participating. In order to accomplish this goal, I invited a strong team of fellow triathletes and cyclists to join. The team includes podium finishing olympic distance triathletes and accomplished Ironman triathlon athletes, so we’re in a great position to meet this expectation, if we continue to put in the dedicated training hours. A friend, Raoul de Jongh is one of the strong, accomplished members of our team; visit his blog here.

Migrating WordPress

Thursday September 25, 2008 @ 10:56 AM (GMT)

Here’s a quick method for migrating your WordPress blog from one hostname to another, for example http://some.domain to http://other.domain (on the same server). This method was tested on WordPress 2.6.1 with a MySQL database, but should be universally applicable. This method assumes you have shell access.

Create a backup directory

# mkdir ~/backup

Backup the WordPress filesystem hierarchy

# cd /path/to/website/root
# tar czf ~/backup/wordpress_sitename.tar.gz .

Backup the existing WordPress database

# cd ~/backup
# mysqldump -u db_user -p db_name > wordpress_db_name.sql

Make a copy of the existing WordPress database backup

# cd ~/backup
# cp wordpress_db_name.sql wordpress_new_db_name.sql

Edit wordpress_new_db_name.sql and replace all occurrences of some.domain with other.domain
(the following example is for the vi editor)

# vi wordpress_new_db_name.sql
:1,$s/some.domain/other.domain/g

Create the new WordPress database

# mysql -u root -p
mysql> create database new_db_name;
mysql> grant all on new_db_name.* to 'db_user'@'localhost' identified by 'your_password';

Restore the existing database into the new one

# cd ~/backup
# mysql -u db_user -p new_db_name < wordpress_new_db_name.sql

Modify the database name in wp-config.php

# cd /path/to/website/root
# vi wp-config.php
define('DB_NAME', 'new_db_name');

That’s it :)

Feel the awesomeness of thoth

Friday September 19, 2008 @ 12:18 PM (GMT)

I’ve upgraded Thoth to the bleeding edge version (0.3.0) and am now finally able to save a post, or page as a draft – awesome :)

Assuming a fresh installation:

gem install manveru-ramaze --source=http://gems.github.com/
gem install sequel
mkdir -p ~/build/thoth
cd ~/build/thoth
wget http://github.com/rgrove/thoth/tarball/master -O thoth-master.tar.gz
cd rgrove-thoth-265d2921ec072543951107c30b7d8092b48348a9
rake install

The myth of insignificance

Tuesday September 16, 2008 @ 03:54 PM (GMT)

I was talking to some people over the weekend about the eternal debate on whether our lives follow a path, or whether we create our own reality. I think the answer lies somewhere inbetween, but closer to the latter. The former used to dominate my belief system, but the latter has taken its place, given that I now understand that seemingly insignificant decisions have a cascading impact on the collective, or what we tend to view as significant.

Perhaps its the usual ‘wisdom’ of having spent time on this planet, in this form and this reality, realising that every single choice I’ve made has changed my reality, completely. Every single decision, no matter how small, has a profound effect on reality; parting ways with a lover, throwing a paper wrapper on the street, choosing to be offended by an innocent and harmless comment, allowing others to take advantage of your good nature; the list is infinite.

Don’t be fooled by the apparent insignificance of an event. Nothing is insignificant. Everything is inextricably linked, including you and I. Decisions you make affect my reality and vice versa. The Butterfly Effect, related to Chaos Theory comes to mind; the notion that small events create, or contribute to vastly greater ones. A butterfly may flap its wings on one side of the planet and set-off, or contribute to a chain of events which collectively results in a tornado on the other side of the globe.

The aforementioned notion, a micro-view of the complexity of all the processes which occur and make up our reality, is so beautfully simple. It’s these snapshots of the collective that can give us blinding clarity, but only when we’re able to detach from our propensity to believe that we’re separate from everything.

Blog engines revisited

Friday August 15, 2008 @ 09:45 AM (GMT)

My blog engine research continues. This week I’ve test-driven the following, well-known platforms.

Typo (Ruby on Rails)
Textpattern (PHP)
WordPress (PHP)

The most striking aspect of how my impression of these has been shaped, relates to the documentation and resources available. WordPress wins, hands-down. I’m not surprised in the least as to why WordPress is so popular; it is accessible in the extreme. Installation was trivial and a plethora of information on extending the platform through plugins, themes and other modifications, is available on the WordPress website.

I shall continue my appraisal of all of the above as soon as I have more time to spare.

Note however, despite my enthusiasm for WordPress, my blog will, for the time being, remain powered by Thoth. It’s simplicity, speed and ease of use for someone of my technical ability overshadows my desire to use something shiny like WordPress, which includes so many features, bar the kitchen sink and a cappuccino machine.

More to follow …

Go ahead, send me ...

Friday August 08, 2008 @ 10:32 AM (GMT)

The title of this post is part of the slogan for the DSPAM content based SPAM filter, which is a component of the arsenal of chained-together tools which my business uses on its servers to combat unsolicited email. DSPAM is extremely accurate, if setup and ‘trained’ correctly.

This post is really about another component of zootzone.com’s anti-spam tool-kit, an SMTP server called qpsmtpd. One word describes its effectiveness: AWESOME. We block thousands of suspicious SMTP connections a day, before the unwanted messages are even queued to disk! That being said, the mail servers on our infrastructure are now running under a vastly reduced load, given the reduced volume of SPAM to process prior to delivery to users’ mailboxes.

What is so powerful about qpsmtpd, is that one can write plugins which intercept the SMTP communication at various stages, from the initial connect, right through to the DATA submission phase. An example would be the blocking of connections from dial-up, or DSL connected computers, which are inadvertently compromised SPAM zombies, or people sending SPAM to earn extra money. If you’re a system administrator, or ISP decision-maker, it is in your best interest to implement this incredibly powerful SMTP server.

Time management

Thursday August 07, 2008 @ 01:37 PM (GMT)

I haven’t posted in a while, for good reason. Running a business and keeping fit, with play time to spare over the weekends and occasionally during the week, is a challenge to say the least!

Perhaps it has become more of a challenge because my priorities have shifted from training to work; it’s winter, so it’s also easier to justify skipping workouts! Actually, it’s more about time management and will power. Channeling the latter into my work is a habit which I’m remastering, day by day. Make no mistake, I’m passionate about my business and the work it involves, but I’ve succeeded in programming myself to focus heavily on my sporting goals, given how incredibly rewarding that has become, both from an emotional and physical perspective. Now, it’s time to programme a more vigorous work-ethic into my subconscious!

My abridged short-term TODO list:

  • Work on a better balance between work and play
  • Grow my business aggressively
  • Switch back to an early-bird routine
  • Focus on tweaking my time management skills
  • Train smarter

That’s it for today :)

Copyright © 2010 zoot. All rights reserved.
Powered by Thoth.