18 December, 2010

The best CLI tools all the time

Every December, each geeky website will prepare "Best Windows/Mac Software of 20xx". Why there is not a "Best CLI Tools All the Time" article?
Why not "Best CLI Tools of 20xx"? Sorry, there would not be too useful to have such a list every year. As good CLI goods all survive throughout years. Ever since I know the use of ssh, it keeps to top on my list. What software allow you to forward whatever port you like and execute commands on different hosts?
While "Best CLI Tools All the TIme" comes to be head, I googled an interesting site: http://www.commandlinefu.com/

11 December, 2010

Does Dynamic Programming Languages more Productive for Web Development?

While Dynamic Programming Languages like Python and Groovy are hot topics in recent years. Surprisingly, there is not a clear definition for "Dynamic Programming Language". So, what "Dynamic Programming Language" refers to and does it really helps to spped your next web application?

StAX - Streaming API for XML

StAX, is a Java processing XML API which allow software to processing XML stream in a push streaming style. In certain scenario, StAX will be the most efficient approach for prcoessing XML stream. This article aims to provide an overview on this API as well as comparison with two other commonly used APIs: DOM and SAX.

07 December, 2010

YAML - YAML Ain't Markup Language

YAML, which stands for "YAML Ain't Markup Languge", is a data serialization format, which can be used to represent data or message.
This article provide a background on YAML as well as a comparison between YAML and XML using the Maven POM as a example.

05 December, 2010

Using SyntaxHighlighter at Blogspot

Blogspot doesn't support syntax highlight by default. What a shame, considering that all decent Wiki engine are providing certain level of support for this already. While Blogspot isn't a wiki, but without syntax highlighting, I just keep have a feel that, Blogspot is not a place for technical post. Anyway, SyntaxHighlighter is a solution for this.
The official installation instruction require you to upload the script and link the scripts from your blogspot template. Castillo has post a workaround on how to use this lovely tools on Blogspot without having a hosting space. The post seems out-dated. It isn't too hard to figure out the way, below are the up-to-date procedure.
1. Update the Blogspot template and add following in the <head>
  <script language='javascript'   
    src='http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/XRegExp.js'/>
  <script language='javascript' 
    src='http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shCore.js'/>
  <script language='javascript' 
    src='http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shAutoloader.js'/>

  <link rel='stylesheet' type='text/css'
    href='http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/styles/shCoreDefault.css' />

2. Apply the following snipplets near the end of <body>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.autoloader(
  'xml  http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shBrushXml.js',
  'css  http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shBrushCss.js'
);
SyntaxHighlighter.all();
</script>
3. In the post, use <pre> with the class attribute to define the corresponding syntax
<pre class="brush: xml>
  <echo>Hi SyntaxHighlighter!</echo>
</pre>
SyntaxHighlighter support different kind of syntax, all you need to do is just to define it in the "autoloader" call. The full list of supported syntax can be found here. SyntaxHighlighter also provided a few different theme which can be configure by importing different javascript, the full list can be found in here.

25 September, 2010

SLAX - Beautiful Live CD and Live USB

SLAX is simple Live CD / Live USB distribution. It allows easily to web interface for creating tailored made build.

In additions to the modules available on the official website, it is extremely easy to create modules. To illustrate how easy it is, the following is a steps by steps:

 1. Download a vanilla SLAX ISO
 2. Boot-up the image with a spare machine or Virtual Machine
 3. After image boots up, login as root
 4. Create a directory
    $ mkdir /tmp/rootcopy
 5. Put some files under this directory
 6. Create the module file
    $ cd /tmp
    $ dir2lsm rootcopy mymodule.lzm
 7. Put this module file under /slax/modules

Fixing the Cygwin ACL Problem

Cygwin is always one of the best tools for me. It provide an emulated *nix like environment include a shell environment, POSIX path, etc. Of all the emulation provided, however, the POSIX-like permission is the only thing I am not appreciated.

The purpose of permission and ACL is for controlling access of files under a multi-user environment. Whilst it will be useful for running network services, it is pointless for most development use cases. Files are mostly accessed by only one user, that is me!

When Cygwin is emulating POSIX permission using Windows ACL, it can easily caused undesirable trouble when one is trying to access the files from both Cygwin environment and ordinary Windows based tools. To get rid of this, Cygwin provided means for disabling this. Unfortunately, the mechanism is different between 1.5.x and 1.7x. And this can even more frustrating when you are trying to upgrade from 1.5.x to 1.7.x.

All the details below can be found on Cygwin manual. But it may take sometimes to dig it out even with the help of google. So, here we go!

For version prior to 1.7, the method is setting the following environment variable:

    CYGWIN=nontsec

Since 1.7, the method is setting 'noacl' as part of the mount point options in fstab. You should have a line like this:

    none /cygdrive cygdrive noacl,binary,posix=0,user 0 0

Note that, no extra entries should present for all mount point which can be mount up automatically.

For upgrading from 1.5 to 1.7, you should also clean up the mount point defined in the registry. From Cygwin 1.7, registry is only used for defining the installation directory of Cygwin itself.
When in doubt, use cygcheck to have a look, which can shows the mount point configuration inherited from registry.

02 May, 2010

Huawei B970b (Smartone Vodafone Wifi Router)

Before I subscribe the Smartone Vodafone Home Broadband service, I've serviously try to seek some official answer the following questions:
1. Will the router get a public IP address?
2. Does the bundled WIFI router allow me to configure port forwarding?

And the official answer is NO!

But the fact is, YES! The router is Huawei B970b, as there is not much information on the Net at this moment, I'd share information gathered so far. Before is a summary followed with command line output capture (Yes, I can get the shell  access on the router easily)!

02 April, 2010

HTML5 port of Quake II

I can imagine the this kind of things will be implemented in near future, but it is just appear sooner than I expect. I rarely play game these days, but this demo is appealing to me!

20 March, 2010

Broken Java Preference in OS X Leopard

I use PPS frequently but it is broken since the last upgrade. The Login Page is a Java Applet and the problem SHOULD be solved by changing setting in Java Preference.

According to the PPS instruction, enable SSLv3 and TLSv1 in Java Preference can solve it. If you try to enable these in Java Preference, the applet is still not work. The problem is due a bug in Java Preference, when you enable TLSv1, the corresponding property is not actually saved.

To workaround this problem:
    cd ~/Library/Caches/Java/
    echo deployment.security.TLSv1=true >> deployment.properties

This step should be redo again every time setting is changed from Java Preference.

This information is found in a forum post: 
    http://discussions.apple.com/message.jspa?messageID=10859921

By the way, why Apple not fixed?

03 January, 2010

Restore application from the Dock

In OS X, you can minimize a application with 'Cmd-M'.

To restore it there is no hot key to do so, but one tricks is to use spotlight. Just type the application name in spotlight and the application will be restored.