Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Kongoni Aristotle Screenshots

Although it feels a little silly to only post these now, considering that Sophocles is not too far off, but as they say, better late than never. :)

Ubuntu 9.04 + MySQL 5.1 + phpMyAdmin

If you installed the mysql-client-5.1 package on Ubuntu Jaunty (automatically comes with mysql-server-5.1) and wish to install the phpmyadmin package afterwards using apt-get or aptitude, you might have a problem. Since the phpmyadmin package has mysql-client-5.0 as a dependency, which conflicts with mysql-client-5.1, your package manager might try to uninstall 5.1 and give you 5.0 instead.

I managed to bypass this issue using the following command:

sudo aptitude install phpmyadmin mysql-client-5.0: mysql-client:

As far as I understand from the aptitude man page, this simply cancels the install of the mysql-client-5.0 and mysql-client packages.

phpMyAdmin does warn you though:

Your PHP MySQL library version 5.0.75 differs from your MySQL server version 5.1.31. This may cause unpredictable behavior.

Any better way of doing this?

Ubuntu and Xubuntu 9.04 (Jaunty)

Since I was at it anyway, I thought I should install the ubuntu-desktop and xubuntu-desktop packages as well and got Gnome 2.26.1 and Xfce 4.6.0. Took some more screenshots:

Web Development with Ubuntu Jaunty

There are quite a few packages that come "standard" (so to speak) for Ubuntu that is of particular interest to web developers. I thought I should compile a small and probably far from complete list, for those interested. I included the version numbers simply for easy reference, and of course those are subject to change.

Unfortunately I have not yet had the opportunity to play with most of these; if you happen to have any good or bad experiences, please feel free to share. Also, as mentioned previously, this list is far from complete; if I missed any good ones, please comment!

Coffee Update

It's been quite a while since I last posted a proper update on my excessive consumption of the precious black liquid generally referred to as "coffee" by English speakers.

Firstly, I have been trying out some of the ground coffees from Spar. I don't like Blue Mountain personally, but the Espresso and the Mocha Java were quite good, especially considering the price (R28 for a standard 250g bag).

I also tried the Wiener Mischung from Global Coffee Exports. Drinkable, but I wasn't personally too impressed, I must admit.

Then I gave the Vienna Gold from Baruch a try. Very nice aroma, although not a dark enough roast for my personal liking, but still gets the thumbs up.

Ciro Wiener Mischung - I was impressed last time with their Connossoir and am even more impressed with their Wiener - definitely recommended!

Then lastly, I am currently giving Caturra Connossoir a shot. Again, I was impressed last time with their Mocha Java and even more impressed with this. Great stuff.

Yeah, and that's about it for now. :)

Kubuntu Jaunty

Ok, this is actually not a normal Kubuntu install. I started off with a clean Ubuntu 8.04 (Hardy) Server installation, then did the following:

  1. sudo sed -i s/hardy/jaunty/ /etc/apt/sources.list
  2. sudo apt-get update
  3. sudo apt-get dist-upgrade

After rebooting, I installed the kubuntu-desktop package and got a nice KDE 4.2.2 setup to play with. Decided I should take some screenshots (see start of post).

KDE 4.x on Ubuntu 8.04

After giving KDE 4.2 a shot on Kongoni, I thought I should try out KDE 4 on Ubuntu 8.04 (Hardy Heron). This was on a clean server install of Ubuntu 8.04.2. Yes, I am aware that Jaunty was just released, but I tend to stick to LTS releases because upgrades can be a bitch at times.

For some reason I expected there to be a KDE 4.2 package available on the default repositories, but unfortunately I ended up installing the kubuntu-kde4-desktop package which currently ships 4.0.3. I didn´t expect the differences to be big, but apparently it is!

Then I decided to give the kubuntu-members-kde4 repository a try. I inserted the following into my /etc/apt/sources.list:

deb http://ppa.launchpad.net/kubuntu-members-kde4/ppa/ubuntu hardy main
deb-src http://ppa.launchpad.net/kubuntu-members-kde4/ppa/ubuntu hardy main

I then did the usual apt-get update and apt-get upgrade but after that finished, I realised that I should have tried apt-get dist-upgrade instead as most of the upgrades seem to have been held back the first time.

On the forums, I was told that this should install KDE 4.2, but in reality it gave me a copy of 4.1.2. Much better, but I still want 4.2. Oh well, time to give Jaunty a try I guess. :)

