DIY Laptop Optical Drive Bay HDD Caddy

One easy way for boosting your laptop performance is to get a SSD drive. Unfortunately they are still quite small (in terms of capacity) compared to the traditional HDDs. So to get the best of both worlds I needed a way to fit both drives in my laptop. The operation consisted of finding an old DVD ROM and proper cable, getting rid of the dvd’s internals, fixing the cable and hdd onto the metal case.

Sorry for the crappy photos.

How to Encrypt Partition under Ubuntu 11.10

Here is a quick how-to for password protecting and encrypting your partition using cryptsetup under Ubuntu/Kubuntu Oneiric Ocelot. It should work for older versions too but haven’t tested it.

cryptsetup luksFormat /dev/sdaX
 
cryptsetup luksOpen /dev/sdaX cryptname
 
mkfs.ext4 /dev/mapper/cryptname
 
echo 'cryptname /dev/sdaX none luks' >> /etc/crypttab
 
mkdir /media/cryptname
 
echo '/dev/mapper/cryptname /media/cryptname ext4 defaults 0 2' >> /etc/fstab

Obviously you have to be root and have cryptsetup installed.
PS: I’m NOT responsible for any damage or data loss caused by executing the supplied code.

How to Access Flex 3 VideoDisplay CuePoint Parameters

Unfortunately when adding cuePoint event listener to mx:VideoDisplay component in Adobe Flex 3 you only receive name, time and type of the Cue Point. Here is a dirty workaround to access the parameters from the metadata.

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
               minHeight="600"
               minWidth="955"
               xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
        <![CDATA[
            import mx.core.mx_internal;
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;
 
            protected function videoDisplay_metadataReceivedHandler(event:MetadataEvent):void
            {
                videoDisplay.mx_internal::videoPlayer.addEventListener(MetadataEvent.CUE_POINT, videoPlayer_cuePointHandler);
            }
 
            private function videoPlayer_cuePointHandler(event:MetadataEvent):void
            {
                trace(ObjectUtil.toString(event.info.parameters));
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
    </fx:Declarations>
 
    <mx:VideoDisplay id="videoDisplay" source="video.flv" metadataReceived="videoDisplay_metadataReceivedHandler(event)"/>
</s:Application>

LineBreak / NewLine in Flex Text Control from XML String

Unfortunately the standard way (‘\n’)  of inserting new lines in Flex Text Controls (Label, Text etc) doesn’t work when the string comes from XML.

The magical way to do it is by using ‘&#13;‘ so

Lorem&#13;Ipsum becomes

Lorem
Ipsum

Embed Font in Flex4 Actionscript Project

A quick tip for all not seeing their embeded fonts when compiling pure AS project with Flex SDK 4:

[Embed(source="assets/fonts/my-cool-font.otf", fontFamily="CoolFont", fontWeight="normal", mimeType='application/x-font', embedAsCFF='false')]
private var MyCoolFont:Class;

Notice the embedAsCFF=’false’, this is the most important part. Basically when not using Spark Text Components (which are based on Text Layout Framework) you need this option.

In summary Halo Components or pure Actionscript Projects (TextField) need embedAsCFF=’false’ when embeding fonts in Flex4.

VMware Player / Workstation Mouse Grab Input Focus Bug

To fix the recent bug with VMware Player 2.5.3 and Workstation 6.5.3 Build 185404 under Karmic Koala Ubuntu just paste this line in your console before launching vmplayer/vmware:

export VMWARE_USE_SHIPPED_GTK=yes

you may also modify the VMware starting script so you don’t have to export it every time.

Papervision3d – ERROR: lookAt error

If you get this error on each frame then you have probably moved the camera to the same position as the object (camera.z = 0). Change it a bit and the error should be fixed.

Custom Skinnable Slider Component for Adobe Flex 3

First of all let me apologize for not blogging in a while but I’ve been working on couple of interesting projects after which it was time for deserved vacation on the BlackSea’s beaches.

Anyway I needed a better looking horizontal slider for one of the projects and all of my googling got me nothing reasonable (most of the tutorials were for changing the Thumb and leaving the default TrackHighlight) so I had to figure out something. Here is my horizontal slider, it is pretty basic but you can use it as a base for your needs. Corner Radius and Background Gradients are set via CSS, width and height are flexible too. Check the example and get the source code.

To view this page ensure that Adobe Flash Player version 9.0.124 or greater is installed.

Get Adobe Flash Player

MDADM RAID Failed After Upgrade from Ubuntu 8.10 to 9.04

With no surprise the update from Interpid Ibex to Jaunty Jackalope was not as easy as I hoped. After booting the fresh 2.6.28 kernel I was welcomed with “Press enter for maintenance (or type Control-D to continue)” and errors when trying to mount my RAID0. After some investigations found that the devices are now named md_d* and there are some devices in /dev/md/.  Because of this change I had to do the following things to get my raid up and running:

  1. Reassemble the raid (check if it is inactive with less /proc/mdstat) – in my case the command looked like this: mdadm --assemble /dev/md_d1 /dev/sdb2 /dev/sda5
  2. mdadm --detail --scan >> /etc/mdadm/mdadm.conf and comment your previous ARRAY definition in the config file
  3. Modify /etc/fstab if needed

Also if DKMS fails to build the new NVIDIA driver be sure to check that you have installed the headers files (the upgrade process did not install them for me).

Again : I’m NOT responsible for any damage or data loss you might experience. Backup often, backup soon!

Seagate 7200.11 BSY State Data Recovery

One not-so-beautiful morning I woke up just to find out that my Seagate 7200.11 500GB hard drive is not detected from my BIOS. Unfortunately it was a well know problem which have three solutions:

  1. Replace the hard drive with new one from where you got it and lose your data
  2. Send it to Seagate for data recovery and wait a month or more
  3. Fix (or totally screw) it yourself

Of course as some-kind of geek I chose the last option and successfully repaired my drive following the MSFN forums guide. Check the photos for more details of the process.

Summary:

  1. If you have Seagate 7200.11 be sure to  check if it is affected and if is still running flash it with the latest firmware
  2. If you are planning to repair it yourself be sure to know how to solder
  3. You will need quite a few parts and tools. It took me two days to prepare
  4. Most of the cellphone cables have what you need inside. I used a Nokia datacable.

PS: I’m NOT responsible for any damage or data loss you might experience

PS2 (in Bulgarian): Ако ви трябва помощ при възстановяване на данни от 500/750/1000GB хард диск Seagate 7200.11, който не се появява в БИОС-а или е с размер 0, драснете ми едно писъмце и ще се опитам да помогна.