Wednesday, December 30, 2009

Firefox for Debian Stable

It can be difficult labeling an article so that the contents are obvious.  In a way, this applies here, because whilst it is labeled "Firefox for Debian", it could also be labeled "Mozilla for Debian".  During the course of my research for this article, I found that Thunderbird, Sunbird and Seamonkey are equally covered, and so I have chosen to use Firefox as the example.


Debian Stable, Iceweasel and Updates

As many know, Debian have their own version of Firefox in their distribution, called "Iceweasel".  This is fine as far as it goes, however two things get in the way of practical implementation.  First, a number of websites baulk at this "strange" web browser, and also, once a flavour of Debian becomes "stable", no further version updates appear within a package, only security and bug fixes.  The interval between Debian Stable releases normally exceeds a year, and so by the time a new "Stable" release appears, web browsers and email clients can be significantly out of date.


Installation Methods

So, how can we install a fresh and proper Firefox (or Thunderbird / Sunbird / Seamonkey)?  There are several options:
  • Download the source from Mozilla and create an installable package using Checkinstall.  (there is a variation on this that I am investigating that looks very interesting indeed for many uses).
  • Download the binaries from Mozilla and manually install.
  • Use the Ubuntu repositories.
Whilst they each have their advantages, for the moment I want to look at a manual install.  It is easily understood, enables us to learn a lot about how the software is set up within the distribution and provides us with a lot of background information that is useful if we want to make our own installable Debian packages.


Plugin and Profile directories

Whilst it IS possible to use both Iceweasel and Firefox for the same user, it can definitely get messy, as they use the same profile directory - that is, the directory (hidden) in the user's home directory.  The profile directory contains user information, bookmarks, history and add-ons that the user has installed.  For both Firefox and Iceweasel, this directory is:

  .mozilla/firefox      (note: Seamonkey uses    .mozilla/seamonkey)

Now whilst Firefox has it's default plugin directory within the firefox package, Debian has several plugin directories for all Mozilla products where it installs the Debian supplied plugins.  For our purposes, though we really only need concern ourselves with

  /usr/lib/mozilla/plugins



Program Location

The easiest place to put Firefox is within your home directory:

   /home/username/local/firefox

If this is your chosen location, and this is the easiest, then the program is only available to you.

Another place that Debian leaves alone, is

  /opt

I had a brief flirtation with this as a place to put programs, however the traditional location has won out for a number of good reasons.

  /usr/local

To find out why, open a terminal and type  "   $PATH  "  ... notice that "/usr/local/bin" is the first in the queue for executable status?

To be more precise ....

/usr/local/share/applications


Firefox - Manual Install

Download the latest Firefox from here:

http://www.mozilla.com/en-US/firefox/personal.html

you will have a file similar to this:

firefox-3.5.6.tar.bz2

Assuming it is in your home directory, then open a root terminal from the Applications>Accessories menu and executing from the same directory as the tarball is:

# tar -xvjf firefox-3.5.6.tar.bz2 /usr/local/share/applications

you will now have a directory "firefox" like so :
/usr/local/share/applications/firefox

we now have to put a link to the firefox executable script in /usr/local/bin and link up the plugin direcories.

debian:/# ln -sf /usr/local/share/applications/firefox/firefox /usr/local/bin/firefox 

debian:/# rm -rf /usr/local/share/applications/firefox/plugins
debian:/# ln -s /usr/lib/mozilla/plugins /usr/local/share/applications/firefox

Now, if you open a terminal, you should be able to:

$ firefox

and run firefox.

Finally, remove iceweasel either with synaptic or apt / aptitude.

All you have to do now is to add Firefox to your Gnome menu system / Debian menu system or place a launcher on the desktop.  I'll leave doing that for another post, as this one is long enough already.

Thursday, December 10, 2009

Building a Debian Squeeze System - Part 1

My Daughter's computer died a few days ago.  It was about 5 years old, so we replaced it with one that was more suitable to her current needs, but then we were left with what was basically a good machine.  It was easily repairable, needing only a new Hard Disk drive, and co-incidentally, a friend of ours needed a machine that was an improvement on what she had.

