Archive for the Linux Category

Most linux fiends will cry “WHY?” but I think if it makes more wife-friendly than it’s a good thing…

http://www.dawningvalley.com/2008/09/making-ubuntu-look-and-feel-like-windows-xp/

At 11pm last night I decided to install the latest version of Ubuntu – version 8.10 Intrepid Ibex. I grabbed the 32-bit alternate installer disc iso yesterday. It took about 1.5 hours – that is including the time it took me to change the server the OS gets it updates from. I have changed the update mechanism to check my local Internode mirrors so it doesn’t cost me bandwidth when a big release comes out.

It went quite well – the only hiccup was when I tried to get it to install over my existing linux partition – I had to manually re-format the partition before it would over-write…

Timeline:
1100 rebooted pc
1101 reset boot order in bios to set dvd as first boot device
1104 setting hostname
1105 setting clock and city
1110 erasing data on existing linux partition
1115 reformat linux partition due to “can’t delete base system files” error
1116 installing base system…
1118 default user account name = <MyUserAccountName>>
1119 user = <<MyUserName>>
1120 pass = <<MyPassword>>
1121 private passphrase = <<MyPassphrase>>
1123 scanning apt mirror
1125 select and install software…
1128   … 6%
1132   …25%
1135   …43%
1138   …60%
1145   …80%
1148   …84%
1150   …93%
1151 installation complete – first reboot
1152 test grub install worked ok – booting into windows…
1157   …everything AOK – rebooting back into Ubuntu 8.10
1159 password entry screen – login
1200 “Software update available” popup … [ignored]
1201 changing apt to use internode’s mirrors…
1211   …done – sudo apt-get update…updating
1213   …updates complete
1214 “Software update available” popup…
1217   …verified updates downloading from internode
1218   …7 minutes remaining
1225   …applying changes
1228   …system restart required
1229 TADA!

After this I had to make some small changes – the first being to allow users to have blank passwords – I needed my five year daughter to be able to login simply be selecting her login icon (barbie princess) from the gdm login screen.

Relax password rules so some users can login without password

Google helped me find this page which detailed a few shell commands that needed to be done to relax the default passwords complexity rules:

Remove the password for the user with username ‘myUser
open a terminal
- sudo passwd -d myUser

Authorize login with no passwords in gdm
- sudo sed -i ‘s/#PasswordRequired=false/PasswordRequired=false/’ /etc/gdm/gdm.conf

Authorize login with no passwords in pam
- sudo sed -i ‘s/nullok_secure/nullok/’ /etc/pam.d/common-auth

Set pictures on login screen for users

This was easy, for each user I logged on and selected System > Preferences > About Me. From here I only had to click on the default picture in the top-left of the screenand select a picture.

I stumbled across a font I wanted to use in a personal project. But it was in a PDF file. I found that this guy knew the steps to extract them and install the font on your windows box.

To summarize:

  1. Use linux (at the moment Ubuntu 7.10)
  2. Install fontforge (~$ sudo apt-get install fontforge)
  3. Convert your PDF to PostScript via ~$ pdftops pdffilename.pdf
    • this step creates files named pdffilename.ps
  4. Open the PostScript file in your favourite editor – ~$ gedit pdffilename.ps
  5. Find the following and extract everything between the lines with BeginResource and EndResource (excluding the Being/EndResource lines):
    %%BeginResource: font CIKHFG+Schoensperger-Modified
    %!FontType1-1.0: CIKHFG+Schoensperger-Modified
    ...
    %%EndResource
    Save the extracted portions as with a pfa extension (there may be more than one section, so 1.pfa, 2.pfa … n.pfa)
  6. Open the pfa files in fontforge until you find the desired font ~$ fontforge 1.pfa
  7. Reencode the font as Latin1 (Encoding – Reencode – Latin1)
  8. Compact the font (Encoding – Compact).
  9. Adjust the garbled font name (Element – Font Info – Names).
  10. Generate a TrueType or PostScript Type1 font to your liking (File – Generate Fonts).

Now that I have installed winXP I think it’s time to back it up.

Summary

[Backup]
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

