2009年11月6日 星期五

Change user profile path in windows xp

Changing the ProfileImagePath value in the registry
ProfileImagePath registry value
The ProfileList registry key contains some sub-keys, which are nothing but the list of User Account Security Identifiers (SID). Each of the SID represents an Account. The key is located here:

HKEY_LOCAL_MACHINE \ SOFTWARE\ Microsoft\ Windows NT \ CurrentVersion \ ProfileList

2009年7月20日 星期一

How to change JBoss default port

1. Open the JBoss Folder

2. Goto its Deploy folder.

3. Goto the jbossweb-tomcat55.sar

4. Find out the server.xml inside that folder. Actually this is the server configure file of the BuildIn Tomcat.

5. Find the folowing Tag

<Connector port="8080" address="${jboss.bind.address}"…….

6. Change the port number here.

7. Restart the server.

Jboss預設只能以127.0.0.1本機存取,如要改變binding address,啟動時指令如下:

run -c default -Djboss.bind.address=0.0.0.0

用run -h可查看help

2009年7月19日 星期日

Install PAE enabled kernel in 32 bit Ubuntu to use 4GB RAM

$ sudo apt-get update
$ sudo sudo apt-get install linux-headers-server linux-image-server linux-server
$ sudo reboot

2009年7月15日 星期三

修改Oracle Express的HTTP port

Oracle database express edition default http port是8080,容易與其他的web server衝到,以下指令可將其改為8087

C:\>sqlplus /nolog

SQL> connect
Enter user-name: system
Enter password: <輸入密碼>
Connected.
SQL> Exec DBMS_XDB.SETHTTPPORT(8087);

PL/SQL procedure successfully completed.

SQL>quit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production

修改後立即生效。

2009年5月4日 星期一

使用JCIFS存取samba folder

JCIFS web site: http://jcifs.samba.org/

Sample code:

jcifs.Config.setProperty("jcifs.smb.client.domain", "APNET");
jcifs.Config.setProperty("jcifs.smb.client.username", "apuser");
jcifs.Config.setProperty("jcifs.smb.client.password", "appassword");
java.io.FileInputStream input = new java.io.FileInputStream("d:/temp/test.txt");
jcifs.smb.SmbFileOutputStream output = new jcifs.smb.SmbFileOutputStream(
        "smb://hostname/upload$/test.txt");
byte[] b = new byte[8192];
int n;
while ((n = input.read(b)) > 0) {
    System.out.write(b, 0, n);
    output.write(b, 0, n);
}
input.close();
output.close();