From there was born the idea of resurrecting our dead machine.  It was a Pentium 4 2.8 with a Gigabyte of memory, nVidia 5200 video, Floppy disk, Firewire and two DVD R/W drives. 

First step was to buy a new sata hard disk.  500Gig for $75 seemed pretty cheap.  After that was installed, I booted the machine with "Parted Magic" from CD and partitioned and formatted the drive to a 40 gig "root" partition, a 4 gig swap and the remainder to "home".  Parted Magic is just a great utility distribution with some very useful tools and easy to use.

Next, I booted up with Debian's "netinstall" cd for the "testing" branch, "Squeeze".  The installation procedure is identical to Lenny, and an excellent "how-to" for installing Debian Lenny is here - http://www.howtoforge.com/the-perfect-desktop-debian-lenny .  In my case, the end result was booting to the command line, rather than the Gnome Display Manager (although boot time was amazingly fast).  Easily dealt with though - after logging in, just type "startx" and you are away.

However .....

There is a better way if you want to boot into a graphical environment (remembering that there are several ways to fix this). 
  • Boot as normal and log in as the normal user  ( $ ).
  • Type "su" at the "$" prompt to become the superuser ( # ) and give the root password when asked for it.
  • Type "aptitude install gdm" at the # prompt - a number of packages will now be downloaded and installed on your system.
  • Type "reboot" at the # prompt again.
You'll now boot into a graphical display.

The above example shows how the Debian tools turn what could be a painful experience into only a few seconds typing.  The Debian package management system and its associated "dpkg", "apt" and "aptitude" toolsets really make administration of this sytem easy.  An alternative to "aptitude" above, would have been "apt-get", which is now discouraged and which I am trying to get out of the habit of using.  Aptitude is superior in that it keeps track of all associated package dependencies when your target package is removed from your system, apt-get only tracks the primary package, not the dependencies.

So, I now had the basic "Squeeze" install.

More later

Tuesday, December 8, 2009

Snow Leopard and NTFS

This episode came out of me recovering data from my Daughter's Linux installation.  I'd been thinking of getting her an iMac for Christmas, and damn if her Lenny machine didn't agree.  First, it wouldn't boot, and then there were multiple disk errors .... mayday!

Because of the limitations of the failing file system, I copied the data onto an ext2 formatted disk.  I copied the data onto a storage drive on another system and then set about finding how I could transfer the data to a Snow Leopard Mac.

To cut a long story short, I found that an external ntfs drive had to be formatted from a Microsoft system to be recognised by the Mac.  Linux has a number of ntfs tools (easily installed in Debian) that enable an ntfs drive to be writeable by Linux.

From there, it is easy ..... write the data to the external drive and then copy it to the Mac.  Snow Leopard has native ntfs READ capability.  (It has native write capability, but this is hidden).

Some places to look ....

http://www.ntfsmounter.com/
http://www.tuxera.com/community/release-history/
http://forums.macrumors.com/showthread.php?t=785376
http://macntfs-3g.blogspot.com/

Update 29Dec 2010

I downloaded the ntfs-3g driver from here:
http://sourceforge.net/projects/catacombae/files/NTFS-3G%20for%20Mac%20OS%20X

Installed fine.

:)

Saturday, November 21, 2009

Debian Squeeze - Renovating an Infected XP Machine - Part 1

A few days ago, a friend called me to ask if I'd have a look at their home computer.  She told me that it had recently started to slow down markedly, and had become difficult to use.  When I indicated that I was home now and had some time to check it all out, she immediately told me to stay there and she'd be over with the machinery in about 20 min.

Having a look at what she brought over revealed a mixed bag, but a machine that had some good points.  It was oldish, but had a Pentium IV 2.4, 2 Gig of Memory, a Geoforce MX400 AGP video card and a 120 gig HDD, together with a Combo DVD/CD drive.  They had a 15 inch LCD screen, and the OS was Windows XP Home.

Firing everything up, and it waasss slloooowwwwww ......... it just didn't feel right.  So, load some portable tools on a USB stick and do a registry clean and search for spyware / malware.  I copied some tools over from my Mac laptop and started work.

