Tag Archives: hardy

>Windows 7 / Emacs / Ubuntu



The Dell is back in Windows land, with Windows 7 installed. I’m using it with the setup I detailed here and everything works as expected.

 A word about Emacs. I spent quite a bit of time over the last couple of months sorting out the mish mash of different emacs configs I had running. Now there is one config which handles everything I want it to. Whereas before I used to keep the configs in svn, this time I am using Dropbox to share the configs between Ubuntu, Windows and Mac and the .emacs (currently 211 lines long) works perfectly between all three. So when I add a keybinding or piece of emacs code into one they appear on all four machines. Losing version control doesn’t bother me so much, I rarely want to look back through versions – having everything applied immediately is much more useful.

The Ubuntu VM’s I am using on the Windows machine have Dropbox linked through the vmware shared folders. With my current setup I can create a fully working Ubuntu 8.04 environment with all my emacs customisations in less than five minutes.

If you expand that picture you’ll see it’s using ECB mode – something which I used for a few years but stopped using some time ago when I had some issues with it. Starting from the top left and going down and then across we have.

1. ECB Directories window

2. ECB Current directory window

3. ECB Methods and variables browser (showing items for the DateTime.py file)

4. ECB History Window (files recently visited)

5. DateTime.py (something I am actually editing!). Although it’s not switched on here I have flymode on which is linked to various utilities that can display PEP8 infringements or syntax errors inline.

6. DIRED view of a directory I am working in.

