Monday, September 13, 2010

GEnerate gsoap

gcc -o iplookup iplookup.c soapC.c soapClient.c -L/usr/local/lib - lgsoap -lm -lsocket -lnsl

gcc test.c soapC.c -lgsoap
works for me

Thursday, September 9, 2010

How to make Virtual keyboard and SCIM co-exist on N900

(1) Install MSCIM and whatever input methods you want
(2) Go to /etc/gtk-2.0/, create two files as follows

first file: vb (for Virtual Keyboard)

"/usr/lib/gtk-2.0/2.10.0/immodules/hildon-im-module.so"
"hildon-input-method" "Hildon Input Method" "hildon-input-method-framework" "/usr/share/locale" "*"

Second file: scim (for MSCIM)

"/usr/lib/gtk-2.0/2.10.0/immodules/im-scim.so"
"scim" "SCIM Input Method" "scim" "/usr/share/locale" "*"


(3) in the same directory, create another two files:

first file: vb.sh

cp /etc/gtk-2.0/vb /etc/gtk-2.0/gtk.immodules

second file: scim.sh

cp /etc/gtk-2.0/scim /etc/gtk-2.0/gtk.immodules

then chmod to these two files

>>root
>>chmod +x vb.sh scim.sh


(4) make two symbolic links in /usr/bin/

ln -s /etc/gtk-2.0/vb.sh /usr/bin/vb
ln -s /etc/gtk-2.0/scim.sh /usr/bin/scim

(5) if you want to use virtual keyboard, remember to retract the physical keyboard first, then type in

>>root
>>vb

if you want to use MSCIM:

>>root
>>scim

Sunday, August 29, 2010

Call of Duty Modern Warfare 2原声碟

尽管Call of Duty Modern Warfare的背景音乐也不错,但是大师毕竟是大师,Hans Zimmer在Modern Warfare II中的作曲表现对该作品在英美游戏排行榜的影响应该是功不可没的。从动画片狮子王,特种作战大片石破天惊到现在的现代战争2,大师的每次背景音乐总能展现深厚,雄伟,旷大的气势。尽管不是反映历史沉重的题材,但军乐队,交响乐及电子合成交替的完美运用却隐约展现一种沉淀,以至于将作品衬托为史诗般的巨作,的确能够让人不惜滥美之词。本文针对现代战争2的原声碟发表一些个人对应观点,顺便For the Record


Safeguard
































Guerrilla Tactics














Deadline














Breach



























Ordinance













Code of Conduct













Protocol













Friday, August 27, 2010

How to get Xilinx XUP Virtex II PRO to work in Ubuntu 10.04

(1) follow aclevername.com
(2) get the product id right in >>lsusb
(3) install usb-driver-HEAD.tar.gz

Wednesday, July 28, 2010

How to make a clone of Virtualbox image and run multiple Virtual machines at the same time

From http://forums.virtualbox.org/viewtopic.php?t=674

1) Shut down the virtual machine you would like to copy
2) In File > Virtualdiskmanager, select the virtual machine disk image you would like to copy, and press the Release button and DELETE it from the menu BUT keep the image on the harddrive.
3) In a terminal window, issue following command (see virtualbox user manual):
vboxmanage clonevdi /directory/image1.vdi /directory/image2.vdi
4) In File > Virtualdiskmanager, add the new disk image you've created in step 3.
5) In the main virtualbox window, press the New button to create a new virtual machine, and link it to the new disk image you've created.

Saturday, July 24, 2010

How to use wsdl file to generate c/c++ files

This setup is based on Debian/Ubuntu system and doesn't involve any installation of Apache/Axis

(1)Install Java (run-time package is enough, but javac is a bonus, though I don't think I used javac in this setup). Note:install some new version, I used version 1.6.

(2)Download Axis C++ bin from Apache.org, decompress it. Note that there is a lib/axisjava folder and all the necessary Axis Java files used by Axis C++ are in there, so we don't have to download Axis Java anymore (however, if you try to use log4j you HAVE TO download Axis Java bin/src). And make sure in lib/axis there is already a wsdl2ws.jar in place, or you have to install ant and build the jar from source (which I didn't do)

(3)Edit CLASSPATH environment variable, here is my CLASSPATH variable

AXIS_C_HOME="type in your full directory path where Axis C++ bin is decompressed to"
AXIS_C_LIB=$AXIS_C_HOME/lib/axisjava

