Getting KMail up to speed March 10, 2010 1 Comment

This weekend I figured I’d take a sneak peek at the upcoming Kubuntu 10.4 “Lucid Lynx”. And one thing I wanted was to get a full-immersion KDE SC 4.4 experience. And that meant KMail.

Previously KMail and I have not got along. We use IMAP at the Digital Tool Company. A whole lot of IMAP, to be more specific. This evening I did a quick check, and it turns out that I can see over 1700 mail folders. And when KMail starts up it wants to look inside those. It opens a file handle for each folder, and soon you get “Too many open files” errors. In my case, if I’d let it keep going, it would have popped up just over 700 error messages.

Until recently, that’s as far as I ever bothered with KMail. I just went back to old faithful Thunderbird. But this weekend I was determined to get a bit further.

So here’s how to get it working: Just persist.

Close KMail. If it’s just spewed “Too many open files” errors at you, a firm “killall kmail” will do the trick.

Open it again, and wait. Eventually it will have work its way through all your IMAP folders, and the errors will stop occurring.

Now I had a new problem. Every time it checks my mail, it wants to check all my folders for new messages. That’s going to take a while!
KMail Folder Properties
So I right-clicked on the first folder, chose Properties, and noticed that I could uncheck “Include this folder in mail checks”. I also saw that “Act on new/unread mail in this folder” didn’t look so useful for most of these folders either, so I unchecked that too. OK, cool! Now I’ll just do that 1700 times.

Or not. There must be a better way! Surely.

There is. KMail keeps its configuration in ~/.kde/share/config/kmailrc.

So, close KMail.

Open ~/.kde/share/config/kmailrc in your favourite text editor, and search and replace “checkmail=true” with “checkmail=false”, and “IgnoreNewMail=false” with “IgnoreNewMail=true”.

Now go find the entry for your inbox, and put checkmail back to true, and IngoreNewMail back to false.

Save, and open KMail again.

How much faster is that, huh? Much faster.

Now you can go and explore KMail’s cool features. I’m liking the options in View > Message List > Aggregation, and the fact that on a folder-by-folder basis, I can choose to keep replies in the same folder (right-click on the folder and choose Properties). And I’ve only just started looking around.

You can find more info at KDE’s KMail page.

And check out this useful tip regarding Sent and Draft folders at OpenSUSE.

Tidy HTML, PHP, C++ in Komodo February 12, 2010 No Comments

Komodo Edit is my favourite editor for PHP, Python, HTML and CSS. It recognises Django Template Language, offers auto-completion for the Zend Framework, and displays the colour in a tooltip when you mouseover the CSS colour code. And it allows you to write macros in JavaScript or Python. It’s lovely.

Yesterday a colleague asked how to clean up some ugly HTML. I knew about “tidy”, the W3C’s HTML syntax checker and reformatter, but I was sure someone had done something similar for Komodo.

And they have. The nicest seems to be a macro written by Michael Cartmell at the Komodo Forum over here. I followed the thread, which contributed several good ideas, like tidying just a selection, and how to add support for other languages like C, C# and PHP. Credit goes to all who added code: hefebia, jeffg, jonathaneunice, oozypal, toddw, and especially michael.cartmell; and all who participated in the thread to iron out issues and show appreciation: davegaramond, ericp, Florent V., GroessterNehmer, keanzu, unixguy, wendymcf, znmeb.

I collated all the suggestions, and I’ve put them below. Here is how to create the macro.

First, install the software that the macro uses to tidy code.

In Debian, Ubuntu, Mint, etc. that’ll be:


$ sudo apt-get install astyle # For C, C++, C# and Java
$ sudo apt-get install perltidy # For Perl
$ sudo apt-get install tidy # For HTML, XML, XSLT, XUL
$ sudo apt-get install csstidy # For CSS
$ sudo apt-get install php-pear # For PHP ...
$ sudo pear install channel://pear.php.net/php_beautifier-0.1.14

Then in Komodo …

Show the Toolbox if it isn’t showing already. To do that, click View | Tabs & Sidebars and make sure Toolbox is checked.

In Toolbox, click on the Add Item To Toolbox icon. Choose New Macro…

