Monday, March 9, 2009

Linux fc tips

fc is a command in Linux which I can't seem to remember no matter how many distros I hopped onto.

So I post this as a reminder, as well as for the benefit of anyone who despise reading man pages :)

To list your executed command history:

fc -l


The above will lists the commands with line numbers on the left like so:

492 unrar x some.part1.rar
493 sync;exit
494 python editor_test.py
495 cd Documents/python_editor/
496 vi test.py
497 python test.py


To execute command history number 495 above:

fc -s 495


To edit it before executing however, use the one below.
After you exit the editor, the command will be executed:

fc 495


If you would like to execute the last command with the word 'mailer' in it:

!?mailer?

Sunday, December 21, 2008

Ensuring UTF-8 encoded files compile in Staticmatic

Pages with Russian characters are stored (AFAIK) encoded using UTF-8. Unfortunately, this encoding is not compilable by Staticmatic.

A simple workaround is to insert a blank line at the start of the page like so:



Problem solved :)

Tuesday, December 2, 2008

JBoss web service blocked

If you have a web service in JBoss of which you can access the WSDL but keep getting "connection refused" error when accessing the service, then the culprit is normally this:


C:\jboss-4.2.2.GA\bin\run.bat -b 0.0.0.0


or


C:\jboss-4.2.2.GA\bin\run.bat


A solution - at least what worked for me - was to use the actual IP of the machine like so:


C:\jboss-4.2.2.GA\bin\run.bat -b 192.168.1.11


Its funny how modifying JBoss startup scripts did not affect the "-b" option above. However specifying it on the command line works fine.