Thursday, March 18, 2010

Monitoring Ubuntu Server Using Htop

Htop is an advanced, interactive system monitor process viewer written for Linux. It is designed to replace the Unix program top. It shows a frequently updated list of the processes running on a computer, normally ordered by the amount of CPU usage. Unlike 'top', Htop provides a full list of processes running, instead of the top resource consuming processes. Htop also uses color and gives visual information about processor, swap and memory status. - Wikipedia

Hiding Userland Threads
By default htop displays userland threads of processes like console-kit-daemon. To disable this feature;

Run htop
Press F2
Select "Display options"
Mark "Hide userland threads"

Ubuntu - RAM Cleanup

sync; echo 3 > /proc/sys/vm/drop_caches

Wednesday, March 10, 2010

Websphere EJB Development


Developing Stateless Session Beans with Rational Application Developer

Prepare the development environment by following the steps below.
-> Create a new EAR Project
-> Add EJB Project, Web Project and EJBClient Project

Creating New Session Bean



Expand Deployment Descriptor of the EJB Project and select Session Beans
Right click and create new Session Bean


-> Select "Session Bean"
-> Provide a Bean name
-> Check "Generate an annotated bean class"
-> Next


-> Select Session type "Stateless"
-> Select Transation type "Container"
-> Check "Remote Client View"
-> Finish

Implementing And Promoting New Methods



-> Implement methods in the newly created session bean
-> Right click the methods
-> Select Enterprise Beans
-> Click "Promote to Remote Interface"

Preparing for Deployment



-> Right click the deployment descriptor
-> Select "Prepare for Deployment"

Configuring Web Application


Open the deployment descriptor of the Web Application
Select References tab
Click "Add..." to add a new reference

-> Select "EJB reference"
-> Browse the projects and select the ejb to add
-> Select the RefType as Remote


Make sure the name of the Reference is same as the last two portions of the COMP_NAME of the Home Interface ( for eg. if COMP_NAME = "java:comp/env/ejb/TestBean"; then RefName = ejb/TestBean )

Creating and Using the EJB


Example
try {
TestHome testH = TestBeanUtil.getHome();
Test test = testH.create();
}catch(Exception exp) {
exp.printStackTrace();
}

Classloader Settings


Set the classloader as "Application" instead of "Module" for the Enterprise application

Tuesday, March 9, 2010

ASUS USB-N13 UBUNTU (LUCID) DRIVER

Copied From
http://swiss.ubuntuforums.org/showthread.php?t=1419504&page=2
Post# 17

1) Download
http://swiss.ubuntuforums.org/attachment.php?attachmentid=148998&d=1267737748
2) Extract to ~/Desktop/2009
3) cd ~/Desktop/2009
4) sudo su
5) gedit os/linux/config.mk
Find these lines:
-------------------------------------
HAS_WPA_SUPPLICANT=n
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
-------------------------------------
Change them to =y
Save and close gedit.
6) gedit os/linux/usb_main_dev.c
Add a new line:
-------------------------------------
{USB_DEVICE(0x0B05,0x1784)}, /* Asus 3070 */
-------------------------------------
Save and close gedit.
7) make
8) make install
9) cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat
10) gedit /etc/modules
Add lines
-------------------------------------
rt2870sta
rt3070sta
-------------------------------------
to the end of the table
11) reboot