Category Archives: Reference

Linux Software RAID Quick Reference

Create A RAID-1 Array
mdadm --create /dev/md0 --level=1 /dev/sda /dev/sdb

Scan For Disks
mdadm --detail --scan

Add Disks To mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Check Status
cat /proc/mdstat

Mark Disk as Failed
mdadm --manage /dev/md0 --remove /dev/sda

Remove Failed Drive
mdadm --manage /dev/md0 --fail /dev/sda

Add Disk To Array
mdadm --manage /dev/md0 --add /dev/sda

Mount partitions in Linux using GUID

If you’ve ever managed a linux machine, you’ve likely manually editied the /etc/fstab file to automatically mount filesystems.  If you manually specify it’s location (/dev/sdb1) you may know that adding other devices can change location, meaning you will need to change your fstab.

If you’ve looked at modern Linux distributions, you may notice that the fstab file does not contain any /dev devices, but instead uses the partition’s GUID.  From what little reading I’ve done, I’ve found this is a feature of ext2 and up filesystems.  A /etc/fstab in a recent version of Ubuntu will show you that you need to run blkid to print the UUID for a device, and then use GUI= as a prefix in place of the device location.  Run blkid as SU (sudo blkid) and you will see something like this: 

[email protected]:~$ sudo blkid
/dev/sda1: UUID=”818bded8-51fc-4c02-be9e-abb99517c905″ TYPE=”ext4″
/dev/sda5: UUID=”283cf494-e3be-441d-b098-034869407e6e” TYPE=”swap”
/dev/sdb1: LABEL=”cr48_home” UUID=”cab2cac5-fb0d-4afb-9561-66f97c939412″ TYPE=”ext4″
In this case, I want to use the /dev/sdb1 device as my home directory, so in my /etc/fstab file I’ve added the following.
UUID=cab2cac5-fb0d-4afb-9561-66f97c939412 /home         ext4          0 errors=remount-ro      1
Now the partition will automatically be mounted to /home reguardless to it’s device location.  
If you’re using an old Linux install that’s been updated many times, your fstab file may still be using the device instead of it’s UUID.  It’s a good idea to fix this while you can.  It’s not uncommon to reboot with a new disk installed and it changing the address of all of your exising devices.

ProFusion X Digital Media Manager

Yesterday I wandered into an electronics store intending to buy nothing and walked out with an old computer, a “dmx ProFusion X Digital Media Manager”.

From what I can tell this was designed to play music in a store.  On the back it has connectors that convert the standard 3.5mm audio outpus to RCA’s that I’m assuming go to amplifiers.

When I walked to the register with the PC, the clerk was wondering why the machine was on the floor in the first place.  He told me he couldn’t sell it because the hard drive was still installed and still had music on it.  I asked if he could sell it without the hard drive, he agreed, ripped it out, and I was on my way.

It came running a VIA C3 CPU at 800MHz and with a whopping 128MB of DDR333, but it came in a nice case for a project.  It’s face has 7 buttons and an LCD.  It attempts to display a DMX banner as soon as power is applied. By attempts I mean that about half of the display is dead.

Inside, the front panel is powered using a floppy disk style power connector and interfaces using a 10 pin ribbon that occupies two a 2 port USB header on the motherboard.  The USB device presents itself as a standard FTDI serial to USB interface.  After some trial and error, I discovered that it runs at 19.2k baud and the buttons are mapped to send a single digit for each:

  1. Style Up
  2. Style Down
  3. Left: 
  4. Up
  5. *
  6. Down
  7. Right

When I send text to the display at the same baud rate it appears to display on the LCD, but since the display is broken it’s hard to see if the correct text is displayed, and I haven’t found what to send the display to set or reset the cursor position or clear the display.

I replaced the motherboard with and old socket 757 motherboard and a 1.8ghz AMD CPU, and I plan to make this a music jukebox at some point.  It’s burried deep on my todo list for now and if I come up with anything worth sharing I certainly will.

Creating Keyboard Shortcuts for the CR-48’s missing keys on Ubuntu Linux

Running an OS other than Chrome OS on a CR-48 turns it into a perfect portable computer that can do much more than when it was just a browser.  The biggest drawback I’ve found is that the keyboard is customized for the OS it came with:  It’s missing keys, the function keys are labeled only with icons, and there is a Search key where a caps lock key should be.  

Using Ubuntu, you can create shortcuts with “Keyboard Shortcuts” in the System menu under Preferences.  Just click the Add button, give a name and command, apply, click the row for the command you created under the Shortcut column, and key your desired shortcut.

