Monday, October 01, 2007
Dev : Tracing Users
So someone had log in and done something to your file. Who is it? You have over 100 co-workers here. So how do we actually see who had done something wrong? By using the command "finger" and "w", we might be able to get something straight.
Generally, the mighty "w" will help you to trace who had login to this server and what are they doing currently. "finger" instead, will let you see the list of logged in users, what time they are already in and from where (IP address) these users come from.
These are some commands that might help you to trace the culprit. There should be some other way to get a better "result" and I am still trying to study and find the best way, but for the time being, just bear with me. :-)
Monday, September 17, 2007
Dev : EUC_CN
I have no idea what is wrong and I definately didn't have any problem on my browser's encoding because I have run this projects million of times on my workstation. I turned in to my sifu when my brain juice started leaking out. Unlike me who had use the whole morning trying to figure out what the f*** is this, my sifu just took 5 minutes to solve my misery, and he told me that it is actually the problem of my jdk. I am using 1.4 for this particular tomcat and if I change to 1.5, it will definately work. He showed me an article of the problem too.
Yeah. It really works! Cool...
Friday, August 10, 2007
Dev : Failure of server APACHE bridge
We got something similar to this when accessing the portal.
This in a way was useful for the developers to understand what is happening.It could only mean one thing. Apache could not connect to weblogic. But for customer point of view, it is some mambo jumbo stuff that they would just say "Server Crash!".
I would suggest to all the developers and to those who concern, when webridge Apache to Weblogic (or might work for other webserver as well), to add in some stuff to make the "error" look more beautiful.The steps are:
1. Add in your error page in apache_path
E.g.:
<location /myportal>
SetHandler weblogic-handler
WebLogicHost 192.168.1.152
WebLogicPort 7004
ErrorPage errorpage.html
</location>
3. Restart apache.
Currently I see that some of us do not have this practice yet. It is always better that to let our client and customer see something useful, rather than rocket science stuff.
Friday, June 22, 2007
Dev : Checking Disk Usage on Unix
But how do we do it on the Unix console? Especially when your server does not have any UI installed. Just use df command and du command.
df is to check the disk free space from each mount point. Normally we would just
df -k
To see the list of mount points, the allocated, used and available disk space. It will also show some useful information such as percentage used and such. -k is to show the unit in 1024-byte, or in kilobyte form. In Linux, we can even use df -g or df -m to show in Gigabyte and Megabyte form.
Dev : HTML Comments
Normally, it should be something like this:
<!-- Ok guys. The below HTML code is for displaying table -->
But have do you notice that the number of hyphen, "-", at the end is always even? Else, you will commented those needed part as well. This is about something called Legal Comment. To read more, go here.
Thursday, June 21, 2007
Dev : Java Spring + Valuelist
java.lang.NullPointerException
at net.mlw.vlh.web.ValueListRequestUtil.getRequestParameterMap(ValueListRequestUtil.java:71)
at net.mlw.vlh.web.ValueListRequestUtil.buildValueListInfo(ValueListRequestUtil.java:123)
at net.mlw.vlh.web.ValueListRequestUtil.buildValueListInfo(ValueListRequestUtil.java:106)
Where the error comes from? It is from a my line of coding as below:
ValueListInfo oValueListInfo = ValueListRequestUtil.buildValueListInfo(request);
What could have been the problem? After changing here and there, finally, I've found the caused of my misery:
<form name="aForm" enctype="multipart/form-data">
Don't know what is the reason, but hoping soon to find out when free, after I remove the enctype="multipart/form-data", everything is running as usual. Ha!
Wednesday, May 23, 2007
SSH and FTP on Ubuntu
What should I do? After getting suggetion from Steven to install the service because most probably it is not in by default, it works! Thanks sifu~~
There are 2 websites that I refer to, NBLUG and Cyberciti, and thanks to them, I manage to run both services.
To make it simple, to install SSH and FTP, just type "sudo apt-get install ssh" and "sudo apt-get install vsftpd" respectively for each services. To change the setting of SSH, you may go to "/etc/ssh/" directory to find out more. If you are wanting to modify FTP setting, you may want to modify "/etc/vsftpd.conf".
Monday, May 21, 2007
Dev : Oracle Export and Import
So now, how do we backup a user? Some simple step will do.
Lets say we are tring to backup the user "newDB" and the password is "12345".
1. Go to console.
2. type "exp newDB/12345" and enter.
3. follow the steps. Normally by clicking "enter" will do. If you wish to change the name of the backup file, you may change it in one of the option.
Ok. Once your backup is done, you may want to store it to another location. So, in case of natural disaster, choi... We can get the dump file and recreate our database. But how?
1. Go to console.
2. Create new user, grant DBA permission.
3. type "imp newDB/12345 FILE=/get/dump/file/directory/dbdump.dmp FULL=y LOG=newlog.log" and enter.
See? Really as easy as 1-2-and-3! :)
Friday, April 06, 2007
Dev : FTP-ing In Windows Using Script
There are 2 method.
Method 1:
Create 2 files. 1 is a text file (ftp_cmd.txt) , another is a batch file (ftp_cmd.bat).
ftp_cmd.txt
|
ftp_cmd.bat
|
Method 2:
Create 1 batch file (ftp_cmd.bat).
ftp_cmd.bat
|
Please take note that the batch file cannot be named as ftp.bat. This will cause confusion between your batch file and ftp command and it will keep on displaying a loop. Every details must not end with a white space.
Monday, April 02, 2007
Dev : Adding New User
When we use "useradd -d /home/unixuser unixuser" in Linux, we will be automatically create a user called unixuser and a new directory call /home/unixuser will be created.
However, in Solaris, "useradd -d /home/unixuser unixuser" will only create a user call unixuser, but no user home directory will be created. To make it easy, just add in an extra parameter called "-m", as in create home directory. So the better command for created user in Solaris should be "useradd -d /home/unixuser -m unixuser".
For more information on unix useradd, see here.