CLASSPATH=$AXIS_C_HOME/lib/axis/wsdl2ws.jar:
$AXIS_C_LIB/axis.jar:
$AXIS_C_LIB/wsdl4j.jar:
$AXIS_C_LIB/commons-discovery.jar:
$AXIS_C_LIB/commons-logging.jar:
$AXIS_C_LIB/jaxrpc.jar:
$AXIS_C_LIB/saaj.jar:
$CLASSPATH

export CLASSPATH

Note: if you want to use log4j, it should be located in $/lib/log4j-version.jar
you will need to include this path to CLASSPATH also.

Also note: if you want to set this varibale permanent, put the above stuff in .profile in your home directory, logout, and login again to take effect. To make sure: printenv $CLASSPATH


(4)Now we're ready to generate some c/c++ files using wsdl templete, here are some examples to generate client side wrapper:

c++:
java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws -sclient -lc++ "your wsdl file full path"

c:
java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws -sclient -lc "your wsdl file full path"

if the above don't work (which shouldn't been the case...), try:

c++:
java -classpath $CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws -sclient -lc++ "your wsdl file full path"

c:
java -classpath $CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws -sclient -lc "your wsdl file full path"


Friday, July 23, 2010

how to create uml file system

this is the only way I found working on Ubuntu 10.04 32bit, the original link is:
http://web2.clarkson.edu/class/cs644/kernel/setup/uml/uml.html


Creating your filesystem

Debian is suprisingly simple to install inside of user mode linux. To begin you must initialize the files using dd. This example assumes that your image files are /opt/uml/debian-root.

Example 5. Creating your filesystem

 #dd if=/dev/zero of=/opt/uml/debian-root bs=1024K count=1000

Now we will initialize the filesystems inside of each of these files. We will be using ext3 as our root filesystem.

Example 6. Initializing the filesystems

 #mkfs.ext3 /opt/uml/debian-root

Now we will need to mount the root filesystem before we run debootstrap.

Example 7. Mounting root

 #mkdir /mnt/debian
#mount -o loop /opt/uml/debian-root /mnt/debian

Now we will install debootstrap and bootstrap a base Debian installation. This is a barebones installation that is less than 200 megs.

Example 8. Debian Installation

 #apt-get install debootstrap
#debootstrap --arch i386 sarge /mnt/debian http://ftp.us.debian.org/debian

or you may want to use the breezy installation.

#debootstrap --arch i386 breezy /mnt/debian http://archive.ubuntulinux.org/ubuntu

At this point your system is an unconfigured base system. You will need to edit the following files in order to have your system in a valid configuration.

  • /etc/fstab

  • /etc/hostname

  • /etc/hosts

  • /etc/network/interfaces

  • /etc/apt/sources.list

  • /etc/securetty

  • /etc/inittab

Example 9. FSTAB configuration

 /dev/ubd0 / ext3 defaults 0 1
proc /proc proc defaults 0 0

Example 10. Host configuration

You will need to make sure that /etc/hostname contains the following line or your nameing preference.

 uml-one

You will need to make sure that /etc/hosts contains the following line.

 127.0.0.1 localhost

At this point you will need to setup your network interface configuration. This is done by editing the file /etc/network/interfaces. This guest will have a loopback network device. More information on configuring network devices under Debian can be found in the Debian Reference.

Example 11. The loopback network interface

 auto lo
iface lo inet loopback

The above should be in the file /etc/network/interfaces. You'll also need to add a mirror or cdrom image to /etc/apt/sources.list

Example 12. /etc/securetty Configuration

 #echo "tty0" >> /etc/securetty
#echo "ttys/0" >> /etc/securetty

Example 13. /mnt/debian/dev

In the breezy debootstrap example no node was created for me to mount the file system too, you can check this by,

 #cd /mnt/debian/dev
#ls ubd*

If this does not return ubd0 then,

#mknod --mode=660 ubd0 b 98 0
#chown root:disk ubd0

Example 14. Edit /etc/inittab

This will allow you to login immediately after the boot messages

 Comment out the following lines:
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

Now modify tty1 to say tty0, the result should look like this:
1:2345:respawn:/sbin/getty 38400 tty0
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

Example 15. Add user to the file system

Before you can log into the file system you must add a user to be ablet logi in with.

 #chroot /mnt/debian
#adduser uml
Aswer the following questions about the new user or press enter followed by a yes at the end

Example 16. Run the kernel with UML

 #sudo umount /mnt/debian
#sudo ./linux ubd0=/opt/uml/debian-root