December 21, 2011

[Mac] Delete backups from Time Macine

I got disk full message from Time Machine with 2TB external HDD.  I found this helpful video showing how to remove (old) backups from Time Machine disk.


December 19, 2011

Book: Programming Erlang: Software for a Concurrent World



I actually read this book a few years ago -- I was searching for a better way for concurrent programming and found Erlang.  Coincidently, Erlang was starting to get some attention little after.  I believe this was the only Erlang book  at that time.  The book clearly shows and explains how to program in Erlang.  Reading this book was like a wake-up call for me, whose background is mostly OOP and procedural languages.

Book: Clojure in Action


There are many books on Clojure, and after reading/skimming through most of them, I found this book is the best one to start with.  I enjoyed reading this book very much, and I strongly recommend to anyone who wants to know Clojure.  After this book, you might want to read Joy of Clojure, which delves into Clojure deeper.

December 2, 2011

Common Lisp, Web framework, VPS, OSX issues

Goal: 
Develop web apps using common lisp with a web framework in Linux environment.

Environment:

Dev: OSX 10.6 Snow leopard.  

Target: Ubuntu 10.10 on OpenVZ, tiny config, hosted in VPS.


Issues:

 Two widely used common lisp web frameworks and require multi threading: 

  1. weblocks
  2. hunchentoot

(Use quicklisp to install them.) 


1. Dev env:

OSX's CLISP binary doesn't support multithreading.

Tried SBCL, and macport binary does support multithreading.

 
2. Target env:

Ubuntu's CLISP package supports multithreading.  

SBCL install via apt-get failed. There's a problem with memory (don't remember the specific message).  It was due to SBCL's memory requirement, needing 8GB of memory for its GC, but the server only has 512MB with no swap, since openVZ does not give swap.

On dev env - use SBCL, on target, use CLISP.

Some suggested that LISPBOX has Clozure Common LISP and the binary supports multithreading on OSX, therefore use that (lispbox's clozure).  However, on this VPS' Ubuntu, installing LISPBOX seems unnecessarily difficult, due to the LISPBOX binary's age and wouldn't install on VPS' headless Ubuntu 11.04.


Conclusion 

There is an issue with CLISP on OSX , SBCL on OpenVZ based VPS.

 

Apache, Glassfish and JAX-WS

Install

Environment: Apache, Glassfish 3.1.1 (or here) on Ubuntu server 11.04, behind FW with VIP.  Here is the good tutorial on installing Glasfish on Ubuntu.


Start/Stop commands for Glassfish:

glassfish/bin/asadmin stop-domain domain1
glassfish/bin/asadmin start-domain domain1


- For virtual hosting, this page might be a good help.
- For SSL, see this page.

Apache + Glassfish

Usual Reverse Proxy configuration will work fine:

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/


JAX-WS (Web Service) "soap:address location" Issue

My apache server is behind a firewall, and has a VIP, then using apache reverse proxy to Glassfish.  May be this set up is the cause of my problem, but I was getting the IP in ProxyPass/ProxyPassReverse in the JAX-WS's WSDL page for soap-address:location:
<soap:address location="http://127.0.0.1/myapp/mywebservice"/>

This is a problem for client to generate WS client codes using the WSDL.  I spent good amount of time Googling for the solution and found a few things:
1. it's been reported as a bug and is supposed to be fixed before 3.1.1.  May be my problem is caused by my environment: FW and VIP.
2. someone actually wrote servlet filtering to intercept the output, and regex the host name to change it to a correct one.
3. another solution was to grab the generated WSDL, save it locally, hand edit it, then upload.

#2 and #3 are all hacks and I applaud for the developers effort, but I did not like those solution because I am too lazy to do any workaround coding for some environmental issue, and do hand edit things each time WSDL is updated.  So did more digging and reading, found a simpler solution.  In the Apache config for the reverse proxy, just add one more line and it would look like this:

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/



I hope this little finding saves other developers' time.

Rooting Nook Tablet

http://reviewhorizon.com/2011/11/how-to-root-jailbreak-enable-side-load-apk-on-nook-tablet-install-android-market-amazon-app-store/

It'd be nice if I can do some programming on the device directly (and compile too).

Nook SDK: https://nookdeveloper.barnesandnoble.com/tools-services/nook-tablet-sdk.html

Nook Color vs. Nook Tablet vs. Kindle Fire: http://www.barnesandnoble.com/u/compare-nook-tablet-vs-kindle-fire/379003173/

So far, Nook Tablet looks like it is the best low-end/cost tablet.

Amazon's Kindle source code

They're available for download at:
http://www.amazon.com/gp/help/customer/display.html?nodeId=200203720

...source codes for Kindle 2nd gen, 3rd gen, 3G, DX, 6" wifi, Touch, and the latest Kindle Fire.