Fixing the problem where gparted (parted) won’t see a partition due to a mac partition table

I purchased an external HD that was “mac compatable” but I used it with a linux system and used fdisk to put two partitions on it.

Later on, I wanted to use gparted to easily resize one of the partitions, but it refused to see any partitions at all on the disk.

fdisk could still see them just fine, but reported “Partition type: mac”

It turns out that the problem was that the disk originally came with a mac partition table in addition to (right after) the regular MBR Master Boot Record.

I noticed that the first partition didn’t actually start until 63 sectors into the disk (at the beginning of the 2nd cylinder).

Device Boot Start End Blocks Id System
/dev/sdb1 63 1171893554 585946746 83 Linux

So I used DD to copy the first cylinder to a file:

sudo dd bs=512 count=62 if=/dev/sdb of=firstCyl.bin
62+0 records in
62+0 records out
31744 bytes (32 kB) copied, 0.000715733 s, 44.4 MB/s

Looking at that bin file in an editor, I saw the string “Apple_partition_map” which is a dead givaway of what the problem was.

So, I wrote out all zeros to the first cylinder:

sudo dd bs=512 count=62 if=/dev/zero of=/dev/sdb
62+0 records in
62+0 records out
31744 bytes (32 kB) copied, 0.00165608 s, 19.2 MB/s

And then I copied the first sector (512 bytes) back from the firstCyl.bin file I had made:

summetj@constantine:~$ sudo dd bs=512 count=1 if=firstCyl.bin of=/dev/sdb
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00183878 s, 278 kB/s

And it worked! Now gparted is no longer confused by the apple (mac) partition table that I zeroed out, and sees my partition.

dyndns.org (dyn) ddclient configuration fix

I have been using ddclient to update my dynamic dns records for various servers and laptops for many years now. Around a month ago they all stopped updating the DNS server. I eventually tracked the error down to a line in the configuration file:

server=members.dyndns.org

It’s not like I had made up a random server name…this server had been working successfully for several years. And it is the server recommended by the ddclient automatic configuration script generator on the dyndns.org website even now. [https://account.dyn.com/tools/clientconfig.html] However, at least for me on Ubuntu 10.04 and ddclient 3.8.0 it had stopped working.

I changed it over to:

server=members.dyndns.com

And this fixed the problem.

Opening winmail.dat files in Thunderbird

Outlook will attach items and forwarded email embedded in a “winmail.dat” file. The winmail.dat file is a TNEF file and Mozilla Thunderbird does not process them natively. The LookOut plugin for Thunderbird will allow you to see the attachments embedded within the winmail.dat file and treat them like normal attachments.

Using the Microchip PIC Kit 1 with Linux

Microchip PICKit 1

The PICKit 1 is a combination programmer and development board for midrange PIC micro-controllers. In addition to being able to program FLASH pic devices, it also allows them to run and access 8 (charlieplexed) LED’s, a pushbutton switch, and a potentiometer. It’s a great little board for learning the basic of micrcontroller programing, but unfortunately it is not supported by Microchip’s new MPLAB X software (that is written in Java, and supports Linux/Mac in addition to Windows).

You CAN however use the PICKit 1 under linux. The piclab software is supposed to support it (I have not tested this). I use version 1.6 of the PicKit1 flash usb programmer for unix. Even the newest 1.6 version reports checksum errors after writing the hex file, but it does work correctly.

To make it work as an external program in MPLABX I had to select the “format HEX file for download” option under the Linker so that it would not fill all 2048 flash bytes when the program was smaller than that. I am able to manually run the usb_pickit command after building to flash the code, but it’s kind of annoying, as that program has a problem verifying the checksum and reports an error every time (which is interpreted as a build failure) plus, I have to run mplab X with root permissions to be able to access my USB port.

Ubuntu 10.04 AMD Radeon M6 chipset and Extron Electronics video multiplexer

After working perfectly for 4.5 weeks with the same podium setup, my Thinkpad X31 laptop refused to output VGA video to the Extron Electronics video multiplexer box at school.
It appears that the Extron Electronics box is not sending out proper Extended Display Identification Data (edid) which tells the laptop what resolutions it supports. My xrandr command finds the data for my laptop video display screen, but not for the VGA-0 port:

VGA-0 connected (normal left inverted right x axis y axis)
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       60.0*+   60.0
   800x600        60.3     59.9
   640x480        59.9     59.4

I have no idea why this started today. I don’t remember applying any patches to X-org in the last two days, and the technicians in charge of the podium swear that they didn’t change out anything.

I figured out a fix to make it (mostly) work. Tell xrandr to go ahead and force the VGA-0 port to a specific resolution with the following command:

 xrandr --addmode VGA-0 1024x768

This mostly works, but the sync signal is slightly off, leaving a black bar of 20-30 pixels on the left side of the screen. It is also annoying to have to run that command every time I want to display to the podium.

NetMedia iViewHD 2M POE Camera Review with ZoneMinder

Small silver camera
I have recently purchased a NetMedia iViewHD 2M power over Ethernet (POE) camera (retail price $105) for use with ZoneMinder.

This small camera must be hard-wired into a switch that provides power over Ethernet (which will cost another $80-100, but allows you to power up to 4 POE devices). I bought mine used, and don’t plan on buying more. The one I bought would reset to factory defaults (requiring you to upload a new “website”) every few months, and after a year of use it died completely (won’t respond to DHCP address assignments). At used prices the NetMedia iViewHD 2M could be a good deal for daytime shots, despite my nighttime image quality complaints below, if the one you buy lives longer than mine, but I can’t recommend it.

Continue reading

HOWTO: Full Disk encryption on Ubuntu 10.04

How to set up an entirely encrypted disk using Ubuntu 10.04 (LTS):

    Use the Alternative installer (text based) ISO image so that you have access to the LVM and Encrypted Disk options.
    Assuming you want to keep a windows partition or some other pre-existing partitions intact, you will have to manually partition things instead of using the guided partitioner, so select “manual”.

Continue reading

Backflip wifi tether with Ubuntu Linux

After gaining root access on my Motorola Backflip phone, I was (eventually) able to get wifi tethering working using the Barnacle application (version 0.5.1).

In Barnacle, I have “skip wpa_supplicant” checked, the channel set to six (6), and DHCP set up to use the OpenDNS DNS server (208.67.222.222) although the DNS server option may not be needed. (I had to also manually specify the DNS server IP on my client anyways.)

I had to pull some tricks on the client side (Ubuntu Linux) to make everything work. Specifically, setting MTU size to 1250 and setting up my own DNS name server IP.
The script I use to make this all work with ad-hoc networking on Ubuntu is as follows: Continue reading

How to Root the HTC Aria on At&T

Rooting the HTC Aria on AT&T is made trivial by the program you can download at http://unrevoked.com/

So far the only good reason I have found to root your HTC Aria is so that you can enable wifi tethering, but that requires a few more steps which you can read about in my next post.

In addition to rooting your phone, the unrevoked application adds a custom recovery image to your phone (Clockworkmod recovery – http://www.clockworkmod.com/ )

This open source recovery system allows you to backup your phone to SD-card (nandroid backup), and load other ROM’s.