Give your new macro a name. I called mine “Tidy”.

Confirm that the language is set to JavaScript.

Then copy and paste the following:

komodo.assertMacroVersion(2);
if (komodo.view.scintilla) { komodo.view.scintilla.focus(); } // bug 67103

var formatter;
var language = komodo.document.language;
var cannot_tidy_selection = false;
switch (language) {
    case 'C':
        formatter = 'astyle --style=linux';
        break;
    case 'C++':
        formatter = 'astyle --style=kr';
        break;
    case 'C#':
        formatter = 'astyle --style=ansi';
        break;
    case 'HTML':
        cannot_tidy_selection = true;
        formatter = 'tidy -q -utf8 -asxhtml -i -w 80';
        break;
    case 'CSS':
        formatter = 'csstidy - --preserve_css=true --lowercase_s=true --case_properties=true --sort_properties=true --template=low --remove_bslash=false';
        break;
    case 'Java':
        formatter = 'astyle --style=java';
        break;
    case 'Perl':
        formatter = 'perltidy';
        break;
    case 'PHP':
        formatter = 'php_beautifier -s4 -l"Pear(newline_class=false,newline_function=false)"';
        break;
    case 'XLST':
    case 'XML':
    case 'XUL':
        cannot_tidy_selection = true;
        formatter = 'tidy -q -utf8 -xml -i -w 80';
        break;
    default:
        alert("I don't know how to tidy " + language);
        exit(1);
}

//save current cursor position
var currentPos = komodo.editor.currentPos;

try {
    // Save the file.  After the operation you can check what changes where made by
    // File -> Show Unsaved Changes
    komodo.doCommand('cmd_save');

    // Group operations into a single undo
    komodo.editor.beginUndoAction();

    // Select entire buffer & pipe it into formatter.
    //komodo.doCommand('cmd_selectAll');
    //Run_RunEncodedCommand(window, formatter + " {'insertOutput': True, 'operateOnSelection': True}");

    //var text_not_selected = komodo.editor.selText == "";
    var text_not_selected = cannot_tidy_selection
                     || komodo.editor.selText == "";
    if (text_not_selected) {
        komodo.doCommand('cmd_selectAll');
    }
    Run_RunEncodedCommand(window, formatter + " {'insertOutput': True, 'operateOnSelection': True}");

    if (text_not_selected) {
        komodo.editor.gotoPos(currentPos);
    }

     // Restore cursor.  It will be close to the where it started depending on how the text was modified.
     komodo.editor.gotoPos(currentPos);

    // On windows, when the output of a command is inserted into an edit buffer it has unix line ends.
    komodo.doCommand('cmd_cleanLineEndings');

} catch (e) {
    alert(e);

} finally {
    // Must end undo action or may corrupt edit buffer
    komodo.editor.endUndoAction();
}

(I’ve left some of the original code commented out, so you can see where the later changes have been made. I’ve also added the -utf8 parameter to tidy as suggested at the end of the thread. And of course, if you don’t like my choice of styles, modify accordingly. The man pages for tidy and astyle are very helpful. You might also want to check Wikipedia to see the differences in indent styles.)

Click OK. Your new macro will appear in your toolbox.

Now all that remains is to open some messy code, and double-click the macro. Whoohoo!

How To Download Documentation with wget January 10, 2010 No Comments

Every now and then I find that what I’m looking for is not available in a convenient Debian / Ubuntu / apt repository. (My favourite applications that I wish would add themselves to Universe, or Multiverse, or Launchpad, or something, are Komodo Edit, and Task Coach. My felicitous find was python-django-doc, which I remember downloading with wget a year or two ago.)

diveintopython is available, but diveintopython3 isn’t (yet?) (although Mark Pilgrim does make it very convenient to download).

And neither is what I would name its package zend-framework-doc.

So here is the quick and easy way to download the Zend Framework Documentation. Make yourself a convenient directory to put the files in. I called mine “zend-framework-doc/html/”. Then open a terminal in your new directory, and type:
wget --recursive \
--level=1 \
--no-parent \
--page-requisites \
--convert-links \
--no-host-directories \
--cut-dirs=2 \
http://framework.zend.com/manual/en/