[Verify backup files]
~$ md5sum /dev/hda1

~$ cat winxpsp2.img-part-* | bunzip2 | md5sum

[Restore]
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Detail

The dd command seems to be the way to go, but it backs up empty space as well, so I am using the compression tool bzip2 to ensure I don’t waste too much space. I’ll be storing the backup files on my network file server share.

First I’ll have to mount my file server shared directory:
~$ sudo mkdir /media/fileserver
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

This command failed with the following error (grrr):
smbfs: mount_data version 1919251317 is not supported

After a quick google session I found that it means the smbfs package is not installed. I installed smbfs via: sudo apt-get install smbfs then executed this again:
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

Now we are ready to backup not just the windows installation, but the entire partition that it is installed on.

The command to back up the partition is:
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

Where sudo time dd if=/dev/hda1 ibs=4096 means:

sudo Super user do. That is, do the following command as the root user.
time Report how long the commands took
dd Disk Dump (as far as I know)
if In file
/dev/hda1 A reference to the partition that has windows on it
ibs Input byte size. That is, read 4096 bytes at a time
   

The results of the above commands are then piped into the bzip2 compression tool where bzip2 -v --fast means:

bzip2 Name of compression program
-v Do verbose logging (a bit pointless when piping – it really shouldn’t be there)
–fast Do fast compression. basically means it’s compressing smaller block sizes, which leads to sub-optimal compression. 7.5GB is still going to take about 2 hours on my AMD 2500+ CPU

The output of the compression tool is then piped (yet again) to a tool called split that splits large files into smaller ones. It uses the following syntax split -a 2 -b 1024m - winxpsp2.img-part- where:

split Name of splitting program
-a 2 The number indicates how many suffixes to use in the output file name. Say I split a large file into 3 pieces. I can use -a 1 to give me three files called filea, fileb and fileb. Using -a 2 would result in three files called fileaa, fileab and fileac.
-b 1024m Indicates the maximum size of each split output file – in this case 1024MB (1 gigabyte)
- winxpsp2.img-part-: The first dash means read from standard input (or piped input – same thing really). Usually you could put the name of a file to split. The ‘winxpsp2.img-part-‘ bit means to name each file winxpsp2.img-part- followed by the specified amount of suffices. In this case winxpsp2.img-part-aa, winxpsp2.img-part-ab, … winxpsp2.img-part-ah.

Eventually I guess I’ll do something silly and trash Windows XP. If that is the case I should be able to restore it by:
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Tada! A brand new windows installation in mint condition.

Before i re-install windows I thought it would be prudent to ensure that I select the correct partition to install on.

Finding out how your partitions are set up is quite easy in Ubuntu. Bring up a command shell and start the The GNU Parted disk partition resizing program, otherwise known as “parted”. To start it type sudo parted at the prompt.

Then all you have to do is type print all. Here is the output from print all on my PC:

Disk /dev/hda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
.
Number Start End Size Type File system Flags
1 32.3kB 7863MB 7863MB primary fat32 boot
4 7863MB 15.7GB 7863MB primary ext3
2 15.7GB 79.5GB 63.8GB primary fat32 lba
3 79.5GB 80.0GB 526MB extended lba
5 79.5GB 80.0GB 526MB logical linux-swap
.
Disk /dev/hdc: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
.
Number Start End Size Type File system Flags
1 32.3kB 200GB 200GB primary ntfs

You can see I have two hard drives. Ubuntu references them as /dev/hda and /dev/hdc.

/dev/hdc is just a single partition of 200GB that I use to stash data on (My Documents, family pictures, mp3′s etc).

The other one – /dev/hda is a smaller drive I use to hold my operating systems. The logic here is that I can re-install Windows/Ubuntu as often as I like and my data will remain intact on the PC.

hda: [80GB] First hard drive

  • hda1: [7.8GB] Windows installation (C:\)
  • hda2: [63.8GB] General dumping ground – shared between operating systems. (G:\ in windows. Known as /media/hda2 in ubuntu).
  • hda3: [0.5GB] extended partition for holding logical partitions
  • hda4: [7.8GB] Ubuntu installation (\)
  • hda5: [0.5GB] linux swap partition

