Tuesday, December 20, 2011

Send large files to email from linux box

uuencode:

we can send large files to email from linux box using this command.

Syntax:

uuencode file-name file-name|sendmail -v mailid@mail.com

          or
uuencode file-name file-name|mailx -s "some-file" mailid@mail.com

Monday, June 13, 2011

UNIX95


################################################################################

UNIX95

UNIX95= ps -eo pid,user,sz,vsz,args|sort -nbk3|tail -20  (it will sort according to third field i.e sz)

UNIX95= ps -ef -o pid,ruser,vsz,args|sort -nrk3
UNIX95= ps -eo pid,user,sz,vsz,pcpu,args|sort -nbk5 | tail -10  (for cpu)
UNIX95= ps -eo pid,user,sz,vsz,args|sort -nbk3|tail -20
UNIX95= ps -eo pid,user,sz,vsz,args|sort -nbk3|grep -i 'LOCAL=NO'|wc -l

 #################################################################

GBL_MI_LOST_PROC is greater than zero.



#view /var/opt/perf/status.scope
GBL_MI_LOST_PROC is greater than zero:
**** 06/11/11 00:35:00 ****
Server collector startup completed, beginning data collection.
Collection intervals: Process = 60   Global = 300
Warning: GBL_MI_LOST_PROC is greater than zero.
**** /opt/perf/bin/scopeux : 06/11/11 23:30:00 ****
Start of /var/opt/perf/datafiles/logproc file roll
**** /opt/perf/bin/scopeux : 06/11/11 23:30:24 ****
Successfully rolled /var/opt/perf/datafiles/logproc.
@@@@@@@@@@@
ref:
GBL_MI_LOST_PROC:-
The number of processes the measurement layer has lost the ability to update during the interval. This is an indication the
system activity might require the midaemon be restarted with a larger process count. See the midaemon man page for additional
information on the -pids parameter.
man midaemon
18:root [/var/opt/perf] file status.mi
status.mi:      ascii text
18:root [/var/opt/perf] cat status.mi|tail -30

Friday, June 10, 2011

BCV(Business Continuity Volume)


EMC for DBA's

Symmetrix refers to the EMC disk devices, disks within thid symmetix can be divided into various sized logical volumes, these logical volumes can be logicaly joined together and presented to a server.

There are 2 types of logical volume:

Hypervolumes - range of continuos space on a single disk. A single disk can be divided into 128 parts or hypervolumes this is refered to as slicing or splitting. These now form the basis to create metavolumes.

Metavolumes - A group of hypervolumes of the same size grouped together, this is then presented to a server. Once part of a metavolume, only the whole meta can be presented to the server not single disks.

Meta Head and Tail
When hypervolumes are added to a metavolume they are given a sequence, the first hyper being the head and last being the tail. Data is written to Meta from head to tail.


Priner issues .. trouble shooting



#cd /etc/lp/interface  

#ll|grep -i printname
#lpstat -vprintname  (printer details)
#lpstat -oprintname (printer queue status)
#lpstat -pprintname (printer status)

#w
#cd

#telnet ip portno
#echo "TEST PRINT"|lp -d printname (sending a test print)
#echo "TEST PRINT"|lp -d printname
#lpstat -ojprintname (cheking weather it got fired from the queue)

LP printer Creation:

lpadmin -p -orm -orp -mrmodel -v/dev/null -orc -ocmrcmodel -osmrsmodel

lpadmin -p143_zb1 -ormAUABGN-PRN2 -orp143_zb1 -mrmodel -v/dev/null -orc -ocmrcmodel -osmrsmodel

Monday, April 25, 2011

Some useful commands.



lsof is a command meaning "list open files", which is used in many Unix-like
systems to report a list of all open files and the processes that opened them

Dmidecode reports information about your system's hardware as described in your
system BIOS according to the SMBIOS/DMI standard.(Linux)

Memory & Cpu utilization : 
Top (linux)
Glance(unix)
UNIX95=
swapinfo -tm
cat /proc/meminfo
free -tml (t-total,m-megabites,l-diff b/w low high)

File system utilization: 
du -sk * (individually)
du -sk .(collectively)

Timex :  we know time taken by different users to run a command.


Unix Nohup: Run a Command or Shell-Script Even after You Logout

When you execute a Unix job in the background ( using &, bg command), and logout from the session, your process will get killed. You can avoid this using several methods — executing the job with nohup, or making it as batch job using at, batch or cron command.

This quick tip is for beginners. If you’ve been using nohup for a while, leave us a comment and tell us under what situations you use nohup.
In this quick tip, let us review how to make your process running even after you logout, using nohup.
Nohup stands for no hang up, which can be executed as shown below.
nohup syntax:
# nohup command-with-options &
Nohup is very helpful when you have to execute a shell-script or command that take a long time to finish. In that case, you don’t want to be connected to the shell and waiting for the command to complete. Instead, execute it with nohup, exit the shell and continue with your other work.

Explanation about nohup.out file

By default, the standard output will be redirected to nohup.out file in the current directory. And the standard error will be redirected to stdout, thus it will also go to nohup.out. So, your nohup.out will contain both standard output and error messages from the script that you’ve executed using nohup command.
Instead of using nohup.out, you can also redirect the output to a file using the normal shell redirections.

Example: Printing lines to both standard output & standard error

while(true)
do
echo "standard output"
echo "standard error" 1>&2
sleep 1;
done

Execute the script without redirection

$ nohup sh custom-script.sh &
[1] 12034
$ nohup: ignoring input and appending output to `nohup.out'

$ tail -f nohup.out
standard output
standard error
standard output
standard error
..

Execute the script with redirection

$ nohup sh custom-script.sh > custom-out.log &
[1] 11069
$ nohup: ignoring input and redirecting stderr to stdout

$ tail -f custom-out.log
standard output
standard error
standard output
standard error
..
If you log-out of the shell and login again, you’ll still see the custom-script.sh running in the background.
$ ps aux | grep sathiya
sathiya  12034  0.0  0.1   4912  1080 pts/2    S    14:10   0:00 sh custom

nice - run a program with modified scheduling priority  
Run COMMAND with an adjusted scheduling priority. With no COMMAND, print the current scheduling priority. ADJUST is 10 by default. Range goes from -20 (highest priority) to 19 (lowest).
-n--adjustment=ADJUST
increment priority by ADJUST first 

 
 
vgreduce -t ( This will run vgreduce in test mode)

buffer I/O error main reason is difference in I/O timings with storage lun.

[root@d scsi_device]# cat /sys/block/sdab/device/timeout
30
[root@d scsi_device]# 



Aix commands to check kernel parameters

lsattr -E -l sys0
topas
startsrc -s sshd

Sed command to extract data b/w two words in a file

sed -n '/langham/,/langport/p' linux_workout

Mount error

mount: special device  does not exist

(re activate the vg ) or check vg activation status