Ubuntu Linux on Dell D630: the DVD

Getting the DVD drive working in Ubuntu Feisty on my Dell D630 laptop was one of the tasks that eluded me until a few minutes ago when I went searching again and found the solution.

At first I tried this and used the ide-generic driver. Linux recognised the drive, but as the page above says, it doesn’t give you any DMA modes. I tried the Bourne Supremacy, just to see if anything would happen, but Totem just sat there and the system became sluggish while the CD made some whirring noises. That’s a sure sign that DMA isn’t working!

That wasn’t going to be satisfactory, so I kept searching. This page and some of the Ubuntu forums suggest loading the “piix” and “ata_piix” modules. I tried to modprobe them without luck, but when I added “piix” to my /etc/modules and rebooted my DVD drive was found!

DMA is now enabled and everything works ok. Even got the film to play in Mplayer and it was very smooth.

# hdparm -i /dev/hda

/dev/hda:

Model=TSSTcorp DVD+/-RW TS-L632D, FwRev=DE04, SerialNo=
Config={ Fixed Removeable DTR10Mbs nonMagnetic }
RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=0kB, MaxMultSect=0
(maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
IORDY=on/off, tPIO={min:227,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=no

# hdparm /dev/hda

/dev/hda:
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 1 (on)
readonly = 0 (off)
readahead = 256 (on)

How labels saved my life

Well, they made it easier. Saved might be a little strong. When using a Unix based system you use a file called /etc/fstab to designate all the hard drives and external storage like flash cards and where they will mount or live on your filesystem. It’s not quite like the Windows world where everything has a drive letter, although you can use SUBST to get a similar effect on that operating system.

/etc/fstab is easy to maintain when all your drives stay in one place, but since I’m using 3 external drives and a card reader, sometimes the device name /dev/sdX changes for each. It’s horribly frustrating changing entries in fstab just because the card reader wasn’t plugged in when the computer booted into Ubuntu Linux

That all changed when I assigned labels to each drive. Now fstab entries reference those labels instead of devices! The following line,

/dev/sdc1 /media/disk auto rw,user,noauto 0 0

becomes

LABEL=DATA /media/disk auto rw,user,noauto 0 0

So, even if the device changes from sdc1 to sdd1 /media/disk will always mount!

Here’s a great tutorial on how to assign labels to disks, and how to modify your /etc/fstab to support them. It might seem like a pain at first but it’s well worth it!

Open a new window here in Ubuntu Linux

cmdline.png

One of the things I missed a long time ago in Windows completely was the handy “start” command I could type from a command prompt to open a new Windows Explorer window in whatever directory I was in. Can you still do that? Does anyone use Windows from the command prompt any more?

nautilus.png

I have since discovered you can do the same thing in Ubuntu Linux (and any other Linux for that matter of course!). I’m a big fan of Gnome, which uses the Nautilus file manager. If you’re fond of navigating your computer using a terminal, it’s really easy to open a Nautilus window in the current directory. Simply run ‘nautilus .‘ and a new window will open in that directory.

Don’t tell me you’re a keyboard junkie, I am too. I use Vim! Nautilus is still very useful though. Besides it’s obvious use as a file manager It’s dead handy for copying files to a remote server using any number of transmission protocols from ssh and SMB through to plain old ftp. But more on that some other time eh?

The real way to improve server performance

If you want to improve server performance, the best way is to move as much of the processing off it and onto the client machine. All those visitors of yours are running souped up AMD and Intel CPUs with their big screens and fat harddrives. No wonder your small little hosting plan can’t keep up. Here are some very good ideas from a Slashdot comment I read this morning.

  • Databases can get pretty slow with complicated queries, so upload your database to the client when they load the page and then your database queries are distributed.
  • PHP isn’t very fast, and neither are Perl or Python, so you don’t want to be running them on the server either. Write an interpreter for the language of your choice in Javascript and move your business logic to the client. This will also interface better with the client side database copy.
  • SSL is a performance killer, don’t use it. If you need to send something securely just prefix it with a predetermined number of random letters and numbers, no one will think to look beyond them.
  • Writing to databases can be pretty bad too. Try discarding all your changes, your users might not notice the difference, but they will appreciate the performance gain.

Check out the original post for a few more invaluable nuggets. If you follow all these tips you’ll be well on your way to becoming a respected and l33t hacker.

And now the big news. I’m really excited about this. The next version of WordPressMU will have a special Javascript client-side db (JCSDB) library built in. JCSDB will enable distributed and parallel access to your WPMU db without the danger of harming your servers. The best thing about it? If your site is dugg or slashdotted then your visitor’s machines will handle the load transparently. Instead of using slow and ungainly TCP/IP the library will use super-quick UDP to communicate. It really is the best way of sending data over the Internet.

I expect Matt will roll out JCSDB on WordPress.com just as soon as a few of the final bugs are ironed out. It might be a bit of headache for Barry and Demitrious to administer, but at least we can get rid of at least half our servers and use them to power a massive game of Counter Strike at the next WordCamp.

Update on May 31st! You all thought this was a joke didn’t you? Well, Google Gears has just been released and “is an open source browser extension that enables web applications to provide offline functionality”.

  • Store and serve application resources locally.
  • Store data locally in a fully-searchable relational database
  • Run asynchronous Javascript to improve application responsiveness.

It’s still in beta but Google Reader already supports it by allowing you to download up to 2000 items to read offline. This could be useful when I’m flying to SF next July!

Ubuntu's useful apt-get hints

Ubuntu 7.04, or Feisty Fawn as it’s known to it’s friends, has added a neat upgrade to the apt-get tool. For those who don’t know, apt-get is the tool Ubuntu uses to install and remove software. A small problem in the past has been trying to figure out what the name of the package required was.

In Feisty Fawn, if you try to run a command that isn’t installed a small message will be displayed telling you how to install it! The software has to be in your repository, so typing notepad and expecting it to tell you to apt-get install windows isn’t going to happen!

This morning I needed to update my local WPMU work area so …

$ svn update
The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion

apt-get moo still works too! 🙂

Filter spam through Postfix and Spamassassin

It has been a long time since I used and configured Sendmail, and I don’t miss it one bit now that Postfix is on the scene, but the amount of spam I receive does bother me. My Junk folder had reached 160MB, mostly due to some idiots sending huge spam attachments, but also because spam still works and a majority of the email circulating is spam and not legitimate.

Spamassassin is how we fight back. Unfortunately it needs a reasonably powerful server, gobs of memory and CPU when there’s a lot of incoming email and time to configure. Using spamd/spamc makes things easier on your server but it’s still a hefty price to pay for being spam free.

Here are a few pages I found useful this morning when getting things up and running on my Ubuntu server:

I also recommend running Postgrey to stop some junk mail before it gets into your system at all.

Now, if only there was a Spamassassin for the junk mail and clothes collection leaflets we get to the front door. How’s about a Defense Tower that would fire pellets when it noticed someone with leaflets calling to the door?

Edit: Justin talks about one of Spamassassin’s honeypot traps and about goings on at Blacklist.ie

Shutdown Ubuntu with ctrl-alt-delete

Power cuts are becoming a way of life for many people and here in Blarney we get our fair share of them unfortunately. The second in as many weeks happened this morning and before I could rig up a network cable between my laptop and desktop the UPS powered down and my big noisy desktop died with it. Thankfully without filesystem corruption.

Normally when you press the magic combo of ctrl-alt-delete the machine reboots but in this case it would be much better if the machine did a shutdown. In previous versions of Linux I had to edit /etc/inittab to get the desired effect but that file doesn’t exist in Ubuntu Edgy. Instead you must look at /etc/event.d/control-alt-delete. That file is fairly self explanatory which is all well and good because there’s very little information if you don’t know what to look for.

According to a post here, “Ubuntu replaced init with upstart event daemon”. It’s simple to change it to shutodown. Replace “-r” with “-h” in the following line:
exec /sbin/shutdown/ -r now "Control-Alt-Delete pressed"
No need to run inittab, just hit the magic combo to halt the computer!

PS. thanks so much for all the comments yesterday and the day before. I was bowled over by the response to both posts, especially the Daffodil Day one which struck a chord with many people

I made my Macbook cry

If Macs are so perfect why do they keep crashing and dying and need to be rebooted seeminly after every update? I’m just back from another reboot when Flock brought the system down. Yes, yes, must switch to another browser but after Mark’s ranting about the slowness and general bloatedness of OS X Firefox I’m wondering what I’ll use.

For all the fans of Microsoft Windows out there, here’s a sort of BSOD from the Mac. This happened at the last BarCamp in Waterford. I have witnesses!

2007-01-20__mg_8276.jpg

In the interests of fairness, I should also say that Linux died horribly on me when Firefox, Flock, GIMP and Bibblepro were all loaded and swap went haywire. It was quicker to put it out of it’s misery and reboot than wait for the kernel to kill one of the above apps. But why spoil a good anti-Mac rant by injecting some perspective?

Hi! I'm Linux!

imlinux.jpg

Apple advertisments become cliches within a short space of time which is a testament to how good they are, or perhaps how often the fanboys go on about them in online forums…

Unfortunately Linux is still regarded as being a geeky system only and spoofs of the current Apple advert feature a guy dressed in a Tron costume look ridiculous and certainly won’t help. This advert from Novell may help change that. If it doesn’t, well it might pique the interest of some guys who will try Linux and like it. Even though the advert is sponsored by Novell, I recommend you try Ubuntu Linux. You can download and try it without installing and it’s super easy to use!

Read all about it on Reverend Ted’s site and download the first advert.

All in all, it’s a balance that we hope to have struck right: representing Linux as sexy and confident, while avoiding sexual cliches that are degrading to women. While there may be some flaws in our execution (particularly how the third video throws out the people as computers metaphor altogether), overall I really hope that we managed to create a playful spoof that effectively subverts the “Mac vs Windows” framework that Apple has established with the “Get a Mac” campaign.

Ted updated his post with the second and third videos. I’ve included them here for your blogging pleasure.
Continue reading “Hi! I'm Linux!”

That mouse presses all the right buttons

Having just installed Ubuntu Edgy on a squeaky clean partition I’m still migrating some of my settings and programmes from my last Ubuntu install. Why did I reinstall when an upgrade from Dapper already went well? Unfortunately in the course of configuring my Wacom graphics tablet I broke my sound and for the life of me I could not remember how to fix it. That and I was running out of space and there was a nice 28GB NTFS partition doing nothing but taking up space..

Your mouse is probably luckier than some but if some of the buttons on it don’t work then look for the following line in /etc/X11/xorg.conf:
Option "Protocol" "ExplorerPS/2"
and change it to this:
Option "Protocol" "ImPS/2"

I hate middle mouse button clicking on a scroll wheel and this Microsoft mouse is worse than others. The side button works much better for me! Finally, I can press the right button again! 🙂

Oh and good luck if you have a widescreen monitor. My Dell 2405 LCD barfed every time I tried the graphical install. I had to look for the “alternate” cd and do a text install, and then install the proprietary Nvidia drivers and add a suitable modeline to /etc/X11/xorg.conf. I haven’t done that since I don’t know how long ago. Definitely in the last century.