Sign Håvard Rast Blok

Blog

I just installed a new and bigger harddisk in my mum's laptop, and wanted to preserve the dual boot setup, with Windows XP and Fedora. Actually, it was enough to keep the Windows partition, since the Fedora was lagging behind a few updates.

Using a generic, but extremely useful IDE-to-USB adapter, I could copy the full Windows partition over to the new drive, without having to reinstall or change anything. Credit goes to Ed Anderson for putting together this guide to help with that task. To summarise the gist of it:

The internal drive was on /dev/hda, while the new and temporarily external was /dev/sda.

  1. The first step was to examine hda, and record the old partition details, system ID, and START and END in sectors:
    fdisk -l -u /dev/hda

  2. Then run fdisk on the new disk, also working in sectors:
    fdisk /dev/sda

    u (for sectors)
    n, p, 1, START, END (new partition, with same START and END sectors)
    a, 1 (set boot flag)
    t, ID (set same ID as old partition)
    w (write and quit)

  3. Now we're ready to copy the data. First the Master Boot Record (MBR), and then the Windows partition:

    dd if=/dev/hda of=/dev/sda bs=446 count=1
    dd if=/dev/hda1 of=/dev/sda1 bs=4096


  4. Then insert the new drive at the location it should live in.

  5. Install Fedora using your favourite method, making sure you create a grub boot loader which has the Windows partition as an option.

Jul. 28th, 2008

  • 11:00 AM
Here's a repeat of a previous entry on Fedora installation, this time for version 9:

"Personal Fedora 9 Installation Guide" by Mauriat Miranda
(http://www.mjmwired.net/resources/mjm-fedora-f9.html)


For the quick version:

yum -y update

rpm -ivh http://rpm.livna.org/livna-release-9.rpm
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm

yum -y install thunderbird gqview glipper gstreamer-plugins-ugly vcdimager dvdauthor mjpegtools mencoder gnome-mplayer mplayer-fonts kino xine libdvdcss amarok xmms-mp3 kdemultimedia-extras k3b-extras-nonfree kover libcddb azureus bittorrent-gui mozplugger gtkpod hugin digikam enblend easytag pidgin-otr bash-completion obexfs flash-plugin AdobeReader_enu amarok-extras-nonfree vlc gnome-volume-manager qt4-x11 emacs kdiff3 kdegraphics gnucash

wget http://www.skype.com/go/getskype-linux-beta-fc7
rpm -ivh /tmp/skype-2.0.0.43-fc5.i586.rpm

wget -O /tmp/all-20071007.tar.bz2 http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
mkdir -p /usr/lib/codecs
tar -jxvf /tmp/all-20071007.tar.bz2 --strip-components 1 -C /usr/lib/codecs/


This should take care of most media players, flash and pdf plugins, Skype, and iPod support through gtkpod, and other useful programs.

Windows infected in five minutes

  • Jul. 15th, 2008 at 11:15 PM
Slashdot is reporting on a study from SANS Institute's Internet Storm Center which shows that an unpatched Windows XP box will be infected after about five minutes on the Internet. German researchers found that it took slightly longer, however the conclusion still holds:

"While the survival time varies quite a bit across methods used, pretty much all agree that placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas."

Flight photos over Sarpsborg

  • Jul. 10th, 2008 at 8:27 PM
During my last trip to Norway, I used the new Moss/Rygge airport and flew via Copenhagen. During both flights we crossed right over Sarpsborg, Fredrikstad and Sandbakken, and I also had a beautiful view of Svinesund and Koster. I've updated the picture section we some flight photos:

http://hblok.net/pictures/public/misc/flights


The Max Planck Institute for Software Systems brings you a test to see if your ISP is throttling BitTorrent traffic from your computer. At the end of the tests, it also gives some nice statistics on your upload and download speeds.

http://broadband.mpi-sws.mpg.de/transparency/bttest.php

Encryption

  • Jun. 19th, 2008 at 10:37 PM
In the wake of the recent internet traffic monitoring law passed in Sweden, it is highly overdue to get serious about encryption. First off, e-mail encryption, focusing on PGP/GPG. Below are a some useful links:

Enigmail: PGP/GPG extension for Mozilla Thunderbird.

FireGPG: GPG extension for Mozilla Firefox. Brings e-mail encryption to Gmail, and any other website with GPG content.

GpgOL is a plugin for Microsoft Outlook 2003, by the maintainers of GnuPG.

GPGoe is a GPG plug-in for the Microsoft Outlook Express.


For even more links about PGP/GPG and related tools, see Folkert van Heusden's collection of information.

WINE, DOSBox, Doom and Hero's Quest

  • Jun. 17th, 2008 at 10:55 PM
WINE version 1.0 was announced today, and this got me thinking maybe I could run some of the old games I used to play some 15 years ago. Well, at that time, Windows wasn't needed at all, so I turned to another great project: DOSBox, an excellent MS-DOS emulator, focusing primarily on games.

So I had to dig out some old games then. Doom seemed like a natural first choice, and after a bit of shifting through various groups, it ran fine. In fact, below you can see a screenshot of Doom, Doom II and Hero's Quest all running at the same time under Fedora 9.





Installation


yum install dosbox

Today, this gave me dosbox.i386 0.72-4.fc9.

Configuration


* Start up by simply typing: dosbox
* In the DOS-terminal, type: CONFIG -writeconf dosbox.conf
* Exit the terminal by typing "exit"
* You will now find the file dosbox.conf in your current directory.
* Move and rename this file: mv dosbox.conf ~/.dosboxrc
* Next time you start DOSBox, it should say: "CONFIG:Loading primary settings from config file /home/username/.dosboxrc"

Sound


On the initial start up, DOSBox gave the following error messages, which many people have reported:

MIXER:Can't open audio: No available audio device , running in nosound mode.
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)


