Friday, August 22, 2008

Lightning only

It's pretty boring to watch lightning flash briefly, so I edited out all the boring bits and made a video of just lightning flashes in an isolated storm hovering over the mountains to the north of our house.


For the geeky:

Take a movie with cheap camera.

Split frames into individual jpegs using mplayer

mplayer -nosound -vo jpeg MVI_8542.AVI

Scroll through images and copy illuminated frames into a separate directory.

Make a backup of all the selected images, because you're a doofus and erased them the first time around:

tar zcvf lightning1.tgz *.jpg
mv lightning1.tgz ..

Rename the frames to a sequential sequence using a bash shell script called ren.sh, and make sure it is executable with chmod +x ren.sh > ren2.sh

#!/bin/bash
for i in 00*.jpg;
do
j=`printf "r%0.5d.jpg\n" $x`
echo mv $i $j
x=$((x+1))
done

This generates commands in the ren2.sh file like:

mv 00000422.jpg r00015.jpg
mv 00000423.jpg r00016.jpg
mv 00000804.jpg r00017.jpg
mv 00000805.jpg r00018.jpg

Now actually redo the naming by sh ren2.sh

Generate movie with mencoder.

mencoder "mf://r00*.jpg" -mf fps=25 -o lightning.avi -ovc lavc
mplayer lightning.avi -loop 0

Tuesday, August 5, 2008

Mounting a disk formatted in FC6 on FC9

This is annoying enough that I have to geek out for a minute and write these instructions down.

I had Fedora Core 6 installed on a hard drive, which I used happily for a couple of years. I then bought a new hard drive, and installed Fedora Core 9 on it. I connected the original drive on as a slave drive so that I could pull over some custom configuration files over. The old hard disk was assigned /dev/hdc, so I tried:


root# mount -t auto /dev/sdc2 /asdf
mount: unknown filesystem type 'lvm2pv'


Well, crap! What is lvm2pv? I'm sure I formatted it as an ext3 filesystem, which is the default for most Linux distributions..... hmm.

A bit of Google searching turned up the answer, but it wasn't obvious how to do it in my case.


root# fdisk -l


Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00027ac4

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 60801 488183220 8e Linux LVM

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 36481 293033601 83 Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00051754

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 13 104391 83 Linux
/dev/sdc2 14 60801 488279610 8e Linux LVM

Disk /dev/dm-0: 497.7 GB, 497779998720 bytes
255 heads, 63 sectors/track, 60518 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800




...but, but, but, there's the hard disk, recognised right there! Hold it, what's a Linux LVM?


# pvdisplay /dev/sdc2
--- Physical volume ---
PV Name /dev/sdc2
VG Name VolGroup00
PV Size 465.66 GB / not usable 3.56 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 14901
Free PE 1
Allocated PE 14900
PV UUID 88qBvg-DSwX-hCr2-X0uU-O1Cq-rlR5-q7fJr9


Oh man, this is a harder problem than I thought.

It seems that both sda1 (my boot disk) and sdc2 (my old disk) have metadata that claim them to bve VolGroup00. Apparently you have to use a Live CD, reboot into that, and rename using LVM tools the second drive to VolGroup01. This should not be so hard, but "it's the wave of the future", damnit.