Monday, March 21, 2011
Accurate calculation of memory utilization in Linux
Hi,
We use
ps aux | awk '{sum +=$4}; END {print sum}' to find the total memory utilization excluding the buffers and cache. This one manipulates the wrong data at some instances. No idea why .
So in addition to this we can adopt the below commands as wel..
free -m | grep "+" | awk {'print $3/$4*100'}
or more handy
U=`free -m | grep "+" | awk {'print $3'}`;F=`free -m | grep "+" | awk {'print $4'}`;echo "scale=2;$U/$F*100"| bc
There may be another ways as well. Comments please.
Wednesday, January 12, 2011
Check remote UDP connectivity from Linux
Hi there,
You all know how to check TCP port connectivity from a Linux or UNIX machine to a remote machine using telnet as per th example below
$ telnet 127.0.0.1 25
but we can't adopt TELNET to check UDP connectivity.
Linux and most of the UNIXes come with a network layer utility called nc (abbreviation for netcat) which is very useful to check UDP connectivity and to explore a lot with both TCP and UDP.
An example is shown below
# nc -v -u -z -w 3 172.24.16.131 123
Connection to 172.24.16.131 123 port [udp/ntp] succeeded!
You all know how to check TCP port connectivity from a Linux or UNIX machine to a remote machine using telnet as per th example below
$ telnet 127.0.0.1 25
but we can't adopt TELNET to check UDP connectivity.
Linux and most of the UNIXes come with a network layer utility called nc (abbreviation for netcat) which is very useful to check UDP connectivity and to explore a lot with both TCP and UDP.
An example is shown below
# nc -v -u -z -w 3 172.24.16.131 123
Connection to 172.24.16.131 123 port [udp/ntp] succeeded!
Subscribe to:
Posts (Atom)
AT&T USA | Internet not working | Fix by custom APN
If the AT&T Mobile internet is not working on your cellphone, it can be fixed easily by adding an APN configuration. You can read this a...
-
1. Open Applications -> System -> Configuration Editor from the GUI OR Open a terminal, type gconf-editor 2. Go to "...
-
#!/bin/bash # BASH Script to generate $EXTENSION files like FILE_fr.$EXTENSION,FILE_sp.$EXTENSION from existing FILE_$SEARCHSTRING.$EXTENSIO...
-
#!/bin/bash # Script to create a CSV formatted text with a file of a few lines having one entry per line. # This will merge the files line b...