To start with the last issue, the MIDI port. This was easily fixed by updating the midi-section in the .doxboxrc config file created above. Theses settings works for my onboard "VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller"

[midi]
mpu401=intelligent
device=alsa
config=128:0


The second issue required the PulseAudio server to be started. Simply typing pulseaudio will take care of that. You can verify that it is working correctly by runnging paplay /usr/share/sounds/generic.wav, and you should hear a small sound.

After this DOSBox reported no more errors, and would play both MIDI and sound effects. For some games, you need to "install.exe"/"setup.exe" to set the sound properties. Make sure the IRQ, DMA and port settings match the settings in your .dosboxrc. (Had you also almost forgotten your favourite IRQ/DMA setting? :D )

Heli Invasion 2 - addictive Flash game

  • Jun. 13th, 2008 at 2:52 PM
Try out this super cool Flash game:
http://www.spudmud.com/games/23-Heli-Invasion-2/

Also, make sure you download Firefox 3, so you can increase the Flash app by pressing CTRL++
http://www.mozilla.com/firefox/

Automatic Login on Fedora 9

  • Jun. 8th, 2008 at 9:59 PM
After updating to Fedora 9 today, Autologin was disabled. It seems it has been deliberately taken out. The current fix for Gnome is as follows:

Edit /etc/gdm/custom.conf
[daemon]
# http://live.gnome.org/GDM/2.22/Configuration
TimedLoginEnable=true
TimedLogin=yourusername
TimedLoginDelay=0


You might want to set the delay to a few seconds. More information here:
http://dnmouse.webs.com/autologin.html
Stefan Grothkopp has put out a very slick, and fun, command line interface to Google, running in your browser. http://goosh.org

Things to try:
> w street parade
...
> 1

> p zurich

Along the same lines, Surfraw and the likes of Links, Lynx, and w3m will do about the same, in your console.
$ sudo apt-get install surfraw w3m
...
$ sr google test

