June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

WordPress Quotes

A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (270)
centos8 (3)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (2)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

0 visitors online now
0 guests, 0 bots, 0 members

Hit Counter provided by dental implants orange county

Linux common SHELL

Linux common SHELL 1 delete 0 byte file find -type f -size 0 -exec rm -rf {} \; 2. view the process Arranged in descending memory ps -e -o “% C:% p:% z:% a” | sort -k5 -nr Press the cpu utilization in descending order ps -e -o “% C:% p:% z:% a” | sort […]

Ksh Scripting

Principle of Script

Defining the Shell Type

To make a ksh script (which is a ksh program) crate a new file with a starting line like: #!/usr/bin/ksh It is important that the path to the ksh is propper and that the line doesn not have more than 32 characters. The shell from which you are […]

shell to get the process usage in MB

#!/bin/bash ps -A -o pid,rss,command | grep nginx | grep -v grep | awk ‘{total+=$2}END{printf(“nginx=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep php-fpm | grep -v grep | awk ‘{total+=$2}END{printf(“php-fpm=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep mysqld | grep -v grep | awk ‘{total+=$2}END{printf(“mysql=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep transmission-da | grep […]

LINUX MEMORY

Find Memory Usage

System memory used and free

Total Used and Free Memory in MBytes (in that order)

free -m|grep “buffers/cache”|cut -d”:” -f2 Memory by Process

Raw

ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS Human readable

ps -e -orss=,args= | sort -b -k1,1n | awk ‘{ split( “KB MB GB” , v […]

Bask quick learn

Bash Shell Shortcuts Special Shell Variables

Common environment variables

PATH – Sets the search path for any executable command. Similar to the PATH variable in MSDOS.

HOME – Home directory of the user.

MAIL – Contains the path to the location where mail addressed to the user is stored.

IFS – Contains a string […]

ZCAT Shell bash

How to display the contents of a gzip/gz file By Alvin Alexander. Last updated: Aug 6, 2011 Problem: You have a plain text file that has been compressed with the gzip command, and you’d like to display the file contents with the Unix/Linux cat or more commands.

Solution: Instead of using the cat or more […]

Grep, Awk, and Sed in bash

So, let’s consider the following log file:

www.three.com 10.15.101.11 1353280801 TEST 345 www.one.com 10.14.101.11 1353280801 TEST 343 www.three.com 1.10.11.71 1353280801 TEST 323 www.one.com 10.15.11.61 1353280801 TEST 365 www.two.com 10.10.11.51 1353290801 TEST 55 www.two.com 10.20.13.11 1353290801 REST 435 www.one.com 10.20.14.41 1353290801 REST 65 www.two.com 10.10.11.14 1353290801 REST 345 www.three.com 10.10.11.31 1354280801 REST 34 www.one.com 10.10.13.144 1354280801 […]

if condition-integer expression expected

if condition-integer expression expected

ADV1=94.3 Quantity=96.3 if [ $Quantity -eq $ADV1 ]; then echo “quantity is greter” fi

echo “” | nawk -v ADV1=94.3 -v Quantity=96.3 […]

Parsing – Logs

grep, cat, zgrep and zcat

More on log parsing, I’m taking notes on how to read log files and get the information that I need. On Linux environment, these tools are perfect: grep, cat, zgrep and zcat.

Extracting patterns with grep

We can extract information from a text file using grep. Example, we can extract […]

shell string comparison tests

shell string comparison tests Here are the operators for performing string comparison tests:

s1 Test if s1 is not the empty string s1 = s2 Test if s1 equals s2 s1 != s2 Test if s1 is not equal to s2 -n s1 Test if s1 has non-zero size -z s1 Test if s1 […]