Jeremy’s World

Jeremy de Oliveira-Kumar’s website about interesting stuff

Entries Comments



Moving to a Mac

26 April, 2008 (21:03) | Experimenting, OS X | By: Jeremy

Well it has been just under six months now since I got myself my first MacBook from the UNSW Apple store in Sydney, Australia.  And the verdict is…

WOW!

Prior to the purchase of this Mac, I had only previously used Macs on two occasions:  during a work experience week in Year 10 at school at MCSU UNSW with a long-time Mac user and before that in Year 4 in primary school using the very ancient Apple II where I played a game which was a cross between multiplication table exercises and an alien space ship shooter.

Having been a long-time Windows user and a recent convert to Linux as a result of my studies, I was at first quite sceptical about Mac OS X (especially having heard some serious disaster stories with OS 10 and 10.1).  Of course with the huge press hype and the move an x86 based system, as well as recent successes with the iPod, the Apple brand caught my attention again.  I also noticed that many of my computer science lecturers were beginning to use Macs to present their lectures.  This made me start to wonder what all the fuss was about - if more and more computer science educators are using Macs over Windows-based machines… there must be a reason.

So, I jumped online and had a look at the Apple website - more specifically at the OS X section of the site and to my surprise I found that Apple was going to release a new version of the system near the end of the year, OS X 10.5 or more commonly known as Leopard.  Having looked at the range of features packed into the system I was thoroughly impressed.  I decided to do some more research and find out about the guts of the OS.  To my surprise it was a melange of some of the best (and sometimes worst) parts of unix-based operating systems with a Mach kernel thrown in on the side for interest.

Having debated for a month inside my head on the investment (although I had already probably decided after about two days) I went and got myself a Mac.  And here I am nearly six months later, using the very same Mac and happily impressed.

This single post would not be enough to my summarise all my loves and hates of Leopard (I’ll do that another time), however in brief the best things I find about the Mac operating system are:

  • You get simplicity in the applications, yet can still have enough control of your machine thanks in part to the unix-like kernel and the supposedly much improved terminal interface.
  • Much of the software is open source and based on long-standing, well developed software systems which have been a part of unix for well over two decades.
  • You don’t suffer as badly from the bane of badware, adware, trojans, worms, viruses, malware and other crap that seems to infest Windows based systems.
  • You get the beautiful Quartz interface which is simply a delight to work with
  • and… It’s not Vista!

Of course a few pet hates:

  • Java is not particularly great on the Mac yet… hopefully that will change soon… but as a developer it is a bit of a pain in the ass
  • Productivity software has come a long way and with the release of MS Office 2008, things have improved, but it is still lacking in a few areas as my dad pointed out well… for example users of EndNote still don’t have the support they need to use a Mac (i.e. the software!)

But overall, so far the Mac gets a solid 9/10 from me.  It doesn’t quite get a 10 simply because nothing can be perfect (although the Mac is getting there).  If I were recommending a system to buy for a new or experienced computer user, I would definitely rate a Mac as my first choice now, especially since most Windows based machines are released with Vista nowadays - c’est dommage!

Apple… please keep up the good work!  And let’s not see security suffer in the process of striving for ease of use and compatability (hint to Microsoft).

Backing up a mysql server

26 April, 2008 (20:03) | Databases, Linux, News, Shell Scripts | By: Jeremy

In an increasingly data dependant world, backing up has never been more important.  This especially applies to databases on servers.  It is shocking to know how many people fail to backup their data out of sheer ignorance or a failure to understand the purpose of backing up until its too late (I used to be one of those people, but then I was young and didn’t have much worthwhile data on my computer anyway).

With the advent of the LAMP server architecture, mysql databases are increasingly in use on servers (this is now even more true now with Ruby On Rails setups).  In order to protect all my database data, I wrote a quick and simple script using existing mysql tools found in most linux setups to perform a hot backup.  This backup can be for a single database or the entire DBMS.

The script is called mysql-backup and to describe simply it performs the following operations:

  1. Setup the filename for the backup with the current date and time
  2. Set the backup folder (/var/lib/mysql/backup - a standard folder in Ubuntu setups)
  3. Do a backup of all databases (the –all-databases line can be customised if you wish to only backup a single database on your server)
  4. Purge any older backups prior to the last 10 (if 10 already exist - this line can be commented out if you wish to keep all backups, but note that this might take up a lot of space in the long run)

The best way to run the script is through a cron job.  I usually perform my database backups at least once a day on low demand machines, and twice daily on high use http servers.

You can find a copy of the script on the Linux Scripts page of this site.

Cryus Mail server back-up script

25 April, 2008 (21:15) | E-mail, Linux, Shell Scripts | By: Jeremy

During my early days mucking around with linux in attempt to find the best pieces of software for a range of different tasks, I stumbled upon cyrus mail server, the Carnegie Mellon Unversity’s implementation of an IMAP server.

Having already tested the Washington University implementation of IMAP as well as Dovecot, I was still unconvinced by the IMAP protocol, particularly its implementation on UNIX-based systems.  Cyrus changed this point-of-view significantly.  With a closed database, capable of easily interfacing with SMTP servers such as postfix and sendmail, cyrus proved to be a robust system and with the latest versions including the possibility of scaling and distribution, it was for a long time Excel Building Management’s choice mail server.

The only problem was that the facilities for backing up a cyrus server were almost non-existent.  The only script/software I could find that even came close was mailbfr.  Unfortunately, the script was written for Mac OS servers and therefore needed some tuning and tweaking to port to a Linux flavoured system.  Thus, my programming skills came to the rescue and cyrus-backup was born.

Cyrus-backup is a simple port of an earlier version of mailbfr to the linux environment.  Although not capable of a hot backup, it is still extremely efficient at providing a full backup of an entire cyrus database including the possibility of storing users’ filtering rules.

Cyrus-backup has saved me on more than one occassion from near disaster and running it with a cron-script once a day at 2am made my life of mail server management a dream.

So now, I am providing a copy of the script, optimised for Ubuntu (but easily customisable) to all those who use cyrus servers as a solid method of providing backup.  The script is quite self-explanatory so I have not provided documentation at this stage, although if I do make changes in the future, this may be included.

You can find a copy of the script on the linux scripts download page.

Apple OS X and Linux

23 April, 2008 (02:16) | Uncategorized | By: Jeremy

This page will host a collection of information about the unix-based platforms OS X and Linux, particularly focusing on Apple’s implementation and the tools you can use when having the not so occassional headache.