MySQL 5.0.67 on Kongoni Aristotle

Here is how I got MySQL server running on Kongoni:

  1. $ su
  2. # portpkg -s
  3. # portpkg mysql
  4. # mysql_install_db --user=mysql
  5. # mysqld_safe &
  6. # mysql_secure_installation

Skype 2.0.0.72 on Kongoni Aristotle

Skype on Kongoni Aristotle

Getting Skype to work on Kongoni was surprisingly easy:

  1. $ wget http://www.skype.com/go/getskype-linux-dynamic
  2. $ tar xjf skype-2.0.0.72.tar.bz2
  3. $ skype-2.0.0.72/skype

VoteZA: South African General Elections 2009 Twitter Mashup

The other day I was busy hiking up the Outeniqua mountain with Joke and while we were busy walking home, I came up with an idea to create some type of elections Twitter mashup. And so VoteZA was born.

I think the introduction says it best:

If you happen to be a Twitter user and you wish to publicly add your support for the political party of your choice, please click the "Join" link next to their name below and post the given message to your Twitter stream. If you would like to see a list of supporters of a particular party that currently has any listed, simply click on the party's name.

This application has been created by a South African web developer in his personal capacity and is not official or in any way linked to the Independent Electoral Commission or another government body. This simply aims to serve as a directory of Twitter users that happen to support a particular political party.

If you do not see your party of choice listed or you happen to spot any other problems, please get in touch so that we can make the necessary corrections.

You can monitor updates to the supporter lists by following @voteza and you can remove yourself at any time by posting @voteza remove. Updates to the supporter lists should usually be processed in five minutes or less. If this is not the case, kindly let us know and we will look into it as soon as possible.

The most common question I get is why I'm not allowing anonymous "votes". Firstly, this would greatly increase the risk of abuse, but that's not the point anyway. There are a lot of anonymous voting services out there. There has been a lot of speak about the elections recently and the whole idea of this mashup is creating a list of individuals who publicly support a specific political party to help us all to follow the conversation.

Feedback very welcome!

Apache 2.2.11 + PHP 5.2.9 on Kongoni Aristotle

I wanted to start running some simple PHP scripts on my Kongoni Linux desktop and managed to get it sorted as follows.

Firstly, although this is an install of Kongoni Aristotle, I configured Portpkg to use current instead of the default 12.2 as the target value as follows:

  1. Run the pp-config command as root.
  2. target should be selected; press the return key.
  3. Change the value to current and press the return key.
  4. Press the tab key to select Quit and press the return key.
  5. Synchronise the ports tree by running portpkg -s as root.

Now, you need to install Apache 2.2. Simply run portpkg httpd as root. After this is done, fire up Apache by running apachectl start, again as root.

Before running Apache, make sure your local interface is up. I don't know why, but this was not the case on my system. Run ifconfig (if you have trouble running this as a normal user, try running it as root) and if you don't see an interface called lo then issue the command ifconfig lo up as root.

Now go to your browser and attempt to open http://localhost/ and see what you get. If you get a page telling you It works!, you should be fine.

Now on to installing PHP. Firstly, make sure you have the latest version of libmcrypt installed as PHP will be looking for this. Simply run portpkg libmcrypt as root. After this has been installed, run portpkg php as root. You could probably do these two together by running portpkg libmcrypt php instead.

Now you need to make sure Apache is configured to use PHP. Edit /etc/httpd/httpd.conf and uncomment the following line (in other words, remove the # on the front):

#Include /etc/httpd/mod_php.conf

Now, create a test page. I deleted the default /var/www/htdocs/index.html file and created /var/www/htdocs/index.php instead, simply doing a standard phpinfo:

<?php phpinfo(); ?>

Go back to your browser and open http://localhost/index.php. If you see the source code, Apache is not yet correctly configured to use PHP.

You need to restart Apache for the changes to take effect. I tried apachectl restart as root but nothing seems to have changed, so I did a separate apachectl stop and then apachectl start and after reloading the above page in my browser I got the proper phpinfo display.

Now go back to http://localhost/. This should show you your /var/www/htdocs directory contents. If this is the case, you need to find the following line in your /etc/httpd/httpd.conf:

DirectoryIndex index.html

Simply change this to the following:

DirectoryIndex index.php index.html

Restart Apache again as described above and you should now see the phpinfo display instead after reloading the page in your browser.

Please comment with any questions / problems / suggestions for improvement. Thanks!

Basic SNMPD Configuration for MRTG on Ubuntu 8.04 (Hardy Heron)

Yesterday I wrote an article on how to set up MRTG + SNMPD on Ubuntu 8.04. If you followed my instructions, you might now be wondering how to get rid of the default SNMPD configuration that makes MRTG display something like the following:

System: my-server-hostname in Unknown (configure /etc/snmp/snmpd.local.conf)

Maintainer: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)