7. irc (#django channel on freenode)

8. Editing the hosts file. This is actually in sudo mode, using tramp. Means I can go sudo and edit a file without starting another terminal up.

The Dell’s 1920×1080 resolution makes this worthwhile. I can reboot this machine into Mandriva and have the same development environment straight away. Or switch to the Mac, Ubuntu desktop or even Ubuntu Netbook and have it all working exactly the same. Very nice.

>pg_top on Ubuntu Hardy – Postgres top utility

>This morning I got pgtop working but had some questions which I forwarded to the author Cosimo Streppone. In his very polite reply he pointed out I should really be using pg_top (note the hyphen) so I then set to getting that to work on Ubuntu Hardy Heron.

Download the latest release from the site above (I downloaded pg_top-3.6.2.tar.gz) and then

tar -zxpvf pg_top-3.6.2.tar.gz
cd pg_top-3.6.2

It’s very possible you might get some errors during this. The three I had were

configure: error: no acceptable C compiler found in $PATH

You don’t have the basic build tools installed. Do.

sudo apt-get install build-essential

Also during config

configure: error: pg_config not found

Get the postgres dev libs – do

sudo apt-get install libpq-dev

During make I got a heap of errors – starting with

gcc  -Wall -g -L/usr/lib -lpq  -o pg_top color.o commands.o display.o getopt.o screen.o sprompt.o pg.o pg_top.o username.o utils.o version.o m_linux.o -ldl -lm 
display.o: In function `display_move':
/home/icottee/pg_top-3.6.2/display.c:257: undefined reference to `tgoto'
/home/icottee/pg_top-3.6.2/display.c:257: undefined reference to `tputs'
display.o: In function `display_write':
/home/icottee/pg_top-3.6.2/display.c:387: undefined reference to `tgoto'
/home/icottee/pg_top-3.6.2/display.c:387: undefined reference to `tputs'

The solution I found was to

sudo apt-get install libncurses5-dev

Then rerun config AGAIN and do a make.

Now I could

pg_top --help

And all was good. Read the web page for info about what you can do with it. But in short you can see all running postgres processes, see what they are doing, examine their query plan, what locks they have and examine table and index statistics of the relevant tables. Full info and screenshots can be found here.

>Welcome from the MacBook Pro and Another Welcome from Refurbished Computers UK

>It arrived a day late and is looking pretty cool so far.

So I’m typing this with MarsEdit first of all to see how I get on what that.

What have I noticed about the new machine. Some random comments made in no particular order. Here’s the low down on the specs of the Machine.

Model Name: MacBook Pro
Model Identifier: MacBookPro4,1

Processor Name: Intel Core 2 Duo

Processor Speed: 2.4 GHz

Number Of Processors: 1

Total Number Of Cores: 2

L2 Cache: 3 MB

Memory: 4 GB

Bus Speed: 800 MHz

It has a 250GB hard drive, 5400 RPM

I’ve been through a number of laptops in the last couple of years. I had the MacBook which replaced my old iBook and died a horrible death. Which was replaced by a Sony Vaio VGN-FE41Z. And I’ve also been running the Dell Inspiron 630m which I think become my second favorite laptop ever, just behind the 12″ iBook before it too popped it’s clogs. So maybe over three years I’ve had five major laptops – running a mixture of OS X, Linux and Windows (XP and Vista).

I had a bit of a epiphany regarding laptops a short time ago. Because even though I was loving Hardy Heron on the Dell I realised that linux laptop compatibility is a lottery – unless you get one with Ubuntu preinstalled which limits somewhat your choice of machines, trying to get all your laptop features running can become something of a fulltime job. Even on the Dell resume/suspend didn’t work (although it did under Gutsy 95% of the time – I suspect I tweaked something in the past which I’ve since forgotten). So upgrades are exciting times with new treats and old ones sometimes taken from you. The Dell 630m was great but even it was showing it’s age. I was plotting what to replace it with and was thinking of something like my last week’s Vista setup but on a much nicer spec machine. You have all the drivers provided, suspend works, you can buy some crappy bargain bit of hardware not wondering if you’ll ever be able to use it. So if the “X Server, VMWare” trick works and you can use Ubuntu easily within a windows environment it makes sense to go the Windows route.

Because the only other option is the Apple route and I swore to the gods I wouldn’t give them my money again until they sorted out their production process … i.e. I won’t buy a MacBook until they start making them reliable and resilient. I even thought of buying refurbished computers from gigarefurb.co.uk because I have heard how worth it they were. We’ve bought so many of these Macbook and had so many problems and the Apple Care they provided wasn’t much use either because you have to sit there arguing that, no, you didn’t crack the front casing of it and this is a problem that thousands of others have suffered from. And they still don’t believe you. And why don’t we just buy Dell’s instead because you can get cheap accidental damage cover with that. And actually Vista is not that ugly. It’s quite nice. But it’s slow. And not very reliable. And 3GB of RAM is about your max. Oh and Steve Balmer.

Apple are evil. Microsoft are evil. Ubuntu are not evil (or at least, if they are, they’re keeping it quiet so we don’t feel bad about using an evil os). But we have to use evil hardware with the good software and maybe something won’t work properly. Hmmm … Apple.

Am I rambling?

Anyway, on the spur of a moment decision I went back to Apple. I bought a MacBook Pro because I was not aware of them suffering the same monumental build quality issues as the MacBook. It’s a Unix based laptop. It has a great screen and a great keyboard. It has good battery life. It’s fast. I was in Japan when the other laptop died and I could easily get a US keyboard and a worldwide warranty. I love OS X.

I’ll blog a bit shortly when I have my same Ubuntu VMWare setup up and running. I’ll blog a little bit later, maybe in a couple of months, when I’ve worked out whether this is really changing my life. If it can and I can reduce my laptops to one again, I’ll be a happy man.

>Cyrus IMAP on Hardy Heron

>So you’ve just installed cyrus imap on Hardy Heron and you can’t seem to connect. You try a test telnet session and get

icottee@ijcdev:~$ telnet localhost 143
Connected to localhost.
Escape character is '^]'.
* BYE Fatal error: can't write proc file
Connection closed by foreign host.

Take a look in /var/log/mail.err and you’ll see stuff like

May 19 22:13:15 ijcdev cyrus/imap[8316]: DBERROR: dbenv->open '/var/lib/cyrus/db' failed: Permission denied
May 19 22:13:15 ijcdev cyrus/imap[8316]: DBERROR: init() on berkeley
May 19 22:13:15 ijcdev cyrus/imap[8316]: DBERROR: reading /var/lib/cyrus/db/skipstamp, assuming the worst: Permission denied
May 19 22:13:15 ijcdev cyrus/imap[8316]: locking disabled: couldn't open socket lockfile /var/lib/cyrus/socket/imap-1.lock: Permission denied
May 19 22:13:15 ijcdev cyrus/imap[8316]: IOERROR: creating /var/lib/cyrus/proc/8316: Permission denied
May 19 22:13:15 ijcdev cyrus/imap[8316]: Fatal error: can't write proc file
May 19 22:13:15 ijcdev cyrus/master[8260]: process 8316 exited, signaled to death by 11

The solution is simple

chown -R cyrus /var/lib/cyrus

I’d give cyrus a restart after that as well.