Friday, November 12, 2010

Tips on Virtual Box

If you are using any Virtual box , then you mustt add your user name to the vboxgusers group, So that you get access to the USB system in Windows XP i.e.

usermod -A vboxusers

Sunday, July 18, 2010

Install Oracle 10g XE on ubuntu

1) download oracle  oracle-xe-universal_10.2.0.1-1.0_i386.deb from the oracle official website


Then

sudo dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb



2) sudo /etc/init.d/oracle-xe configure

It will ask the value for some option like

Specify the HTTP port that will be used for Oracle Application Express [8080]:7070


By default the port number is 8080, be care full make sure the same port is not used by any other process, In my case tomcat is already on 8080 so i changed to 7070.

Similarly :
Specify a port that will be used for the database listener [1521]:1521

Then Specify the Password and confirm password  and restart the datatabase like

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y








It Will restart the oracle and now oracle ready to use

You can try it from SQL command line or from http://127.0.0.1:7070/apex

In the above link change the port number accordingly ,what ever you mentioned in the configuration file

from the command line  of SQL, give the command
connect system/manager   i.e

Note: The default database name of 10g is xe.

Tuesday, July 6, 2010

Size of a Symbolic Link In UNIX

Check the Below Example:

lrwxrwxrwx 1 root root 8 Dec 8 2008 swbt -> /nas/usr
lrwxrwxrwx 1 root root 10 Dec 5 2008 tmp -> ../var/tmp

In the above llinks the sizes are 8 and 10 respectively . The Symbolic calculate the size according to the
number of the charaters in the link Path i.e

/nas/usr has 8 characters So the Size is 8

../var/tmp has 10 character So the Size is 10

Tuesday, June 15, 2010

Installing Sun Java On Ubuntu/Debian

Installing Sun Java On Ubuntu/Debian




Download latest Java JDK from http://java.sun.com/j2se/1.5.0/download.jsp

(being sure not to download the .rpm, but rather the .bin)

install java-package with apt-get

(that includes binutils, fakeroot)

(Note also that java-package is in “multiverse”, so your repository list /etc/apt/sources.list needs to have that enabled)

make debian java package:

Disregarding the errors, in a tmp dir where we have copied the downloaded jdk, we do (without using sudo):



fakeroot make-jpkg jdk-1_5_0_05-linux-i586.binwhich, after ok’ing the license and extracting stuff, and trundling,after a while creates sun-j2sdk1.5_1.5.0+update06_i386.deb

then we install our newly made package, this time with sudo:



sudo dpkg -i sun-j2sdk1.5_1.5.0+update06_i386.deb“Once you’ve installed it, you’ll be up and running with the latest jdk: your JAVA_HOME is now, for example, /usr/lib/j2sdk1.5-sun. Get a command line, and enter java -version: you should see something like:


Now you have java :)

Friday, May 7, 2010

How To Restore Grub In Ubuntu

Boot up your live CD


In the desktop, open terminal (Applications -> Accessories -> Terminal).





sudo grub





This will set it to grub mode





find /boot/grub/stage1





This will locate your boot partition. If you already know the location, you can ignore this step.

root (hd0,0)

Replace the (hd0,0) by your boot partition number. If your Ubuntu is installed in the second partition, then change it to (hd0,1)

setup (hd0)
quit

Reboot your system. You should be able to access the Grub bootloader now.

How To Restore Grub In Ubuntu

Boot up your live CD


In the desktop, open terminal (Applications -> Accessories -> Terminal).





sudo grub





This will set it to grub mode





find /boot/grub/stage1





This will locate your boot partition. If you already know the location, you can ignore this step.

root (hd0,0)

Replace the (hd0,0) by your boot partition number. If your Ubuntu is installed in the second partition, then change it to (hd0,1)

setup (hd0)
quit

Reboot your system. You should be able to access the Grub bootloader now.

Thursday, May 6, 2010

Find the MAC address Remotely

If you can ping this host over the LAN/WAN, his MAC address will be cached in ARP table of your NIC for a while, so, from command prompt:


 ping 1.2.3.4

after some echo replies from host 1.2.3.4

arp -a

and you will see MAC address of 1.2.3.4

You can try to specific as

/sbin/arp -a 192.168.1.1


You can also Try : PSTOOLS (freeware from Sysinternals) PSEXEC

Tuesday, April 27, 2010

Performance Refactoring to Reduce Garbage Creation(Advantage in tomcat 5)