You can simply change this directly in the generated /etc/mrtg.cfg file but if you want to correct it at the source, in the SNMPD configuration, you could do the following.

The easiest way I know of to do this using the command line is to use the snmpconf utility. This is included in the snmp package, so if you haven't done so already, you need to install this package in order to continue. For example, if you prefer to use apt-get:

sudo apt-get install snmp

Contrary to the above message, do not attempt to change snmpd.local.conf as this file does not even exist.

By default, the snmpconf utility will create the modified configuration files in your current working directory, but you can use the -I flag to save them back to /etc/snmp directly to save some time. For example:

sudo snmpconf -I /etc/snmp

I tried the -i option a bit earlier but this saved them back to /usr/share/snmp.

Now the fun starts:

  1. Select /etc/snmp/snmpd.conf.
  2. Select snmpd.conf.
  3. Select System Information Setup.
  4. Select The [typically physical] location of the system..
  5. Enter the desired description of the location of your system. Do this in whichever format you like, it's a "free text field" (as some like to call it).
  6. Select The contact information for the administrator.
  7. Enter your name and whichever contact details you prefer. Again, no specific format is required. I normally enter something like Charl van Niekerk <charlvn@charlvn.com>.
  8. Enter finished.
  9. Enter finished again.
  10. Enter quit.

Now you need to reload your SNMPD configuration:

sudo /etc/init.d/snmpd reload

Finally, you need to regenerate your MRTG configuration:

sudo bash -c 'cfgmaker localhost > /etc/mrtg.cfg'

To see the results immediately, manually run mrtg:

sudo env LANG=C mrtg

You should now see the changes in the generated HTML output. Please comment in case you hit any obstacles not mentioned above!

MRTG + SNMPD on Ubuntu 8.04 (Hardy Heron)

Here is a rough howto for setting up MRTG and SNMPD to generate graphs of the traffic on your network interface(s). This is by no means the only way or even necessarily the right way, but it works for me.

Firstly, install the snmpd and mrtg packages. For example, using apt-get:

sudo apt-get install snmpd mrtg

If you get asked any questions, just accept the defaults.

Make the following changes to your /etc/snmp/snmpd.conf:

charlvn@sunbird:/etc/snmp$ diff -u snmpd.conf.bak snmpd.conf
--- snmpd.conf.bak 2009-04-09 02:15:12.000000000 +0200
+++ snmpd.conf 2009-04-09 02:15:24.000000000 +0200
@@ -58,8 +58,8 @@
 # from):
 
 #       sec.name  source          community
-com2sec paranoid  default         public
-#com2sec readonly  default         public
+#com2sec paranoid  default         public
+com2sec readonly  default         public
 #com2sec readwrite default         private
 
 ####

In my case, no other machines can get direct access to the SNMPD anyway due to my iptables configuration.

You need to reload snmpd in order for the changes to take effect:

sudo /etc/init.d/snmpd reload

Now generate your MRTG configuration:

sudo bash -c 'cfgmaker localhost > /etc/mrtg.cfg'

To make sure it works, use the mrtg command to generate the graphs immediately:

sudo env LANG=C mrtg

By default, your web pages and graphs will be stored in /var/www/mrtg; if you want to change this to somewhere else (personally, I prefer it in /srv/mrtg), just change the value of WorkDir in your /etc/mrtg.cfg file accordingly.

If you experience any problems or have anything to add, please contact me or simply leave a comment. Thanks!

Introducing PageFlag

A couple of days ago, I was discussing some of my data portability related work with Neville Newey on Skype when he gave me an excellent idea.

I've been having the problem for quite some time that I tend to lose interesting links. I would be browsing the interwebs in order to find one thing, then find something else that's interesting too but not related to what I was looking for. I would like to get back to it later when I have a bit more time, but what to do?

Email the link to myself? Bah. Bookmark it? Too much trouble, and then it doesn't help because I might want to follow up on the link while using a different computer. Eventually I end up with tons of tabs open, which is irritating in itself. I need a better solution, and it seems others do too.

