22/10/2008

Linux Swiss Army Knives for exchanging hard drives

One of the very basic problems: you have to exchange a harddrive, either because it is about to fail or it has simply become too small for the job, but of course you don't want to reinstall all your OS's and data. Here are some tools which might help you rescuing your cherished Windows, Linux and all your settings.

  1. Have a computer with a CD-ROM drive and enough RAM ready.
  2. (Can't say it often enough) BACKUP ALL YOUR IMPORTANT DATA!
  3. Download a live-cd of Gparted.
  4. Get a Live-CD of your favourite flavour just in case you need to work with a console . I like to use Xubuntu, because the desktop environment is saving resources and I need the shell most of all anyway.
  5. Get the CD version of Super-Grub.
  6. Set the drive jumpers (master/slave) accordingly to the setup in your machine.
    If you use P-ATA 2.5'' drives, get a 3.5'' to 2.5'' adapter for each of them to be able to connect it to the normal IDE bus.
Now start your computer with the GParted live CD. The process of copying and enlarging partitions is self-explaining within the graphical interface of GParted.

In my case, the Windows system partition as well as the ntfs data partition and the linux ext3 home partition were copied almost perfectly; however, the Linux system partition was entirely corrupted. I restored it via dd, see this post about dd, this post about mounting images and this post about mounting network shares

Now you have a nice and resized copy of your OS's on the new hard drive. Plug it into your destination computer. BUT: booting will still be a problem, since you never copied the Master Boot Record (and be very careful about fiddling with the MBR, you might kill all your data)

Here the SuperGrub disk kicks in: just boot from it and choose super-grub. The disk will rewrite an appropriate boot sector code and will enable you to boot at least one of your OS's. BTW: it can also restore a Windows XP MBR, if you just happen to have only this OS...

16/10/2008

Security bugfix in CUPS 1.3.9

Once again according to Heise, CUPS 1.3.9 fixes some possible exploits, so I was a bit miffed to find nothing more recent than 1.2.12 in the openSuSE main repos (on 10.3, at least).
However, CUPS 1.3.9 is available from the openSuSE Printing repo.

10/10/2008

Spontaneous Audio failure

Tried to play an mp3 this morning. Amarok message: "xine was unable to initialize any audio drivers" Mplayer: "jack cannot open server". Had a slight déjà vu and kicked myself for not having logged what worked in my case, which was deleting the card in Yast->Hardware->Sound and having in autoconfigured again afterwards.
No risk involved, provided you did not configure the card by hand and don't care about losing the old config.

N.B.: This happened on Xanthippe, Tisiphone and Archimedes consecutively. Is it just me???

08/10/2008

Network print on a Windows machine

Here is the howto for connecting to a Windows printer from Linux

Prerequisites: installed samba (maybe samba-client is sufficient), cups, ghostscript, foomatic-filters (most of them are default anyway), the printer must be shared and accessible over the network.

  1. Open a browser of your choice and type localhost:631 into the address bar
  2. Click "Add printer" and fill name, location and description and continue
  3. For device choose "Windows Printer via SAMBA"
  4. Device-URI: smb://<windowsboxname>/<printersharename> - no port required, so leave it empty
  5. Choose the model of the printer - if the driver is not in the database you'll have to provide the ppd-file.
  6. At around this point you'll be asked for user name and password for CUPS (most likely, your root password, depending on your configuration)
  7. Change options if neccessary and enjoy

06/10/2008

Packages to add to a standard installation

These are the packages I would always install from the main repo (more a reminder for myself, but I guess it is useful for many people out there as well). This list is by far not complete and will be updated.

  • ntfsconfig (gui helper for setting read/write ability for ntfs drives)
  • quanta (web site development suite)
  • lynx (text browser for console - old, but can be very useful if you're left with a shell only)
  • texlive (LaTeX System)
  • kile (LaTeX Editor)
  • miktex-tools (if you use LaTeX and want to have a convenient package manager
Additionally, there are some packages which are not really usable or functional in the standard installation and should be replaced by packman versions (see post by avocadohead)

03/10/2008

Keep track of your YaST updates

Right on top of my YaST Installer wishlist would be a "sort by install date" option in order to easily revert what yesterday's uncautious update screwed up. At least I found out where the installer log is: /var/log/YaST2/y2logRPM.
sudo tail -n 100 /var/log/YaST2/y2logRPM (100 last lines) ought to give you a hint about the most recent changes.

Note: Doesn't work for SuSE 11.1. Try
# sudo tail -n 100 /var/log/zypp/history
If you want to compare when you installed which version of a certain package:
# sudo cat /var/log/zypp/history | grep -i <packagename>

25/09/2008

HTML special characters with KFileReplace

O my beloved Umlaut! … and all the characters I never wanted to know about … €¶Ŧ←↓→ØÞ¨ÆßÐŊĦĸŁ …
Copy and paste of non-standard ASCII text in Quanta can be cumbersome as the automatic replacement plugin only works with typing (Settings->Configure Quanta…->Automatic replacement of the accented characters). Another option would be to do some batch search-and-replace.
KFileReplace works both as a standalone app and a Quanta plugin (I don't think there is a Kate plugin yet). Multiple strings can be replaced directory-wide in one go, the session format is XML. I just googled a special character map (for reference, see e. g. here), wrote the .kfr XML file with a spreadsheet editor, and loaded it from KFileReplace. (Search/Replace->Strings->Load Strings List From File...)
Warning: Alpha-Howto! This has not been tested rigorously and might do some unwanted replacements; neither can it be a comprehensive list (e.g. no Greek characters except µ, sadly, I also decided against Chinese). Also, KFileReplace overwrites your original file (no undo!). I strongly recommend to enable "Do backup copy instead of overwrite" in the "Customise Search/Replace Session" dialog.
Whoever finds another culprit in the replacement list, please leave a comment.

Firefox 3.0.2

According to the German Heise Security page Mozilla has patched some important security issues in Firefox 3.0.2. As of this morning, that version is not yet available in the main update repo, but you can get it from the Mozilla Build Service Repo.
Update: 3.0.2 had another bug, passwords containing non-ASCII characters can't be accessed. 3.0.3 is already out and fixed (same repo).