April 9, 2004
Tag and Create a new branch
When your mainline is ready to ship, tag it. You have to do this anyway to remember what you shipped.
- cd an_up_to_date_working_copy
- cvs tag main_1_0
Create a branch and put the working copy on it.
- cvs tag -r main_1_0 -b B_1_0_branch
- cvs update -r B_1_0_branch
Make the changes for customer B, and commit them as you go. Because your working copy has a sticky tag from the “update -r B_1_0_branch”, your commits go to that branch instead of the trunk.
When your branch is good, tag it too.
- cvs tag B_1_0
You can now go to a clean directory and export revisions main_1_0 and B_1_0 for shipping.
Return to your working copy and put it back on the trunk.
- cvs update -A
All your “B” changes are gone, you are back to the mainline. Proceed with normal development. When your mainline is ready to ship again, tag it.
- cvs tag main_1_1
Now the fun part: you create a new branch for customer B and recreate all the changes you made the first time.
- cvs tag -r main_1_1 -b B_1_1_branch
- cvs update -r B_1_1_branch
- cvs update -j main_1_0 -j B_1_0
- # fix conflicts
- cvs commit
The “update -j -j” does most of the work for you, but it’s not foolproof so you have to manually inspect and test your sources. You’ll be surprised how little damage you have to fix. When you’re happy, tag the tip of your new B branch.
- cvs tag B_1_1
- cvs update -A
The process repeats after the second release. Tag, create new branch, merge the previous branch to it. You have to be very clear about the use of those branches: all development happens on the trunk, the “B” branches are *only* for customer-specific variants. You never merge these branches back to the trunk.
(In truth, you should also have bugfix branches for the normal code you ship, but that’s an easier pattern to master than the stepladder of branches I just described. Stick to the hard stuff for now… 🙂
Comments Off on Setup cvs server
- on Linux DHCP client machine, run “dhcpcd -k” to send DHCP_RELEASE signal. run “dhcpcd” or “dhcpcd -h hostname” to get an ip from DHCP server
- on Linux DHCP server machine, run “cp /usr/share/doc/dhcp-/dhcpd.conf.sample /etc/dhcpd.conf”
- “edit /etc/dhcpd.conf”
- “touch /var/lib/dhcp/dhcpd.leases”
- “/usr/sbin/dhcpd eth1”
- for more detailed information, try DHCP Server Help
Comments Off on Setup DHCP server
- on the Linux server machine, edit /etc/exports, adding a line “/vol shanghai(rw) chuangchun(rw)” at the end; and run “/etc/init.d/nfs restart”
- or on the Linux server machine, following the steps as stated here – NFS Howto
- on the client machine, (can be a Unix or a Linux system), run “mount (SERVER_IP_ADDRESS):(SHARE_DIRECTORY) (LOCAL_SHARE_DIRECTORY)”; or on the Linux client machine, to mount file systems at boot time, edit /etc/fstab, adding a line “wenji:/opt
/mnt/shared/opt nfs rw 0 0” at
the end.
Comments Off on Setup NFS
I am running samba on redhat linux 6.0. Then I tried to use samba to talk to another computer running both Windows 2000 and Windows 98.
- go http://www.samba.org,
and download the most updated stable version of samba for my redhat linux 6.0 system
- untar the download file. If it is in rpm format, use “rpm –install” or “rpm –upgrade” to install the samba package.
- create a file, called /sbin/startsmb, and make it executable
#!/bin/sh
/usr/sbin/smbd -D
/usr/sbin/nmbd -D -G SIEGE
(the last word “SIEGE” is your Workgroup name. and if you want to start samba automatically at boot time, create two soft links under /etc/rc.d/init.d and under /etc/rc.d/rc5.d)
- configure the /etc/smb.conf file.
- run /sbin/startsmb, that’s almost it on linux side
- On Both Windows 2000 and Windows 98 systems, set the computer name and workgroup name.
- I also installed NetBEUI Protocol on the network card talking to my linux box. I know that’s a must for Windows 98, but not sure for Windows 2000
- On Windows 2000, go Control Panel –> Users and Passwords –> Advanced –> Advanced –> Users –> Guest –> Properties –> unset “Account is disabled”, which make guest accout enabled
- on Windows 2000, I have also added a Windows component, Internet Information Services (IIS). Again, I don’t know whether this is a must or not. However, after installing IIS, I can ftp to my Windows 2000 now.
- So, that’s it. Now, from my linux box, I can see all the shared files and use shared printer on my Windows system. From my Windows system, I can see all the shared files defined in /etc/smb.conf. I can just click the files and edit them or winzip them directly on Windows. People won’t notice the files are on another computer. Is that beauty? ENJOY!
Comments Off on Setup Samba
- on the server machine, run “xhost +(CLIENT_IP_ADDRESS)”.
- on the client machine, run “setenv DISPLAY (SERVER_IP_ADDRESS):0”.
- on the client machine, run the program.
Comments Off on Setup display remotely on X server
Setup port forward
- ssh -v -g -l user_name -L local_port:remote_ip:remote_port remote_ip
Check for disk space
- df -kl
- du -sk *
translating a Java source file into a native executable using the GNU GCJ compiler
- gcj –classpath . -g0 –main=HelloWorld -o HelloWorld.exe HelloWorld.java
DNS lookup utility
- dig -mx yahoo.com
Network exploration tool and security scanner
- nmap -sT 127.0.0.1
UNIX system error.h
- /usr/include/sys/errno.h
returns the HTTP response headers from the named site
- HEAD http://yad2yad.huji.ac.il/
- Result:
200 OK
Cache-Control: max-age=0
Connection: close
Date: Tue, 10 Dec 2002 08:38:37 GMT
Server: AOLserver/3.3.1+ad13
Content-Type: text/html; charset=utf-8
Comments Off on Some useful commands
Comments Off on Setup xemacs
Comments Off on Change Prompt in bash or tcsh
Comments Off on Setup Mail Server
- Write the Java Code
The following Javacode segment defines a class named HelloWorld. This class declares one native method, implements a main method, and has a static code segment.
class HelloWorld {
public native void displayHelloWorld();
static {
System.loadLibrary(“hello”);
}
public static void main(String[] args) {
new HelloWorld().displayHelloWorld();
}
}
- Compile the Java Code
Use the Java compiler to compile the class that you created
in the previous step. Here’s the command to use:
javac HelloWorld.java
- Create the .h File
Running javah :
UNIX & LINUX
% javah -jni HelloWorld
DOS shell (Windows 95/NT)
C:\> javah -jni HelloWorld
MacOS
Drag the HelloWorld.class file onto the JavaH icon. This creates a file called HelloWorld.h in the same folder as JavaH. Move the file into your working folder.
- Write the Native Method Implementation
This implementation is in the file named HelloWorldImp.c.
#include
#include “HelloWorld.h”
#include
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
printf(“Hello world!\n”);
return;
}
- Create a Shared Library
UNIX
cc -G -I/usr/local/java/include -I/usr/local/java/include/solaris HelloWorldImp.c -o libhello.so
LINUX
cc -shared -I/usr/local/java/include -I/usr/local/java/include/solaris HelloWorldImp.c -o libhello.so
DOS shell (Windows 95/NT)
cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorldImp.c -Fehello.dll
Of course, you need to specify the include path that corresponds to the setup on your own machine.
- Run the Program
Now run the Java application (the HelloWorld class) with the Java interpreter, as follows:
java HelloWorld
You should see the following output:
Hello World!
- PS: Set Your Library Path
UNIX
% setenv LD_LIBRARY_PATH mylibrarypath
where mylibrarypath is the name of the directory that contains libhello.so.
DOS shell (Windows 95/NT)
On Windows 95/NT, the loadLibrary()
method searches for DLLs in the same manner as other language environments do.
In c:\autoexec.bat file:
SET INCLUDE=path to find .h files
SET LIB=path to find .lib files
MacOS
The Java runtime searches the JavaSoft Folder in the Extensions folder in the System Folder for shared libraries. Create an alias to your shared library in the JavaSoft Folder.
Comments Off on JNI Example
« Newer Posts —
Older Posts »