Thursday, February 03, 2005

Upgrading from LILO to grub...

After all these years of staying away from grub (for various reasons ... mainly because the one time I'd been confronted with it there was a box which wouldn't boot in a computer room, there wasn't time to research, I didn't know anything about it, I didn't like the name, and I didn't know where to start...) I tried upgrading a box after installing a new Sarge box which installs grub by default so I hade something to compare with as a working example...

Installing it was as simple as doing:

As simple as running:


grub-install /dev/hda


(mine was: grub-install --no-floppy /dev/hda )

(You can also use (hd0) instead of /dev/hda I believe.)

Then making /boot/grub/menu.lst

I have:

default 0

timeout 3

color cyan/blue white/blue

title Debian GNU/Linux, kernel 2.4.27-2-686
root (hd0,0)
kernel /boot/vmlinuz-2.4.27-2-686 root=/dev/hda1 ro
initrd /boot/initrd.img-2.4.27-2-686

savedefault
boot

title Debian GNU/Linux, kernel 2.4.27-2-686 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.4.27-2-686 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.4.27-2-686
savedefault
boot

You can do this automatically on Debian with:


update-grub

Wednesday, December 29, 2004

Burning an ISO image under Linux

On my laptop with an internal CDROM:


cdrecord -v -pad -tao -eject speed=8 dev=/dev/hdc sarge-i386-netinst.iso


BTW:
The image came from here: http://www.debian.org/devel/debian-installer/

Or even just:


cdrecord dev=/dev/cdrom sarge-i386-netinst.iso


And this time I went for:

http://cdimage.debian.org/pub/cdimage-testing/daily/i386/

which fixed some problems I was having with the 2.6 kernel not wanting to mount the root image on my old 233MHz machine... (turning off things in the BIOS and managing to boot Knoppix under 2.6 let me know it was possible)

Thursday, December 23, 2004

Sea Pearl

It's funny how I know quite a lot about the history of the C Language, but don't write very much C, and know comparatively little about the history of Perl and write a LOT in it...!!!

I would love to be able to rattle off C programs the way I churn things out in Perl, but somehow I don't think that C really lends itself to that kind of development.

There certainly are times I wish I could write something in C to get better performance out of it, but when I try I often get muddled with where I am at and am not sure if I'm going about things the right way.

One day Conrad, I'll do the C course that you recommended I do (*cower* 10 years ago now!!!) which I still haven't done! :o(

I sometimes wonder if Casey is still using C as much as he did back then, and if so, what kinds of things he's using it for...

Thursday, December 16, 2004

Xsession error: open: Permission denied


Xsession: X session started for USER at Day Mon DD HH:MM:SS Zone YYYY
open: Permission denied


try:


chmod 1777 /tmp



Thursday, September 16, 2004

Vim bits...

Today I learned that if I want to run the current line as a command and get
the output, all I have to do is:

<Esc>yy!!<Ctrl-R>"<BS><Enter>

:-) happy now!?

Careful if you've got a % in the line...

Vim documentation: cmdline

I needed \% for the %20 in the URL I was passing out.

The <BackSpace> was because it put a ^M on the end of the line.
I could have just gone 0y$ instead of yy

I just KNOW I'm going to use this one a lot!!!

So you know, the secret engrdient here is ^R which puts the content of the
un-named register on the command line.

the other (unrelated) thing that I looked up and clarified was the :a (short for *:append*) command (and discovered that there's also :i (short for *:insert*) which can be read about with :he :a and :he :i :o) I discovered :a quite by accident a long time ago and use it when I want to paste in text and don't want it to be auto-indented (if it has tabs or indents in it - e.g. when pasting code)

Tuesday, September 07, 2004

Island sizes...

Isle of Man is 53km (33 miles) long, 20km (13 miles) wide, land area 572 sq km (227 sq miles)

Great Barrier Island is 40km (25 miles) long, 16km (10 miles) wide, land area 285 sq kilometres (110 sq miles)

Chatham Island 61 km (38 miles) long, 40 km (25 miles) wide, 963 square km (372 sq miles)

Stewart Island is 70 km long (45 miles) long, 40 km (25 miles) wide, land area 1,746 square km (674 sq miles)

Jersey is 16km (10 miles) across, 8 km (5 miles) from north to south and has an area of 115 square km (44 sq miles)

(Don't quote me on the Chathams length and width - they're from the 1911 encyclopedia which is full of inaccuracies.)

Sunday, September 05, 2004

USB Mouse with 2.6 Kernel

To get my USB mouse working with the 2.6 kernel (in Debian Sarge with 2.6.7)
I had to add these modules to /etc/modules:

usbhid
uhci_hcd
mousedev

I didn't need usbcore because it loaded itself.

I found that these also work for the 2.4.27 kernel, and I don't need the usbmouse module.