You can see from the long-format switches what I want it to do. You’ll find the same command useful for loads of other documentation.

Then move the directory to where all the other documentation is on your machine, like so:
cd ../..
sudo mv zend-framework-doc /usr/share/doc/

And then this URL will work:
file:///usr/share/doc/zend-framework-doc/html/index.html

Happy days.

GNOME Shell, GNOME Do, and things to come December 27, 2009 No Comments

Back in the day, when I still believed that Twitter, identi.ca and I could coexist harmoniously all day long (social networking, forums, e-mail, and anything else that can pop up notifications of interesting stuff while I’m busy working cannot make me happy in a long-term, sustainable kind of way (at least not while I have any work to do)) I used to microblog with GNOME Do.

I like GNOME Do. And I like how it dovetails nicely with something relatively new from the GNOME stable; something that appeals to my appreciation of simplicity and effectiveness: the GNOME Shell.

GNOME Shell Activities screenshot

GNOME Shell involves a rethink of your workspaces — Actually, before I start getting too long-winded, check out a video, and maybe browse some of the related videos.

As you can see, applications, places, and recent documents are together, and can be searched together. In the Applications section of Activities, applications are only mentioned once, not per-window as we are accustomed to with a task switcher. I like this. It makes sense to me, in terms of how I go about using my machine.

I also like how the number of workspaces I use is more fluid than before. I used to use four workspaces. Mail would be on the first, work on the second and maybe the third, and music on the last. I find with GNOME Shell I move things around a little more, and I end up using two workspaces most of the time.

What I think will be great for new Linux users, and those who tend to use only one workspace, is that GNOME Shell integrates the benefits of multiple workspaces better with the way one goes about everyday tasks (or at least the way I go about everyday tasks). So when you start to work on a new task, it feels natural to add a new workspace, and open the applications you use to do your new task (say, mail and browser, or browser and word processor) in the new workspace, if only because GNOME Shell lists your applications, places, and recent documents, and lays out your workspaces on the screen at the same time.

You’ll find a great little cheat sheet here, to get you familiar with how to do stuff.

I have to congratulate the developers involved in this project on its stability. Although it might not be complete, GNOME Shell feels rock solid.

It’s also cool to be able to watch it evolving. Here’s a video of a slightly older version. You can spot quite a few changes.

And here are some mockups from the middle of the year.

RainCT has been doing some fantastic work integrating GNOME Shell with Zeitgeist, an event-based search tool.

You can feel part of all this quite easily. You’ll find a “gnome-shell” package in repositories for Debian Squeeze and Sid, Ubuntu Karmic, and Mint Helena. “sudo apt-get install gnome-shell” and then “gnome-shell –replace” will do what you need. For Fedora 12, OpenSUSE 11.2, and how to start GNOME Shell when you log in on Karmic, check out these instructions.

You can follow updates on identi.ca and Twitter. And check out the Getting Involved section on the GNOME Shell page on GNOME Live!

GNOME Shell screenshot

GNOME Do’s “Docky” theme provides a convenient alternative to Alt-Tab or Alt-Left / Alt-Right, or going to Activities to change tasks or workspaces. “sudo apt-get install gnome-do“, and under Preferences and Appearance, choose the Docky theme, if it isn’t already selected. You won’t be able to use Super-Space to summon GNOME Do because Super is repurposed by GNOME Shell to go to Activities. So under Keyboard preferences, change “Summon GNOME Do”. I use Alt-F3.

Scrolling the mouse wheel on the icon of an open application in the GNOME Do dock switches between that application’s windows, across workspaces. I love the Activities screen for organising my windows, but I find that using GNOME Do to switch between applications is quick and convenient, and more natural for me than Alt-Tabbing.

GNOME Shell is potentially the standard interface for GNOME 3.0. But why wait?

December 3, 2009 No Comments

I thought I’d just mention my “Single Most Useful Piece of Software”. I was thinking about how this single little program has done more for me, more reliably than any other program I run. Sure, it only has a couple of settings, and can only be used in certain circumstances, but the sheer usefulness of it is something to be beholden. That piece of software, is Synergy. (Sourceforge page)

