Archive for August, 2011

Lion annoyance #1 – Ability to label desktop

August 18, 2011 Leave a comment

This is by far the biggest disappointment I have towards Lion – I simply can’t find a single solution to bring back the desktop labels. I can work around by assigning different wallpapers to different desktops but it’s still not as convenient as having the desktop numbers shown on the task bar.

Categories: lion, mac osx

Something to watch out while using ‘%’ in crontab

August 12, 2011 1 comment

% is a special character in crontab and it has to be escaped with another ‘%’ a ‘\’. I just found out through a fail-to-run crontab task:

Non-working version:

1 5 * * *       /bin/bash /path/to/ `date +%Y%m%d -d '5 days ago'`

When a crontab fails it will drop an email to user’s mailbox. So here are the relavant lines I found in the mailbox (via command mail):

/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file

With those error messages I googled a bit and changed the crontab to the following
working version:
1 5 * * * /bin/bash /path/to/ `date +%%Y%%m%%d -d ‘5 days ago’`

1 5 * * *       /bin/bash /path/to/ `date +\%Y\%m\%d -d '5 days ago'`
Categories: linux, Tip

Attach targeted window using tmux

August 5, 2011 Leave a comment

In tmux sometimes we might need to attach a session with the specific window selected so that we can start working without additional switching window steps. I just found one of the ways to accomplish this is:

tmux select-window -t sess:win && tmux attach -t sess

Credit goes to [ lines 78 & 79 ]

Categories: Tip, tmux

Fixing Tunnelblick (3.1.7) kernel panic problem in Lion

August 3, 2011 Leave a comment

The currently stable version (3.1.7) of Tunnelblick would cause a kernel panic in Mac Lion while a connection is being made. Workaround is to use a beta version (3.2beta28) which is available at, released 7/31/2011.

[Edit 8/18/2011] Just updated Lion to 10.7.1 last night and version 3.2beta28 seems to be unstable as well. It has caused kernel panic two times in a row. Need to keep looking for a version that works. Did a re-installation of the same version and it works afterwards.

Passing array of checkbox values to php through jQuery (example)

August 2, 2011 7 comments


<!DOCTYPE html> 
        <script type="text/javascript" src=""></script>
        <script type="text/javascript">
                function doit() {
                        var p=[];
                        $('input.cb').each( function() {
                                if($(this).attr('checked')) {
                        } );
                        $.ajax( {
                                data: {list:p},
                                success: function(res) {
        <input type="checkbox" class="cb" rel="1"></input>This is 1<br />
        <input type="checkbox" class="cb" rel="abc"></input>This is abc<br />
        <input type="checkbox" class="cb" rel="999"></input>This is 999<br />
        <a href="javascript:void(0)" onclick="doit()">Click</a>



Test-run screenshot:

Live demo (Using google app engine therefore output is slightly different to the screenshot above. The relevant code that deals with the post request is as follow:

class Chkbox(webapp.RequestHandler):
    def get(self):

    def post(self):
        d=self.request.get_all( 'list[]' )


Categories: html, jQuery, php