Goodbye world!

This blog is no longer maintained (hence being converted to Hugo) and is being kept only for historical reasons.

To those who contributed to this journey I salute you.

January 15, 2017 · Peter

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.

December 9, 2011 · Peter

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.

December 9, 2011 · Peter

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>
        
            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>
December 6, 2010 · Peter

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

October 27, 2010 · Peter