Saturday, January 30, 2010

Getting Started with a Solaris 10 Appliance Image for VirtualBox

You can download a Solaris 10 (October 2009) Appliance Image for VirtualBox (works on VirtualBox versions 3.0 and above) here: http://www.sun.com/software/solaris/get.jsp#virtualbox which is a ~1.4GB download. I'm using VirtualBox 3.0.6 on Mac OSX 10.5.8.

Now you need to extract the downloaded zip to reveal two files:
Solaris_10_u8.ovf
and
Solaris_10_u8.vmdk

Launch VirtualBox and from the File Menu -> Import Appliance...
Specify the path to Solaris_10_u8.ovf and accept the defaults or you could customize them to suit your preferences.

After the import process is complete, the Solaris installer will ask for additional system information: hostname, networking, root password, etc. You should provide a root password when asked.

Once the installation is complete, you'll be presented with a login screen but you need to create a new user account that you'll use on a regular basis.

Create a New User Account
(1) Login as "root" with the password you specified during setup
(2) Open a Terminal (Launch -> Applications -> Utilities -> Terminal)
(3) Type:
useradd -c "Full Name" -m -d "/export/home/username" -s /bin/bash username
Command explanation:
"-c" simply creates a new user with the name: 'Full Name';
"-m" copies the default profile information from /etc/skel;
"-d" creates the home directory in '/export/home/username' and;
"-s" specifies the shell '/bin/bash'
The final part 'username' is the login name.
(4) Type: passwd username to set the account password otherwise the account will remain locked
(5) Logout as root
(6) Login using the new user account and password
(7) You can choose either of Sun Java Desktop or CDE as you window environment.

Installing VirtualBox Additions
From the VirtualBox File menu, choose Install Guess Additions... to mount the VirtualBox additions .iso as a disk drive on Solaris and will appear with an icon on your desktop.
From a Terminal, change to the disk drive can copy two files:
cp autorun.sh ~/autorun.sh
cp VBoxSolarisAdditions.pkg ~/VBoxSolarisAdditions.pkg

This step of copying the two files above is necessary because for some reason, I couldn't get the autorun.sh shell script to work out of the box as it gave an error "id: illegal option -- u"
To fix the error:
(1) Make autorun.sh writeable:
chmod +w ~/autorun.sh
(2) Edit the file using a 'sane' text editor (I had issues using Sun's version of the vi editor):
gedit ~/autorun.sh
(3) Look for the line `$pfexecbin id -u` and change to `$pfexecbin /usr/xpg4/bin/id -u` since the version of id the script attempts to use is /usr/bin/id which doesn't support the -u option.

(4) Save and close the file.

(5) Run the script:
~/autorun.sh

Alternatively, you could ignore the error and simply just type from the directory containing VBoxSolarisAdditions.pkg:
pkgadd -d ./VBoxSolarisAdditions.pkg
[This tip is from the blog post Solaris Guest Additions in VirtualBox on Mac OS X by Susan Morgan].

After installation, you need to log out and back in for the changes applied to be re-read by your desktop environment.

I hope this helps someone.

Update:
Even after I specified a valid hostname in the initial setup screen when running the Appliance Image for the first time, I still continued to have my Solaris hostname as "unknown". After some googling the fix is quite simple: create a file called /etc/nodename and in it put your desired host name there then reboot.
So on the Terminal you could simply type these four commands (as root) to set "solaris-vm" as your hostname:
(1) # cat > /etc/nodename
(2) solaris-vm
(3) <Ctrl> + D (end-of-file character)
(4) # reboot (to confirm your changes)

Wednesday, January 27, 2010

Today in History...

Today in History: January 27, 2002, Bombs went off in their storage area at the Ikeja Army Barracks causing pandemonium across Lagos with the resulting stampede killing hundreds of people at an Oke Ofa, Isolo water canal.

Tuesday, January 19, 2010

Today in History...

Today in History: January 19, 2005, Wednesday (a day before Iléya), a group of mischievous akokites (students) rendered the then D.S.A., Prof. 'Dele Olowokudejo homeless and almost succeeded in burning down the Vice Chancellor's residence due to the controversial death of Olaolu Akosile, Speaker of the UNILAG Students Union Government.

Iléya or Eid-ul adha is the bigger of the two well known muslim festivals.

Sunday, January 17, 2010

It's not Google that's leaving China, it's China that's leaving the world

There's something really dear to Google at stake that it just isn't worth risking, given the unfavorable status quo, with their continued presence in China. Even after reading the lengthy blog post by Drummond in Google vs China I kept on wondering: why give up on such an important market like China? Many of the news outlets I frequent didn't quite give me the "aha" moment I sought.

Since we are in the participation age as Jonathan Schwartz likes to call it, I turned to comments for answers and managed to pick up some interesting bits as to why Google is making such a "bold" move.

I feel like everyone is talking around, but not addressing the likelihood that google.cn employees were involved with the govt/hacking. Google had to send their employees home to audit and secure their internal network and systems because that is by far the most vulnerable. --Mr.Recycle

2) google.cn is a like trojan horse into google’s secuity and IP. Technology is probably being smuggled over to baidu. If google shuts off that tap, they could potentially reenter the market later with a more evolved search engine and dominate. --Rdl

At least one thing is clear, a sudden realization of doing evil and then standing up to defend free speech is certainly not the real reason to quit censorship of search results after doing it for about four years in China.

Friday, January 1, 2010

Error #2007: Parameter blendMode must be non-null

So you got this error while developing a Flex 3 app.

And you have already consulted this post: http://www.newviewnetworks.com/nvnhome/blog/client/?p=168 who in turn had consulted this post for guidance.

Hmm, even the post by The Agile Tdog refers to another post by Agile UI and this still points to a use case where there is a mismatch between the Flex 3 SDK version you are developing (your project) on and an/some external Flex lib which may have been compiled with a newer or older Flex 3 SDK version.

But that is not my case -- I get this error purely due to my (mis-)use of components in the Flex framework.

Short answer: simply set the blendMode attribute to a valid value on the component that caused the error a la:
blendMode="{BlendMode.NORMAL}"

Synopsis
I was trying to implement reordering of the elements of a control via drag and drop within the same control.

Basically, this is what I did:
<mx:List
 dragEnabled="true"
 dropEnabled="true"
 dragMoveEnabled="true" 
 width="100%"
/>

and then I got the blendMode must not be non-null error.

So my fix was to set the blendMode attribute, which by the way, is inherited from flash.display.DisplayObject.

<mx:List
 dragEnabled="true"
 dropEnabled="true"
 dragMoveEnabled="true" 
        blendMode="{BlendMode.NORMAL}"
 width="100%"
/>

Possible values are listed in the docs here: http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObject.html#blendMode

[I'm developing using Flex Builder 3 for the Mac which shipped with the Flex 3.2 SDK.]