So, this called for a quick solution. And PageFlag was born. Simply drag the bookmarklet to your toolbar and flag any page with one click (and without being taken away from the page you're currently viewing). Later on, whenever you're ready, access a list of your flagged links from any computer.

So far, this is very quick-and-dirty, so expect to find bugs. It seems to work fairly well on both Firefox 3 and Safari though. Please let me know your experiences!

For more information, please see the PageFlag about page.

Sakaiger visits Cape Town

A little more than a month ago, the Sakaiger travelled with Chuck Severance all the way from Michigan in the United States to Cape Town, South Africa.

First, we had to get ourselves introduced. David Wafula and I had the pleasure:

As everybody knows, no self-respecting geek can work without coffee. Luckily, the FSIU had some Inkululeko mugs handy:

Sakaiger at University of the Western Cape

But nobody can live from coffee alone. Luckily, there was ample supply of Gatsby to go around:

Sakaiger about to eat a Gatsby's sub at Uni Western Cape

And of course, there is always some time to get a bit of fresh air:

Cape Town Feb 23 - Uni Western Cape

Muti + Google App Engine

I am currently busy putting together a new site for myself (still pre-alpha) and decided to try and syndicate my muti submissions to it. So far, I managed to come up with the following.

Firstly, here is my controller:

class MutiPage(webapp.RequestHandler):
    def get(self):
        template_values = {"muti":[]}
        tree = getxml("http://muti.co.za/by?name=charlvn&output=xml")
        for treeitem in tree.findall("link"):
            item = {}
            item["title"] = treeitem.findtext("title")
            item["url"] = treeitem.findtext("url")
            item["posted"] = time.strftime("at %H:%M on %d %b %Y", time.strptime(treeitem.findtext("date"), "%Y-%m-%dT%H:%M:%SZ"))
            votes = int(treeitem.findtext("votes")) - 1
            if votes == 0:
                item["votes"] = "did not get voted up yet"
            elif votes == 1:
                item["votes"] = "received 1 vote so far"
            else:
                item["votes"] = "received " + str(votes) + " votes so far"
            item["tags"] = []
            for tag in treeitem.findall("tag"):
                item["tags"].append(tag.text)
            template_values["muti"].append(item)
        show(self, "Muti", "muti", template_values)

This makes use of the following "helper" function (or whatever you prefer calling it):

def show(self, page_title, template_name, template_values):
    template_values["site_title"] = "Charl van Niekerk"
    template_values["page_title"] = page_title
    path = os.path.join(os.path.dirname(__file__), "templates", template_name + ".html")
    self.response.out.write(template.render(path, template_values))

And then the template:

{% extends "template.html" %}
{% block content %}
    <dl id="muti">
        {% for item in muti %}
            <dt><a href="{{ item.url|escape }}">{{ item.title|escape }}</a></dt>
            <dd>
                Posted {{ item.posted|escape }} and {{ item.votes|escape }}.
                {% if item.tags %}
                    <br>Tags:
                    {% for tag in item.tags %}
                        <a href="http://muti.co.za/hot?tags={{ tag|escape }}">{{ tag|escape }}</a>
                    {% endfor %}
                {% endif %}
            </dd>
        {% endfor %}
    </dl>
{% endblock %}

You can see a live example online. I didn't get around to add any proper error handling yet, so if you see an ugly error page, please reload a few times. :)

Tags: muti googleappengine

Themes in Google Apps Gmail

Themes in Google Apps Gmail

They launched themes in Gmail quite a while back and us Google Apps users were wondering when they would finally bring this across, and they seem to have done that just now. Now we can also have our mailboxes looking spiffy. :)

Zoopy + Vodacom

A while back, I read the following on the about page of IS Labs:

Even better, we’d like to get more internet users from overseas visiting sites based in South Africa, because that allows our telecoms operators to negotiate better interconnect deals on international bandwidth.

More recently, I did a couple of traceroutes and then suddenly a bell rang. Zoopy is a bandwidth hungry application; they have high quality video (relative to competing services such as Youtube), huge upload limits (200MB), yet this is all hosted in South Africa. Yes, in Vodacom's new data centre, and from the traceroutes it is clear they are buying bandwidth from overseas companies directly.

Now I'm speculating, is Vodacom using this to negotiate for better peering agreements with international service providers? If so, brilliant thinking! Note that Zoopy seems to have a significant user base outside of the country. I hope we see some more of this going on in the next year or two now that our international capacity (should) be expanding greatly.

Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.