(Note: the Debian/Ubuntu packages work fine, however Fedora's repositories hold an older, broken version of Surfraw.)

Fedora 9 relesed

  • May. 13th, 2008 at 7:09 PM
Fedora 9 has been released. Get your copy here! Release notes can be found here. From Slashdot:

"Some of the more interesting new features include a new package management system, which can be used as an alternative to yum, known as PackageKit. This release also includes GNOME 2.22 and/or KDE 4.0.3, and Firefox 3 beta 5. Overall, there are a lot of improvements worth looking at, and the Bittorrent seeds are already feeding the release fairly effectively."



Fuel crisis...

  • Apr. 28th, 2008 at 10:27 PM
...or just a price peek?

Here are some of today's headlines from The Guardian, as the crude oil price almost hits $120/barrel:

Cost of fuelling aircraft has soared
Gas flow to Britain slows despite high prices
Opec warns of $200 oil as price hits new high

Ubuntu 8.04 released

  • Apr. 25th, 2008 at 9:38 AM
Ubuntu 8.04 was released yesterday, and Wired has a small writeup. You can download here, or go right to the torrent files.


Back references in Java regexp

  • Apr. 2nd, 2008 at 10:44 AM
The Java API documentation for regular expressions says that:

Back references
\n Whatever the nth capturing group matched

This seems to be difficult to get working though. Here's an example of a work-around:
str.replaceAll("user(.*)", "$1")

Example:
"username" => name

Too many layers, too many features

  • Mar. 30th, 2008 at 6:02 PM
It's already old news that the opening of the 5th terminal at Heathrow airport was a disaster. However, was it such a big surprise. I mean, what could possibly go wrong:

"40 years in the planning. It was a 4.3bn [GBP] project boasting an IT system that could make Nasa envious"

"11 miles of conveyor belts controlled by an integrated network of 140 computer servers able to process 12,000 bags an hour"

"built on the back of 400,000 man-hours of software engineering"

"'We believe it to be the most advanced baggage system in the world.'"



View PDF graphic of the new baggage system.


It seems, just about everything that could go wrong did. A classic example of a system set up for cascading failure.


- Staff turning up for work could not park their cars.
- Then they struggled to find transfers into the terminal.
- Shortage of security staff meant baggage personnel had to wait in increasingly long queues to be vetted.
- People were having difficulty finding out where they were supposed to go [to work].

- Failure to get personnel into place on time in the cargo areas became manifest.
- Baggage backed up on the conveyor-belt system.

- Along with angry passengers, staff were becoming increasingly demoralised.
- 'There are 16 lifts and only one is working...'
- Drinking water was shipped in for the overstretched baggage teams, but the security staff refused to allow the bottles in.

- 68 flights had been grounded.
- [Passengers forced to] fly without their luggage as 5,000 bags lay stacked up on the underground conveyor belt system.
- BA had promised delays would be reduced to only 30 to 40 minutes.


In the glory of hindsight, I cannot resist the temptation to quote Antoine de Saint-Exupery:
"Perfection is achieved, not when there is nothing left to add, but when there is nothing left to remove."

Cost of a CD

  • Mar. 26th, 2008 at 8:56 AM

This breakdown of the cost of a typical major-label release by the independent market-research firm Almighty Institute of Music Retail shows where the money goes for a new album with a list price of $15.99.

$0.17 Musicians' unions
$0.80 Packaging/manufacturing
$0.82 Publishing royalties
$0.80 Retail profit
$0.90 Distribution
$1.60 Artists' royalties
$1.70 Label profit
$2.40 Marketing/promotion
$2.91 Label overhead
$3.89 Retail overhead


Taken from Wal-Mart Wants $10 CDs.

See also Slashdot:
http://news.slashdot.org/news/08/03/25/1856245.shtml

Tux droid

  • Mar. 16th, 2008 at 8:57 AM
"An electronics company called Kysoh aims to bring the Linux mascot to life with a unique programmable toy. The Kysoh Tux Droid is a robot that wirelessly connects to a Linux computer (no Windows or Mac OS X support yet) and performs actions in response to preprogrammed events. It can flap its wings, turn around in circles, blink, detect light levels, record audio, and even speak."



http://www.tuxisalive.com/

http://arstechnica.com/reviews/hardware/tux-droid-review.ars

http://hardware.slashdot.org/hardware/08/03/15/2244250.shtml

http://www.youtube.com/watch?v=cbzyBEeShEk
After the last yum update I had problems starting up Pidgin today. Every time I got the message in the terminal: "The name org.freedesktop.NetworkManager was not provided by any .service files", and a segfault: "Pidgin has segfaulted and attempted to dump a core file.".

Then I tried the suggested gdb pidgin, however I did not have enough of the *-debuginfo packages installed to get any meaningful output. So, I tried to install that, however, at some point it seem yum was ready to give me the whole of FC9 beta, so I stopped there.

What did work in the end, was the following:
yum --enablerepo='*-debuginfo' --enablerepo=development install nss-debuginfo

After that, Pidgin started up normally again! Great! :D

I guess I should include some version details for the records. This is what I now have:

[root@localhost ~]# yum list pidgin* nss*
Installed Packages
nss.i386 3.11.99.4-1.fc9 installed
nss-debuginfo.i386 3.11.99.4-1.fc9 installed
nss-devel.i386 3.11.99.4-1.fc9 installed
nss-tools.i386 3.11.99.4-1.fc9 installed
nss_compat_ossl.i386 0.9.2-3.fc8 installed
nss_db.i386 2.2-38 installed
nss_ldap.i386 257-4.fc8 installed
pidgin.i386 2.4.0-1.fc8 installed
pidgin-debuginfo.i386 2.2.2-1.fc8 installed
pidgin-otr.i386 3.1.0-2.fc8 installed

[root@localhost ~]# cat /proc/version
Linux version 2.6.24.3-12.fc8 (mockbuild@xenbuilder2.fedora.redhat.com) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #1 SMP Tue Feb 26 14:58:29 EST 2008

BPM beat counter

  • Mar. 8th, 2008 at 11:51 AM
Simple is beautiful! Who needs fragile BPM software when you can do the counting yourself!? Here's two online BPM (beats per minute) counters where you hit a key for each beat. The form will give you the average BPM.

For the mouse:
http://www.b-boys.com/classic/beatcounter.html

For the space bar:
http://web.forret.com/tools/bpm_count.asp
This also comes with a "tempo calculator" if you hit Submit.