What it does, is link the mouse, keyboard and clipboard of multiple PCs together, so you don’t have to keep swapping from one keyboard and mouse to another. You can also copy an paste things from one machine to another. It works on Mac, Linux and Windows.

htmlentities in ASP.NET + MonoRail + NVelocity October 23, 2009 No Comments

Recycle BinLet’s imagine you started an ASP.NET project while Microsoft’s MVC framework (cheekily named “MVC”) was not yet “production-ready”, or if you do not consider it production-ready yet. Let’s say that you eschewed the ridiculously last-century (if ever) WebForms, in favour of something a little more modern. Your choice of framework would be limited to, well, Castle Project’s MonoRail.

MonoRail makes the best of a bad situation. I commend Castle Project on the work that has gone into it. And it seems to embrace the C# idiom.

For a template engine, I chose NVelocity. It seemed a sensible choice. And it has nice “foreach” loops.

Imagine my surprise when it turned out that it has no quick way to escape strings.

Huh? Surely not?

Let’s recap.

PHP:

	<?php print htmlentities($plaintext); ?>

Django pre-1.0:

	{{ plaintext|escape }}

Django post-1.0:

	{{ plaintext }}

C# ASP.NET + MonoRail + NVelocity:

MyProject/Helpers/HttpUtilityHelper.cs:

	using System;
	using System.Web;

	namespace MyProject.Helpers
	{
		public class HttpUtilityHelper
		{
			public string HtmlEncode(string plaintext)
			{
				return HttpUtility.HtmlEncode(plaintext);
			}

			public string UrlEncode(string plaintext)
			{
				return HttpUtility.UrlEncode(plaintext);
			}

		}
	}

MyProject/Controllers/SomeOrOtherController.cs:

	...
	using MyProject.Helpers;
	...
	namespace MyProject.Controllers
	{
		[Helper(typeof(HttpUtilityHelper))]
		public class  SomeOrOtherController : BaseController
		{
			...
		}
	}

MyProject/Views/SomeOrOther/index.vm:

	$HttpUtilityHelper.HtmlEncode($plaintext)

On the other hand, you could save yourself a lot of hassle, and explore other platform options. Don’t be afraid of learning a new language. It might save you a lot of time in the log run.

Linux on the Home Desktop October 13, 2009 No Comments

Just over a decade ago IBM claimed that there were a surprising number of OS/2 desktops out there. I forget how many, and I am too lazy right now to Google it, but they said there were a WHOLE LOT more than I expected.

Then in 1999 I started working in a Big-Blue-blooded company. Their offices around the world sat on IBM token ring networks. In the server room they had three AS/400s. Their desks all held IBM desktops and laptops. And the vast majority of those ran OS/2 Warp. Unless you sat at one of those desks, you probably wouldn’t know about the 800 OS/2 installations in their head office.

Many banks were the same. They knew IBM looks after its customers, and they wanted IBM to take care of their IT infrastructure while they took care of the business of managing money. As a result they often also had AS/400s downstairs, and OS/2 on their desktops.

I expect these are the kinds of businesses that may find Linux on their desktops one day. And if Canonical, Dell, IBM and Novell continue along their current trend, the most likely flavours will be Red Hat, SUSE and Ubuntu.

Interesting as that is to watch, as it gradually takes place, it’s not what this post is about.

This post is about what is required for that rollout to happen, and why those requirements are not met in everyone’s home.

And, to a lesser degree, it’s about why I’m not too bothered.

First, let’s look at hardware compatibility and support. IBM can install OS/2, or Linux, throughout a company, because they manage the hardware, and the support. They train the consultants or the IT department, and the consultants train the staff. All the applications you need are tested before they are installed on your desktop. When a new model of machine becomes available, the IT department installs the OS on it, and all the applications that anyone in the company uses, and runs through their extensive checklist to make sure that everything works, before that new model lands on the marketing director’s desk. (You know the guy — he might not be the marketing director, but he’s the guy with the Car, and he must have the new machine first, because that’s how his ego works. And a company loves people with his kind of ego, because you can get them to do *anything* as long as you play with his obvious, and very sensitive buttons. He might not be cheap, but he’s worth every penny.)