I started to become suspiscious when every registry scan crashed, then every spyware / adware / malware cleaner crashed as well.  Hmmmmm.  And then when I looked at the USB stick next time I mounted it on the Mac, there were two locked, hidden files - the "autorun.inf" and a 600k executable "kalwka.exe" (or something similar).  I deleted them (with much squawking from them) and connected the USB stick to the Windows machine again.  I immediately removed it and had another look - the files were back.  That solves that mystery .... but what to do about it?  I did an internet search, but that revealed nothing.  And there was little point pursuing it further - the machine was infected with somthing that did not wish to be removed.  At the very least, a reformat and new Windows install using the recovery partition (via the supplied floppy disk) was called for.

First step was to call the friend and suggest they change as many passwords as they could think of, in case this beastie had been talking home.  Next, I suggested they come over for dinner in a couple of days and I could tell them of a few possibilities, and in the meantime, maybe they'd like to consider Linux as a replacement on the machine.  I was somewhat pleasantly surprised to get a return phone call with them enthusiastic to check the possibility out, so I prepared the system for our "installfest dinner".

My evil plans for the machine .........

Having seen the video performance, I figured replacing the video card with a newer one was a good idea.  Any AGP card now was going to be way too powerful for the machine, but at least it would be CPU limited, rather than GPU limited as it currently was.  And who knows?  Linux may do something similar to Mac Snow Leopard and use the GPU for general computing power.  End result was an ATI Radeon HD 3650 card, for no other reason than it was cheaper than the nVidia card on offer.

Now for the software ... well I had a 120 Gig HDD to play with, most of which was vacant - so I figured I'd shrink the XP partition and install ntfs RW access so they could find and recover their data.  I have had previous experience with people hiding their data in strange places on Windows, and have no wish to repeat the mistake of blithely deleting said data.  I tried a couple of "parted" based CD distros (which refused to boot), however Parted Magic was the clear winner - wow - what a neat distro.  Most impressed.  So I went ahead and shrank the XP partition to about 30 gig, and created a swap and 90 gig partition for my install distro.

What to install?  I'm a committed Debian / Slackware fan.  Whilst I'd have loved to have done Slackware, Debian is the go - or a derivative.  As it turned out, I tried Mepis - mostly because I believe the basis for this distro is more sound than Ubuntu, but as luck would have it, the DVD drive would not boot Mepis - something I ultimately figured was the fault of the drive - an incompatibility between the drive that burnt the disk, and the drive that read it.

So, in a fit of curiosity I called up the Debian Installer page and downloaded the latest netinstall for Debian testing - (Squeeze at the moment) due to go stable next year some time.  I find it interesting that no matter what I do, I end up coming back to Debian.  The burnt CD booted flawlessly and a standard Debian desktop was soon installed.  Then dinner called, and the evenings adventures turned to food and wine.

Wednesday, November 4, 2009

Debian Squeeze Pt 3

 Grub
 After I managed to get my Lenny installation back into the Grub menu by using " update-grub ", I spent some time trying to work out WHY Grub in Squeeze didn't seem to correspond with that in Lenny.  Answer - Squeeze uses Grub2 .... well that is pretty obvious.  Instead of a Menu.lst file, there is now a Grub.cfg file that contains the parameters.  Grub.cfg says that the automatically generated part of the file should not be edited, however I see no other way to change the timeout value of the menu splash screen, or which distro is seen as the default.  More research.

grub.cfg notes.

Well, according to the notes, I can edit the file and change the timeout and default boot by a simple edit of two values.  So I opened the file ready to edit it and there at the top it told me to go to " /etc/defaults/grub " and edit the values in there.  Aha! Simple ..... change the timeout value, and put the LINE NO of the entry I want to be the default.  The first line being 0.  In my case, I wanted the 4th entry to be the default, so I set the value to 3.

done!

works a treat!

Tuesday, November 3, 2009

Debian Squeeze Pt 2

Love Hate
A few days after having Squeeze on my machine, there were a few hates and a few things to love.
  • It is just so great to have wireless "just work" without having to worry about any other packages.
  • Everything I've thrown at the Gnome multimedia player has "just worked".
  • Grub did not cleanly install the first time.  Only Squeeze appeared on the menu, which was a little more flashy than previous, though irritating in other ways.  Still, "update-grub" worked fine and I regained my other inatallations.  For all that though, I still need to edit the menu so will have to investigate that.
  • I love the way Gnome automounted any extra partitions it found.