hdc: [200GB] Second hard drive

  • hdc1: [200GB] Data drive. (D:\ in windows. Known as /media/hdc1 in Ubuntu).

I am going to re-install windows soon.

I haven’t done it in years, and the amount of cruft that has built up over that time has slowly increased. I am usually pretty on the ball regarding system maintenance and hat not but some things have recently started to go quirky on me. Typical stuff like general unresponsive system, Skype won’t recognise my microphone, even though I can hear it coming through the speakers, blah blah.

The only problem is that I have Ubuntu installed on the first partition and Windows installed on the second. Windows has little respect for the master boot record (MBR), and will happily overwrite it when I re-install, so I need to do something so I can restore the MBR back to it’s original state after the Windows installation.

Use disk druid and a live-CD:

  • Backup: $dd if=/dev/hdx of=MBR-backup bs=512 count=1
  • Restore: $dd if=MBR-backup of=/dev/hdx bs=512 count=1

Alternatively just use a live-CD in rescue-mode and use grub-install to fix it up for you! (Details provided on same page as previous link – first comment)

At home the study PC is used by the entire family. We all share the same account. I’ve been getting quite into Ubuntu for quite some time now, the only thing stopping me from moving entirely to Ubuntu is the wife factor.

  1. Email clients are different.
  2. Everything looks different.

Our windows email client is Eudora. While it’s in the process of being open-sourced there is still no linux client. The reason we don’t just switch is due to the history. We’ve got 5+ years of emails, attachments and addresses stashed away in Eudora that I am not sure how to port over to something like Thunderbird.

So, in the meantime I’ve installed Ubuntu 7.04 (aka Feisty Fawn) – desktop edition to another partition and have settled on dual-booting until I can get these things sorted out. I am slowly working on problem 2 – Everything looks different…

I found a post on whirlpool that mentioned some of the things I was thinking – like xpde an xp theme for Ubuntu. But I didn;t like xpde, and figured I could come up with something that was more like the theme we use at home.

One guy mentioned replacing the Ubuntu menu icon with a more windowsy start icon.

 

The Ubuntu logo icon is called ‘distributor-logo.png’ and right now 95% of themes and icon sets are unaware of it as it has just been introduced. This will change. But for now, just replace it. Either globally (/usr/share/icons/hicolor/48×48/ap­ ps/distributor-logo.png) or per-user (~/.icons/name_of_your_current_ico­ n_theme/somedir/apps/gnome-main-menu.ext).

So I made one. Tada:

You can probably guess that I am a fan of Windows 2000 themes. We still use Windows 2000 at home, and I dislike the XP theme enough that I switched my work PC back to the Windows 2000 look’n'feel asap.

Update (7 March 2008)

I managed to get linux and windows reading the same profile information so they could share the same emails and address books. One way to do is outlined here, but I found an even easier way:

  • Install Thunderbird on first OS
  • Make sure your profile is stored on a partition that can be read by both windows and linux (ie a FAT32 partition).
  • Check everything is still AOK in first OS
  • Reboot into your other OS and open Thunderbird using the “-P” parameter to ensure the profile is asked for.
  • Point it to the funny named directory (something like 1a2s3d4fg5.default).
  • Tada! Your alternate OS can read and share the same email  and address book.

Worked a treat for me.

I finally installed the latest version of Ubuntu on my desktop PC. Granted, it’s still dual-boot with windows, but it’s now there. I am typing this in a Feisty Firefox session. Yay.

It took about 25 minutes for the installation to complete. Not bad. I am now installing updates – 147MB…

I am hoping my machine can handle Beryl.

Ok this is old but fantastic.

[youtube=http://www.youtube.com/watch?v=xC5uEe5OzNQ&rel=1]

Bugger.

I was soo stresed out.

I figured I must have done something wrong. But no. After hours/days trying to fix the problem and getting no further than a command prompt teasing me I found this http://www.ubuntu.com/FixForUpgradeIssue and this. Seriously – not happy!

And now it’s bloody well time to do it again – Dapper to Edgy…