The first enhancement to look at is Tomcat 5.0's memory-profiling tools. Tomcat 5 has been carefully optimized so that it produces less object garbage for the Java VM's garbage collector to have to clean up.




A typical problem with busy Java servers is that the server software constantly instantiates new objects, and when they're not needed anymore (typically, when a request ends), the objects are not reused but instead thrown out as garbage. The garbage collector must then find and reap all such objects to reclaim the memory they occupy. This takes time and CPU cycles to do, and in the meantime the whole JVM may be paused so that the garbage collector can finish its work. This means the requests currently in process must simply wait until the garbage collector is done, which makes the whole server slow down a little. Usually, this isn't a big problem because the garbage collector is pretty efficient at collecting garbage objects. But in some cases there is so much garbage being produced that it can't keep up, and eventually the amount of free memory gets low because there is a backlog of garbage objects using lots of memory. Or sometimes a web app creates very large objects that take the garbage collector longer to finalize and destroy, so the amount of free memory is lost in large chunks but isn't being replenished quite as fast.



Tomcat 5.0 has had many garbage creation (read performance enhancement) changes since Tomcat 4.1. Tomcat 5.0's single most important garbage-creation refactoring was the new request URI mapper. After some optimization profiling, Tomcat 4.1's request pipeline was found to create excess garbage while mapping a Connector's requests to the proper Container. For Tomcat 5, a whole new mapper was implemented that generates little or no garbage (lots of object recycling is going on in there), and thus Tomcat 5.0's request pipeline performs noticeably better than that of Tomcat 4.1. This also lowers the overall memory usage compared to Tomcat 4.1, which helps to prevent OutOfMemoryExceptions in the web apps it runs, and helps Tomcat 5 to scale higher vertically (i.e. higher scalability on a single machine).

Thursday, April 15, 2010

Restore The UBUNTU Panels

Run These Below Commands

gconftool-2 --shutdown
gconftool --recursive-unset /apps/panel  
rm -rf ~/.gconf/apps/panel
pkill gnome-panel 

Tuesday, April 13, 2010

Connection To Oracle Through Shell Script

Oracle environment variables; if not all then set at least the last two of the following:




export ORACLE_BASE=/path/to/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g
export ORACLE_TERM=xsun
export NLS_LANG=American_America.US7ASCII
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORACLE_PATH=$ORACLE_HOME/bin
export PATH=$ORACLE_HOME/bin:$PATH
Set the Path of Oracle SID


