Use alternatives utility to update JDK

Posted: October 8th, 2011 | Author: | Filed under: java | No Comments »

At the prompt, type

sudo update-alternatives --config java

The current available java installs would be displayed

Selection    Command
———————————————–
*  1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
2           /usr/lib/jvm/jre-1.4.2-gcj/bin/java

To get out of the prompt without make changes, hit Ctrl+C

To add a new jdk, I downloaded the jdk-6u-linux-i586.bin from the Oracle Java site. Unzip it

chmod 755 jdk-6u27-linux-i586.bin
./jdk-6u27-linux-i586.bin

It unzip it to a directory jdk1.6.0_27. I moved it to /usr/lib/jvm,

mv jdk1.6.0_27 /usr/lib/jvm

Then install the jdk1.6.0_27 as a Java alternative. The number 3 is for the priority.

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_27/bin/java 3

Now if you do “update-alternatives –config java” again, you would see jdk1.6.0_27 got added as a new alternative. Type 3 and hit Enter to select.

Selection    Command
———————————————–
+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
2           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
3           /usr/lib/jvm/jdk1.6.0_27/bin/java
Enter to keep the current selection[+], or type selection number: 3

Test by typing “java -version”

[root@VM1 ~ ]# java -version
java version “1.6.0_27″
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

 


Test publishing with Google Docs

Posted: June 13th, 2011 | Author: | Filed under: Uncategorized | No Comments »

I’ve been searching for easy ways to post rich content and so far Google Docs is the easiest way for me. The workflow is to update images to a designated album on Picasa, and insert those the images from the album to Google Docs.

For users that could not access Google Docs, the document can be downloaded as PDF and

If you can’t view Google Doc, view this PDF file test


Control Windows with Windows PowerShell and WASP

Posted: March 17th, 2011 | Author: | Filed under: Uncategorized | 1 Comment »

Step 1: Install PowerShell
PowerShell 2.0 is included in Windows 7. If running any prior version, download and install Windows Management Framework Core from Microsoft support site http://support.microsoft.com/kb/968929

Step 2: Download Windows Automation Snapin for PowerShell at http://wasp.codeplex.com/ And Unzip WASP.zip to a Directory

Step 3: Change PowerShell Execution Policy
Go to Start->”Programs”->”Accessories”->”Windows PowerShell” Or just type “powershell” at the Run prompt.

Get the current execution policy:

 

To be able to run all scripts, including the unsigned ones (take your own risk!), change the PowerShellexecution policy from the default “Restricted” to “Unrestricted”.
To check the current execution policy, type

get-executionpolicy

at the PowerShell prompt.

To change the execution policy to “Unrestricted”, type

set-executionpolicy Unrestricted

Then do get-executionpolicy again to check that the policy has been changed

You may also read more on script signing by typing “get-help about_signing”.

Step 4: Start Windows PowerShell editor by “Start”->”Programs”-> “Accessories” ->”Windows PowerShell ISE”

Type the following text to the “Untitle1.ps1”.

Import-Module C:/install/WASP/wasp.dll

Select-Window | ft -auto

Then test it by clicking the “Run Script” button.

 


Build Linphone for iPhone and iPad

Posted: February 11th, 2011 | Author: | Filed under: iphone | 9 Comments »

To build Linphone for iPhone and iPad

Read the rest of this entry »


Highlight Code Syntax in WordPress Tips

Posted: January 26th, 2011 | Author: | Filed under: web | 2 Comments »

To high-light the syntax in WordPress, install WP-Syntax and wrap code blocks with<pre lang="LANGUAGE" line="1"> and</pre>, where LANGUAGE is

Read the rest of this entry »


Set up Net-SNMP Agent on Windows

Posted: May 19th, 2010 | Author: | Filed under: networking | No Comments »

This article shows you how to turn your Windows box into an SNMP-enabled host, using Net-SNMP. Read the rest of this entry »


Capturing Internal Traffic with Virtual Loopback & Wireshark on XP

Posted: May 18th, 2010 | Author: | Filed under: networking | No Comments »

Create Loopback Interface on Windows XP

  1. Select “Start”->“Settings”->”Control Panel”

C:\dev\wireshark\images\Image-0000.png  C:\dev\wireshark\images\Image-0000.png

Read the rest of this entry »


Create Custom Widgets using InkScape and NetBeans Visual Library

Posted: May 5th, 2010 | Author: | Filed under: java | No Comments »

This blog entry shows one how to create a special widget using InkScape and NetBeans Visual Library. This is part of my effort to create a Java-based implementation of MIT’s Scratch, which is implemented in Squeak Smalltalk.

Step 1 Create JScratch Block Graphics:

First I created the image using Inkscape (steps to follow), import the image to IDE, then create two LayerWidgets, one transparent, and another opaque. Add the image to the background LayerWidget, adn the Swing component to the front LayerWidget. Finally, use the BorderFactory.createEmptyBorder function to limit the size of the swing component at the front layer.

To create the Scratch blocks, I used InkScape, the Open Source SVG editor. Here are the steps I took to create the graphic:

Read the rest of this entry »


Turn on Code Highlighting in Joomla CodeCitation Plugin

Posted: May 2nd, 2010 | Author: | Filed under: web | No Comments »

Just got CodeCitation to work on my Joomla site and here are the steps I took:

Read the rest of this entry »


libtool and glibtool

Posted: April 12th, 2010 | Author: | Filed under: iphone | No Comments »
This is the content of a typical autogen.sh (for Linux and Unix systems) script which utilize auto tools such as aclocal, libtool, and automake to generate necessary files for building a project.
#! /bin/sh
# a quick hack script to generate necessary files from
# auto* tools.
#
# WARNING: if you run this you will change the versions
# of the tools which are used and, maybe, required!
        touch Makefile.am configure.ac
{
        echo "running libtoolize"
        glibtoolize --force --copy --automake
}  {
        echo "running aclocal"
        aclocal
} {
        echo "running autoheader [ignore the warnings]"
        autoheader
}  {
        echo "running automake"
        automake --force-missing --foreign -a -c
}  {
        echo "running autoconf"
        autoconf
}
        echo "autogen complete"  ||
        echo "ERROR: autogen.sh failed, autogen is incomplete"

For MacOS, just replace libtool with bligtool, and libtoolize with glibtoolize.

        echo "running libtoolize"
        glibtoolize --force --copy --automake