And if you are your own IT department, or if you are your friend’s or your mum’s IT department, then Linux is easy. My mother runs Kubuntu. A friend of mine runs Ubuntu. When they have a question, they call me, but they don’t have questions any more, because all the questions have been answered, and nothing unexpected ever happens. It’s lovely.

One of my daughter’s friends has Hannah Montana Linux. Her dad installed Mint on his own machine at home. (It was on his recommendation that I took a look at it, and it really is nice.) He works for SITA, and they are switching over to Ubuntu (I don’t remember the number of desktops, but it’s a four-digit figure). His girlfriend is rather proud of running Mint too.

These home Linux users all enjoy computers, or have family or friends who enjoy computers.
Rocket Racer

But if you just want to get on with whatever your operating system is supposed to allow you to do, you could be in for some disappointment. Some people don’t want to use forums to find out why their sound doesn’t work. Nor do they want to have to do anything about it. They don’t care about checking for hardware compatibility before buying a webcam, or some deceptively cheap-looking inkjet. And then they get upset when it doesn’t Just Work. They blame Linux …

… or the Free Software community. It must be someone’s fault their new webcam doesn’t work. It works perfectly on Windows, so it’s not the webcam!

I would point a finger at the manufacturer (let’s call them ACME). But then, why should ACME go to the trouble of writing a driver (which isn’t done by the CEO over a weekend — it’s done by one or more programmers, who are salaried for their troubles) when Joe Bloggs accounts for 1% of their market (that’s not Linux users; that’s just new Linux users who would go out and buy an ACME webcam *before* popping over to Linux-drivers.org to see if it’ll work — a mistake seasoned Linux users don’t make often), and the amount of time and effort ACME takes to write the driver might not even be recouped.

(ACME might also say that nobody makes it easy to write a Linux kernel driver. I wouldn’t know. I’ve never written one, yet. But if Christian keeps reminding me about about how Linux handles his sound card, I might try to write a replacement for snd_hda_intel specifically for his sound chip that offers only the facility to change the headphone and microphone volumes.)

This hardware compatibility problem will eventually take care of itself, to a degree. If ACME wants their sound chip to find its way into a corporate desktop, and the corporate desktop is running Linux, then it will be in ACME’s interests to make sure Linux supports their sound chip. But only if they are targeting the corporate desktop. And only if the corporate desktop is running Linux.

So home users may eventually reap the benefits of the gradual corporate migration. But it’s not going to happen next year, I’m sure. Corporates move slowly. Windows 7 promises to be a big hit (despite their awful advertising (and kinda funny remix)). Some IT managers like to explore. Some IT managers like to go with what they know. I can’t tell you where the truce lines will be drawn at the end of the war. But I suspect that nobody will get the whole pie. The size of the Linux pie slice will determine whether home users can expect manufacturer love.

Then there’s the problem with familiarity. Some people go out and buy a nice fast, virus-free netbook with a great boot-up time, with an OS that will happily run as many applications simultaneously as they want. But when they start to play with it, they discover that it doesn’t work quite the way they had in mind.

This will also iron itself out. And it’s also related to the corporate desktop Linux marketshare. People expect Windows. People who think about loving a computer may love Mac OS X, or Linux. Despite how hard Microsoft would like people to love Windows, the problem is that the vast majority of Windows users don’t really think about it in those terms, nor are they likely to. But I tell you, take Windows away from them, and many of them miss it. If you’ve ever seen a constantly-bickering old couple, perhaps you’ll agree that familiarity and love might have more in common than many care to admit.

But for those who sit in front of Linux at work, they may become familiar with how things work; the things that change from release to release, and the things that stay the same. (I myself love it. I have two kids and watching Linux develop is (a tiny bit) like watching kids grow up. Yeah yeah, not exactly the same, but similar, OK. No, I won’t tell you where I live. No, you can’t take my kids off to Child Services. Yes, I am a perfectly fit parent.) And those people will, one day, assume that their netbook should work like their Linux desktop. They will never think about what operating system is hiding inside their cellphone. They will never ask a question on a forum.

