Ubuntu & VirtualBox & shared folder

It’s been frustrating for sometimes that I thought VirtualBox is broken.

Here’s what you need to do when Shared Folder doesn’t show up in Ubuntu in VirtualBox.

 sudo mkdir /mnt/$sharename
 sudo chmod 777 /mnt/$sharename
 sudo mount -t vboxsf -o uid=1000,gid=1000 $sharename /mnt/$sharename
 ln -s /mnt/$sharename $HOME/Desktop/$sharename

Full article at Ubuntu Help article.

El Capitan Mail.app crash on launch

El Capitan Mail.app crash on launch

Upgrading from 10.10 Yosemite to 10.11 El Capitan is as easy as usual but there is one glitch that haunted me for a few days. Mail.app crashes on launch. Turns out wrong settings with IMAP is the cause.

Unlike Yosemite is more tolerant with “wrong” settings in Mail than El Capitan.

El Capitan Mail Settings Error and Fix
El Capitan Mail Settings Error and Fix

I need to first disable all network. Disable all IMAP accounts.

Go through all my IMAP accounts and enable one account at a time and turn on network.

If Mail crash, there’s something wrong with the settings.

The fix is removing the value in IMAP Path Prefix from some of my non Gmail accounts.

Cordova FileTransfer plugin path

I’ve been working on a Apache Cordova app for sometimes. Before seeing the light of the tunnel, I bump into issue with the file upload function.

After banging my head a number of times, it turns out the Apache Cordova FileTransfer plugin only like cdvfile:// paths rather than file:// file system path. Do NOT do that again or nothing gets submitted.

W3C Validator in Ubuntu 14.04.1

Since Ubuntu 14.04.1 has just been released recently, I want to see if there’s anything improved in installing the w3c markup validator with it. The basic information is covered by Simply Testable here.

But there’s some extra steps you need for the latest changes. So I’m just putting the extra steps along with the original steps to get it going.

To start, fire up the Terminal app.

Most nuts and bolts are installed by default so you only need to take care a few things.

First, you’ll need to manually create the directory

sudo mkdir /etc/apache2/conf.d

because this is where the w3c-markup-validator package wants to install. Otherwise you’ll end up with a bunch of error messages to trace.

You would want to install these 7 extra packages proceeding further.

sudo apt-get install apache2 mercurial subversion python openjdk-6-jdk git libapache2-mod-perl2

Then install the w3c validator package should run smoothly:

sudo apt-get install w3c-markup-validator

git wasn’t mentioned elsewhere because this is a recent change in the HTML5 validator. Thus you will need git to get the latest source.

The perl module is required for the w3c validator actually, and there’s some changes you need to make to the conf file.

You will need to do these before w3c validator works

sudo ln -s /etc/w3c/httpd.conf /etc/apache2/conf-enabled/w3c-markup-validator.conf

Added the mod_perl module part to the cgi-bin conf:

sudo gedit /etc/apache2/conf-available/serve-cgi-bin.conf

It will look like the following:

<IfModule mod_alias.c>
    <IfModule mod_cgi.c>

    <IfModule mod_cgid.c>

    <IfModule mod_perl.c>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Require all granted

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Low and behold, you will need to actually enable CGI-BIN for Apache first. Otherwise you will end up with error when you try to check any url.

sudo a2enmod cgi

Now restart apache with:

sudo service apache2 restart

You should now be able to reach http://localhost/w3c-validator/ and do a basic validation.

To install the HTML5 validator at /usr/share/html5-validator, do the following:

sudo ln -s /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-openjdk
sudo gedit /etc/enviroment

Append the following lines:


and then save the file. For more details, please read setting JAVA_HOME for all users.

To make the JAVA_HOME available to sudo commands, type at command line:

sudo visudo

Then add at the bottom of the file and save.

Defaults env_keep += "JAVA_HOME PATH"

Back to Terminal, do the followings:

sudo mkdir /usr/share/html5-validator && cd /usr/share/html5-validator
sudo hg clone https://bitbucket.org/validator/build build
sudo python build/build.py --legacy all
sudo python build/build.py --legacy all

The HTML5 validator is running now and you can verify by going to http://localhost:8888/

But there’s not good enough for our daily use, right? We want it to start upon startup. Let’s just Ctrl-C to break the HTML5 validator for now. Then we’ll create the startup script at

sudo gedit /etc/init/html5-validator.conf

Put the following into it.

description "Validator.nu HTML5 Validator"
start on runlevel [234]
stop on runlevel [0156]
chdir /usr/share/html5-validator
exec python build/build.py --legacy --control-port=8889 run

With this, the HTML5 validator will start upon reboot, and you can start and stop it with:

sudo service html5-validator start/stop

The last item here is to enable w3c validator to work with private IP and HTML5 validation.

sudo gedit /etc/w3c/validator.conf


Allow Private IPs = no


Allow Private IPs = yes

Uncomment the following line. (Do NOT put the extra HTML at the end of the URL)

HTML5 = http://localhost:8888/html5/

Restart Apache

sudo service apache2 restart

Now we got a fully working w3c validator!

OS X 10.9 certificate issue persists

Just recently I noticed I can’t load GitHub on Safari and turns out it’s the SSL certificate causing the issue. However it doesn’t seem like it’s GitHub’s fault but rather it’s OS X’s new policy (introduced at 10.9.2?) Firefox is just working fine btw.

It’s supposed to be fixed already as I’m using 10.9.4 now.

To get around this, people suggested to delete the DigiCert High Assurance CA-3 and alike. That doesn’t work for me.

Once you load github.com, this very item will be regenerated in Keychain Access.

A temporary solution is to set the SSL to be “Always Trusted” to bypass this annoying issue. But that’ll make your Mac vulnerable to sites pretending to use certificates from this authority. Joy!

This seem to be a nasty OS X bug since I found others are having the exact issue persisting through 10.9.4

A very drastic solution is “Reset My Default Keychain” via Keychain Access’s Preferences > General.

Keychain Access Reset My Default Keychain