Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Friday, November 21, 2014

xterm setup for GUI access on Linux

1.Logon to the host with your id using MobaXterm (or putty)
2. echo $DISPLAY
3. xauth list
you should get something like:      xyz1064/unix:10  MIT-MAGIC-COOKIE-1  3a6eab1ace1c1cd28ea0bc1569e0d112   
4. sudo su – oracle
5. $ export DISPLAY=(the same value your received in step 2)
6. $ xauth add xyz1064/unix:10  MIT-MAGIC-COOKIE-1  3a6eab1ace1c1cd28ea0bc1569e0d112  (the same string you received in step 3)

7. xclock    - to test it

Monday, March 04, 2013

Simple shell script to invoke a java program with arguments

#!/bin/bash

#arguments, constants etc.
PROVIDER_URL="t3://abc37.abc.com:7002,abc38.abc.com:7002"
CONN_FACTORY="jms/emjoXAJMSConnectionFactory"
QUEUE="jms/ShopListINQueue"
MSG_COUNT=100

WL_HOME="/appl/wl/wlserver_10.3/server/lib"
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_02
CLASSPATH=$WL_HOME/api.jar:$WL_HOME/weblogic.jar:./JmsClient.jar

#invoke java program
$JAVA_HOME/bin/java -cp $CLASSPATH com.abc.test.JmsClient $PROVIDER_URL $CONN_FACTORY $QUEUE $MSG_COUNT

Wednesday, February 09, 2011

CPUs, Virtual Processors, Cores

In Solaris 10, if you want to find the processor type and the number of physical processors installed on the system and the number of Virtual Processors available on the system then the psrinfo command does job for you.

To simply display the number of Physical processors, simply run the command with the -p option as follows:

root@sunserver # psrinfo -p

2 --> where 2 implies that there are 2 physical processors installed on the system.

If you would like to check the number of Virtual Processors on each of these Physical processors then type the command with the “-pv” arguement as follows:

root@ server:/root$ uname -a

SunOS server 5.10 Generic_137111-02 sun4v sparc SUNW,SPARC-Enterprise-T5120

root@server:/root$ psrinfo -pv

The physical processor has 32 virtual processors (0-31)

UltraSPARC-T2 (cpuid 0 clock 1165 MHz)

The above indicates that there was only one physical processor (UltraSPARC-T2) on the T5120 server which has 32 Virtual processors. Each virtual processor is an entity with its own interrupt ID, capable of executing independent threads.

In simple terms, the number of Virtual Processors supported by a physical CPU is

“Number of Core” x “Number of threads”

For instance, the above is on a T5120 server with the UltraSPARC-T2. This CPU has 4 cores and each core can support 8 threads and that gives us 32 Virtual processors.

The number of Virtual processors on a Server is simply the total Virtual processors supported on each of the physical processor.

In the following T5140 server there are 2 Physical UltraSPARC-T2+ processors with 6 cores, each supporting 8 threads which means we get 48 Virtual processors per Physical processor and hence a total of 96 Virtual processors (sum of VPs on individual processors) for the server:

root@ bserver:/root$ uname -a

SunOS bserver 5.10 Generic_137111-02 sun4v sparc SUNW,T5140

root@ bserver:/root$ psrinfo -pv

The physical processor has 48 virtual processors (0-23 32-55)

UltraSPARC-T2+ (cpuid 0 clock 1167 MHz)

The physical processor has 48 virtual processors (64-71 80-119)

UltraSPARC-T2+ (cpuid 64 clock 1167 MHz)

In earlier versions of Solaris, the -p arguement is not supported and hence wouldn’t provide this summarised output on the counts of the physical and Virtual CPUs.

Wednesday, November 03, 2010

Popular default ports

7 Echo request
20/21 File Transfer Protocol (FTP)
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
53 Domain Name Server
80 HTTP Server
1512 Database
1099 JNDI
1100 RMI

Friday, October 29, 2010

Solaris commands

Get the full command-line including arguments for a process on Solaris
/usr/ucb/ps auxww

Disk space
df -hF zfs
du -sk dir

List zones
zfs list
zoneadm list -cv
df -h /zfs/zones/*

Mail env to someone
env | /usr/bin/mailx -v xyz@xxx.com

CPU and Memory information
connect to global zone as root and run this:
prtdiag -v <= for Memory and CPU
prtconf -pv | head
uname -a
df -hF zfs <= for disk space (make sure to locate your zone from the list)

Process tree
ptree 28811

Print process arguments and environment variables
pargs -e 24272

> top
load averages: 3.34, 3.07, 3.01 16:14:17
102 processes: 100 sleeping, 2 on cpu
CPU states: 76.4% idle, 16.4% user, 7.2% kernel, 0.0% iowait, 0.0% swap
Memory: 32G real, 2116M free, 18G swap in use, 30G swap free

PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
28811 adatdce 409 0 0 13G 12G cpu/3 209:29 10.19% java
26243 adatdce 92 59 0 257M 245M sleep 252:53 5.88% TestManager
29824 adatdce 1 50 0 4248K 3656K sleep 147:23 4.52% prstat
4743 adatdce 506 59 0 2293M 2266M sleep 104:32 0.19% java
13970 adatdce 45 56 1 119M 56M sleep 10:09 0.02% java
16194 adatdce 1 59 0 4376K 3768K sleep 8:06 0.02% prstat
4901 adatdce 1 49 0 3616K 2264K cpu/14 0:00 0.02% top-SunOS-5.10-
18895 adatdce 33 56 1 296M 254M sleep 1:51 0.02% BIBusTKServerMa
22690 adatdce 29 56 1 99M 52M sleep 3:34 0.01% BIBusTKServerMa
13827 adatdce 126 56 1 828M 667M sleep 10:49 0.01% java
13805 adatdce 30 56 1 98M 40M sleep 2:35 0.00% rmiregistry
14226 adatdce 1 56 1 64M 46M sleep 2:15 0.00% db_server
5684 noaccess 18 59 0 222M 119M sleep 2:00 0.00% java
3934 adatdce 23 59 0 113M 45M sleep 1:20 0.00% java
28833 root 32 59 0 9840K 5568K sleep 3:55 0.00% nscd


> prstat -s size -n 5

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
28811 adatdce 13G 12G sleep 59 0 3:27:36 2.9% java/405
4743 adatdce 2293M 2266M sleep 59 0 1:44:29 0.1% java/505
13827 adatdce 828M 667M sleep 56 1 0:10:49 0.0% java/126
18895 adatdce 296M 254M sleep 56 1 0:01:50 0.0% BIBusTKServerMa/33
26243 adatdce 256M 244M sleep 59 0 4:11:18 5.0% TestManager/78
Total: 103 processes, 1478 lwps, load averages: 2.98, 3.00, 2.98

"SIZE" == Memory allocated, is always bigger than RSS
RSS includes shared space
MEM includes swap + RAM

prstat -Z <= for process status and resource consumptions
iostat
vmstat