That will be the day games publishers ensure there is a Linux version. And ACME webcams Just Work. And nobody wonders why Skype shows an image, but there is no sound coming out their speakers.

I’m sure it will happen.

But frankly, I can wait.

Because that’s the same day there is an incentive to write a prolific Linux virus. (Some say Linux is virus-proof because a virus can only affect files that you have write permission to. But, trust me, if a virus deleted ALL the files you have write permission to, your day would take a serious knock.)

In the meantime, I am perfectly happy look up hardware before I buy. And, actually, I enjoy supporting companies, with my wallet, that support Linux. I still get nasty surprises, like when it turned out that Adobe Air applications do not run on multi-core 64-bit AMD CPUs on Linux. (So I installed it on a virtual machine that uses only one core, and all is hunky dory now.)

And when a large enough chunk of the home desktop market comes round to Ubuntu 12.04 “Proud Panda” I’ll grudgingly go and buy a copy of NOD32 Anti-Virus, Linux Desktop Edition.

DTC’s installation script October 5, 2009 No Comments

Robots
I mentioned in my last post, where we built that metapackage, that I’d post our installation script.

This script is run immediately after a clean install, from CD, of Ubuntu / Kubuntu / Mint. It installs the metapackage, copies our standard settings to /etc, and installs software not available in repositories, like Komodo Edit.

Here it is, with comments.

#!/bin/bash