To create keyboard shortcuts that control backlight brightness, you will need to install xbacklight, and for mapping shortcuts to missing keys you need xvkbd and xbindkeys.

sudo apt-get install xbacklight xvkbd xbindkeys

The search key by default is mapped to Super/Mod4, which is usually the Windows key. After running Windows on the CR-48 for a few months I’ve grown familiar to using the search key as the Windows key, so I’ve decided to use it as the modifier key for my shortcuts.  Here’s how I have configured mine.  You can edit these to your liking.

“Brightness Down” maps Mod+F6 to
xbacklight -steps 1 -dec 20

“Brightness Up” maps Mod4+F7 to
xbacklight -steps 1 -inc 20 

“Press Home” maps Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\[Home]”

“Press End” maps Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\[End]”

“Press Page Up” maps Mod4+Up to
/usr/bin/xvkbd -xsendevent -text “\[Prior]”

“Press Page Down” maps Mod4+Down to
/usr/bin/xvkbd -xsendevent -text “\[Next]”

“Press F11” maps Mod+F4 to
/usr/bin/xvkbd -xsendevent -text “\[F11]”

For volume control, instead of creating custom commands, I’ve edited the existing audio keys to be my modifier plus the function keys with the correct icon.  (F8 for mute, F9 for volume down, and F10 for Volume up)

You may find that using the mapped keys with extra modifiers do not work.  For example, I have a habbit of using shift home and shift end for selecting from current cursor position to beginning and end of lines, and ctrl shift home/end for selecting from current cursor position to beginning/end of a page.  For any combination modifiers using shortcut keys you will need to create more shortcuts.

“Shift End” maps Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\S\[End]”

“Shift Home” maps Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\S\[Home]”

“Ctrl Shift End” maps Ctrl+Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\C\S\[End]”

“Ctrl Shift Home” maps Ctrl+Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\C\S\[Home]” 

Thats all I have for now.  I’m still trying to find a way to enable bottom left and right clicking on the touchpad without disabling two finger scrolling, which is possible when using Windows.  If you know how to do this or you have anything else to add please comment.

1997-2003 Grand Prix Climate Control Diagnostics

This is a quick reference for how to use the diagnostic mode built into the dual zone digital climate control system which came installed in some 1997 through 2003 Pontiac Grand Prix Models.

Every time I want to look this up I always have trouble remembering the terms I need to search for to retrieve it, so I have stolen mirrored this from This Forum Post.

To enter diagnostics mode:
Press and hold both the Driver and Passenger knobs in simultaneously until the display changes to read "-00". To change position, turn the Driver knob to the desired number and turn the Passenger knob one click to view the data for that position.
Position Description US Observed on mine Canada
-00 Error codes (List of Trouble Codes Below!)
-01 (servo position) 103-107 43-162
-02 (servo position) 128 120-202
-03 (servo position) 150 162-194
-04 CJ2 Fan Speed Low=15, 29, 44, 58, 71, 86, 110=High, CJ2 Unit will adjust to other increments as needed
-05 (servo position) 93 88-191
-06 (servo position) -152 00-252
-07 (servo position) 00 0, 34-255
-08 (servo position) -155 00-255
-09 (servo position) 00 0, 23-255
-10 ? 04 04
-11 CJ2 Vent Mode 1=Def, 2=Bilevel, 3=Auto, 4=Lower, 5=Def+Lower
-12 Engine Coolant Temp -60 degrees 80=104, 95=131, 100=140 [email protected]°F
-13 Actual Vehicle Speed in MPH
-14 (servo position) 00 21=0
-15 ? 39 44
-16 Radiator low fan turn on temp -106 207
-17 Radiator low fan turn off temp 196 199
-18 ? 50 51
-19 (servo position) 162-169 40-172
-20 Affected by cabin temp sensor 89 50-172
-21 (servo position) 00 ?
-22 Sunload Sensor -117 LIGHT=126, 218=DARK
To return to normal operation, press the MODE button next to the Passenger temperature knob.
This is a list of the Trouble Codes displayed by the CJ2 Unit.
A two digit code indicates a current fault while a three digit code indicates a historic fault.
Trouble Code Description
00 No System Fault
01 or 101 Inside Air Temperature Sensor Short
02 or 102 Inside Air Temperature Sensor Open
03 or 103 Ambient Outside Temperature Sensor Short
04 or 104 Ambient Outside Temperature Sensor Open
05 or 105 LH Electric Actuator Open or Short
06 or 106 RH Electric Actuator Open or Short
07 or 107 UART Serial Data Line Fault
08 or 108 Solar Sensor Open
To clear codes from the CJ2 Unit, press the A/C Mode button.