export ORACLE_SID=orcl (Optional).For More Information(http://www.orafaq.com/wiki/ORACLE_SID)



However, if you have a Service Name instead and your oracle instance runs off of a different port than the default, then use the following format for connecting.



sqlplus -s LOGIN/PASSSWD@SERVERNAME:ORA_PORT/SERVICE_NAME

sqlplus -s LOGIN/PASSSWD  (With out Service Name and with default port)

Ex:--



#!/bin/sh -e 


export ORACLE_BASE=/path/to/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g
export ORACLE_TERM=xsun
export NLS_LANG=American_America.US7ASCII
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORACLE_PATH=$ORACLE_HOME/bin
export PATH=$ORACLE_HOME/bin:$PATH


sqlplus -s LOGIN/PASSSWD@SERVERNAME:ORA_PORT/SERVICE_NAME << EOF > sqloutput

set pagesize 0;
select * from blah;
update blah;
commit;
exit;

Sunday, January 24, 2010

How to set-up or install ZTE MG880 USB Modem in Ubuntu Jaunty 9.04

1. Plug your modem into usb port.

2. To make sure if your modem has been detected by your ubuntu, use this command in your terminal.

standy@ubuntu:~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 04f2:b098 Chicony Electronics Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 19d2:fff5
Bus 003 Device 002: ID 1bcf:0007 Sunplus Innovation Technology Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

In here, you can see your modem vendor id and product id. 19d2:fff5 is your modem ID as CDROM storage, not as MODEM. ZTE modem has 2 function, as storage (include Windows Driver) or as modem itself. To use this modem, we must change its mode to the Modem mode with use USB_ModeSwitch – Activating Switchable USB Devices on Linux.

3. After that, we must download that software from here : http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-1.0.7.tar.bz2

After you have that file, you must extract its content by using extraction software (right click that file => extract here). The content of that file is included these files :

80-usb_modeswitch.rules
README
usb_modeswitch.d
COPYING
usb_modeswitch
usb_modeswitch.h
Makefile
usb_modeswitch.c
usb_modeswitch.sh
Makefile.integrated
usb_modeswitch.conf
usb_modeswitch.tcl

by using Nautilus (type “sudo nautilus” in terminal), you must copy these files (red color files only) into :

usb_modeswitch => /usr/sbin
usb_modeswitch.conf => /etc

4. Next you must set or edit usb_modeswitch.conf with gedit.

You must search words line contain like this :

########################################################
# ZTE AC8710
# ZTE AC2726
# and others
#
# Many new ZTE devices use this sequence. There are
# several ID combinations; check your default
#
# Contributor: Michael Khurtsiya, Amit Pundir and others

DefaultVendor= 0×19d2
DefaultProduct= 0xfff5

TargetVendor= 0×19d2
TargetProduct= 0xfffe

# No. 2

;DefaultVendor= 0×19d2
;DefaultProduct= 0xfff6

;TargetVendor= 0×19d2
;TargetProduct= 0xfff1

# No. 3

;DefaultVendor= 0×19d2
;DefaultProduct= 0xfff5

;TargetVendor= 0×19d2
;TargetProduct= 0xfff1

# only for reference and 0.x versions
# MessageEndpoint=0×05

MessageContent=”5553424312345678c00000008000069f030000000000000000000000000000″

———————————————————————

You must set yours to be like that. The difference only in red words line, with delete ; symbol.
Save and exit from gedit.

5. Now on terminal you can type :

standy@ubuntu:~$ sudo usb_modeswitch

Looking for target devices …
No devices in target mode or class found
Looking for default devices …
Found default devices (1)
Accessing device 003 on bus 003 …
Using endpoints 0×05 (out) and 0×82 (in)
Inquiring device details; driver will be detached …
Looking for active driver …
No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
————————-
Vendor String: ZTE
Model String: USB Storage FFFE
Revision String: 2.31
————————-

USB description data (for identification)
————————-
Manufacturer: ZTE, Incorporated
Product: USB Storage
Serial No.: 000000000002
————————-
Setting up communication with interface 0 …
Trying to send the message to endpoint 0×05 …
OK, message successfully sent
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

standy@ubuntu:~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 04f2:b098 Chicony Electronics Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 19d2:fffe
Bus 003 Device 002: ID 1bcf:0007 Sunplus Innovation Technology Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

6. Oke … your modem is a modem now … or in modem mode … In here, you can see your modem vendor id and product id. 19d2:fffe is your modem ID as MODEM.

Next, you must modprobe your modem as usbserial into kernel … (different method with other ubuntu version) with “sudo gedit /boot/grub/menu.lst” in terminal.
Compare, add and edit yours to be like this :

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-11-generic with usbserial
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=EA9CAC679CAC304D loop=/ubuntu/disks/root.disk ro quiet splash
usbserial.vendor=0×19d2 usbserial.product=0xfffe
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=EA9CAC679CAC304D loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
root ()/ubuntu/disks
kernel /boot/memtest86+.bin

———————————————————————

Then instal wvdia
---------------------------------------


sudo apt-get install wvdial

then edit /etc/wvdial.conf file like


Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = #777
Username =
Password =
ISDN = 0
SetVolume = 0
FlowControl = Hardware (CRTSCTS)
Modem = /dev/ttyUSB0
Dial Command = ATDT
Baud = 460800
Stupid Mode = 1




//If you are going to use wvdial the follow the pppconfig


Close all terminal. Open new terminal and type
sudo pppconfig
in the new (below) window select Create and give ok…
Type provider name (say reliance) and give ok
Select Dynamic and give ok
Select PAP and give ok
Enter your Reliance Number and give ok
Password is same as your Reliance Number, enter it and give ok
Do not change Modem Speed
Select Tone and give ok
Enter #777 and give ok
Enter yes
Select Manual and give ok
Give your modem port. In my (most of the) case it is /dev/ttyUSB0
Now all set. Ensure Everything is fine. Select Finished then ok
Finally in the last wind select Quit and give ok
Now you have configured your modem successfully and all set to connect.
To establish internet connection type the following command in terminal…
sudo pon reliance
Ensuring connection is established use this command…
ifconfig
Now you should see entry like this…
ppp0 Link encap:Point-to-Point Protocol
inet addr:123.239.41.80 P-t-P:220.224.134.12 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:3429 errors:23 dropped:0 overruns:0 frame:0
TX packets:3683 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2309338 (2.3 MB) TX bytes:731534 (731.5 KB)

Once the connection is established you can close the terminal.
To disconnect…
sudo poff reliance
 







Save and restart now …