if [ $# -lt 1 ]
then
    echo "Usage: install "
    echo "  where  is one of 'ubuntu', 'kubuntu' or 'mint'"
    exit 1
fi

DISTRO=$1

# Find the distro architecture
ARCH=`apt-cache -v | cut -d' ' -f4`

# Configure apt to use the proxy
sudo cp ~it/install/etc/apt/apt.conf /etc/apt/

# Update software
sudo apt-get update
sudo apt-get -y dist-upgrade

# Install DTC software requirements
# (Here is the metapackage build in my previous post)
sudo dpkg -i ${DISTRO}-desktop-dtc_1.2_${ARCH}.deb

# Fix unresolved dependencies
sudo apt-get -f -y install

# Install libdvd-css
sudo ~it/install/bin/install-css.sh

# Install Komodo Edit
cd /tmp/
if [ "$ARCH" = "i386" ]
then
    tar -xzf ~it/install/Komodo-Edit-5.1.3-3592-linux-libcpp6-x86.tar.gz
    cd Komodo-Edit-5.1.3-3592-linux-libcpp6-x86/
elif [ "$ARCH" = "amd64" ]
then
    tar -xzf ~it/install/Komodo-Edit-5.1.3-3592-linux-libcpp6-x86_64.tar.gz
    cd Komodo-Edit-5.1.3-3592-linux-libcpp6-x86_64/
fi
sudo ./install.sh -I /usr/lib/komodo-edit-5
sudo ln -s "/usr/lib/komodo-edit-5/bin/komodo" /usr/bin/komodo
cd -

# Put /etc under version control
cd /etc
sudo bzr init
sudo bzr add
sudo bzr commit -m "Original config"

# Copy settings for Kerberos, LDAP, MySQL, etc.
sudo cp -a ~it/install/etc/* .

# Commit changes
sudo bzr add
sudo bzr commit -m "DTC config changes"

cd -

That’s it. Now all that remains is for me to program our team of robots to do installations all by themselves.


[2009-11-04]
The lines
sudo dpkg -i ...
sudo apt-get -f -y install

can be done more easily with
sudo gdebi

What’s more, I’m finding that messing with these meta-packages makes me think that this is a little over-engineered. It’s easier to maintain if you just use a text file (commented, if you want) of package names, and then install with:

cat | egrep -v ‘^#’ | xargs sudo apt-get -y install

(That egrep is to remove the comment lines.)

Building metapackages to make installations easier September 29, 2009 No Comments

At the Digital Tool Company, I have gone through a series of strategies to manage installing new machines, or upgrading old ones.

I’ve been installing Linux since the days of Red Hat 7.2. And the Digital Tool Company (nee O S S Africa) “standard desktop” has moved through Red Hat, Mandrake, Debian, and now sits at Ubuntu and Kubuntu. (There have been forrays into other distros. In fact, I’m typing this on Linux Mint right now (which is very nice, by the way.))

Our first strategy was just to install everything, and copy config files from a machine that was already set up.

Then I made drive images, by installing one machine Just Right, and then copying its drive. Then I’d make a little change, and feel the need to copy the image again. And repeat, until I had wasted vast amounts of time, and annoyed myself.

Then I made a PXE boot image, and created PXE boot disks. Luckily at that stage our machines all used Realtek 8139x network cards, because boot disks can be a bit of a pain.

Now I just use the Ubuntu installation CDs, either the “Desktop” or “Alternative”. After the initial installation, I install a metapackage that has all the extra stuff we use. There’s more to the story, but I’ll cover that in my next post.

What I want to tell you about here is how easy it is to create a metapackage. The benefit is that you can have one metapackage for each distro you want to support, and they are simple to maintain.

First, create a directory for your package. In this example I’ll call mine “dtc-mint-desktop_1.0_i386″. And create a directory called “DEBIAN” inside it.

$ mkdir -p dtc-mint-desktop_1.0_i386/DEBIAN

Next, create a file in the DEBIAN directory called “control”. (If you have done this before, and you want to pull out the control file from a metapackage you’ve already created, use the command “dpkg-deb -e dtc-mint-desktop_1.0_i386.deb dtc-mint-desktop_1.0_i386/DEBIAN”).

$ nano dtc-mint-desktop-1.0_i386/DEBIAN/control

Make it look like this:

Package: dtc-mint-desktop
Priority: optional
Section: metapackages
Maintainer: YOUR NAME <YOUR@E-MAIL.ADDRESS>
Architecture: i386
Version: 1.0
Depends: apache2, auth-client-config, autofs, autofs-ldap, directoryassistant, firebug, firefox-webdeveloper, krb5-user, libapache2-mod-php5, libapache2-mod-python, libnss-ldap, libpam-ccreds, libpam-krb5, libpam-ldap, mailx, msttcorefonts, mysql-client, mysql-server, nfs-common, nscd, ntp, php5, php5-gd, php5-mysql, php5-xsl, php-doc, phpmyadmin, php-pear, postfix, python-django, python-mysqldb, quicksynergy, ssh, ssh-askpass, subversion, sunbird, sun-java6-fonts, synergy, thunderbird-gnome-support, thunderbird-quickfile, vim-gnome, xulrunner-1.9-venkman
Description: Linux Mint desktop system specifically for DTC requirements
It is safe to remove this package if some of the packages are not desired.

Customize the file to suit your requirements. These are just the packages we use, and in this example they exclude the stuff already included in a fresh installation of Linux Mint 7 Gloria Main Edition.

When you’re done, you’re ready to build! The files in packages should be owned by root, so first let’s set the permissions:

$ sudo chown -R root.root dtc-mint-desktop-1.0_i386/

And then we’ll build the package:

$ dpkg-deb -b root.root dtc-mint-desktop-1.0_i386/ dtc-mint-desktop-1.0_i386.deb

That’s it! Next time you want to install your favourite bunch of packages, do a clean install of your distro, and install this package with “dpkg -i”, followed by “apt-get -f install” to satisfy dependencies:

$ sudo dpkg -i dtc-mint-desktop-1.0_i386.deb
$ sudo apt-get -f install

In my next post, we will take a look at our installation script.

AMI Collective Bare Auction September 26, 2009 No Comments

We’re happy to announce that The Digital Tool Company has developed the backend bidding system for the AMI Collective Bare Auction. The AMI Collective is a company doing extraordinary illustration and and design work for major national and international clients.

Up to a hundred vinyl Bare figures, 40 cm tall, were handed to as many artists and painted. They are now on auction for charity at the Bare Auction Website. DTC developed the backend system and integrated it with the frontend, replacing several elements and placing them on the site.

AMI Collective now has up to the second access to every bid with a complete database of bidders and a comprehensive record of all activities.