Video
One thing I wanted to do was to install the nVidia video drivers.  Unfortunately, the "Debian way" from the repositories failed for me for some reason, so I reverted to simply installing them using the nVidia installer.  There is a nice tutorial at "Pendrive Linux" that shows how to do this.   Any time a new kernel is installed, this procedure will need to be repeated, so it is worthwhile having the instructions printed next to your computer.

For all that though, I'll re-attempt the "Debian way" at a later stage.

Extreme Tux Racer
A silly game perhaps, but it is still fun for a little diversion.  Unfortunately, I could just not get the thing to work on my machine.  Any time I tried to start it, I got an "out of range" message on a black screen, and that was it.  I had it in my brain that this referred to the video refresh, until it occurred to me that maybe it was the screen resolution.  How to fix it?  Well, it so happens that the configuration settings are in a hidden directory " .etracer " in the user's home directory.  Open this and there is a textfile called "options".  All I did was to open this in an editor, find where the screen resolution was listed (default is 800 x 600 ) and replace these figures with my actual resolution.  Voila!!

Friday, October 30, 2009

Debian Squeeze Pt 1

It was almost the last day of the month (Ubuntu KK released today) and I had plenty of bandwidth left.  I had this new 500 gig HDD I'd installed not doing anything, and my Debian Lenny install, whilst I was really happy with it, was stuck at 8 months ago.  Now 8 months may not seem like much, but in the Linux world it is really, really big.  Not only that, those 8 months had seen the next iteration of the Debian produce mature to at least a good representation of what it would be.  So, it was time to have a look at Debian Testing, aka Squeeze.

Now, I must admit here that I've installed Debian many times, so I do tend to gloss over some details that would infuriate someone new to the craft.  The best grounding I can give is the wonderful tutorial to set up Debain Lenny that is on "howtoforge".

Of course, when I went to search for this article, I came apon a similar one for Slackware 12 which I HAVE to include.  Slackware is wonderful - make no mistake.  If you do not realise this then go stand in front of the mirror and take a good look at yourself...... :)

Back to my Squeeze.

I suppose I should start off with what hardware I have.  Well, it is old.  I have a Gigabyte motherboard that hosts a P4 3.0C intel processor.  I have a sound card add on, an Nvidia 6800 video card and 2 gig of memory, and I recently installed a Dlink Atheros powered WiFi card.  My screen is a 22" Chimei LCD screen.  One final piece of information is that the HDD I am installing to is the slave drive, or "hdb".  Now Windows has a real hissy fit with this configuration - or it has done historically, but Linux is pretty flexible. 

First, where to get a "Squeeze" install CD.  Well you can get a "netinstall" cd from here:

What is a netinstall cd?  A netinstall cd is one that will bootstrap a full Debian install, initially putting the basic files on the system and then going to a repository on the Internet to get the rest.

Another thing I do before installing ANY Linux distro, is pre-prepare the HDD.  How to do this?  easy .. there are several minimalistic distros for just this purpose to partition your drives, Gparted being one.

I am only going to deal with a virgin HDD here .. manipulating one that already has Windows installed becomes more complex.  After booting the CD containing Gparted / Parted Magic or whatever, I look at the HDD I intend installing Linux to.  I make sure there is a partition (about 10 - 15 gig) to install the Operating System to, I give about 20 gig to a second partition for "Home" and then double the system memory to a swap partition.

Now that I have my disk set up, it is time to reboot with the Debian install CD.  Everything goes pretty much as the Lenny install, with a couple of nice touches.  Squeeze instantly recognised the wireless card on my machine and asked which I wished to use - wired eth0 or wireless.  I really liked that Grub installed to BOTH HDD, just in case you made the slave a master. 

Reboot.

A really nice desktop.  I was easily able to mount the partitions in my old HDD and everything was as I expected.

Next?

How to update, install new repositories, install video drivers .. etc etc.

Another post.