Copyright 2021 Simon Quantrill, All Rights Reserved

Unix Tips

Tue 12 December 2006

As I have nothing better to write Ill add some tips I have UNIX:

  1. Find large files taking up space

    du -s * | sort -n

  2. Replacement for Google

  3. MMSC 1.How did I found out_ Just a simple command I got from development:


    This will make the front-end module do more tracing into /var/mmsc-2.1/frontend/error_log.xxxxx also about the parsing of configuration files. To go back to the original situation you can unset this variable TRC_INITIAL_LEVEL.

  4. Generate snmp traps #!/usr/local/bin/perl # Script to check snmp traps sent to topen view use SNMP_util "0.54"; # This will load the BER and SNMP_Session for us snmptrap("public@", ".", "SimonTest");

  5. Get the current connections: netstat -an | grep tcp | awk '{print $6}' | sort | uniq -c
  6. COMPARE the same files on two different machines #Compares two files on to hosts #S.Quantrill # file1="/tmp/file1.txt" file2="/tmp/file2.txt" cat /dev/null > $file1 cat /dev/null > $file2 until [ -s $file1 ] do rsh mms1b1n1 "cat /etc/hosts" > $file1 done until [ -s $file2 ] do rsh mms1b1n2 "cat /etc/hosts" > $file2 done sdiff $file1 $file2
  7. tru64 evm loging view evmget | evmshow -t "@timestamp [@priority] @@" | more
  8. With tru64 you can get to the compag insight manager via port 2301 using a web browser Open a new Internet Explorer enter the following URLs:

    http://:20550/mmh/info: This page is available for release 2.1-02 and up. - http://:20550/mmh/snmpinfo: http://:20550/mmh/messagebrowse: This display the contents of the MMH. The From Message field contains the first message id to be looked and the combo box indicates the number of messages to be displayed. If detailed is entered, the output gives an overview of the database content. The output can be retrieved via telnet: # telnet 20550 GET /mmh/messagebrowser?MESSAGE=1&COUNT=1000 HTTP/1.0 GET /mmh/messagebrowser/info #!/usr/local/bin/perl # Script to check snmp traps sent to topen view # Short script to test functing snmp # Author: Simon Quantrill use BER; require ‘’; # This will load the BER and SNMP_Session for us snmptrap(“public@”, “.”, “SimonTest”); #!/usr/bin/perl -w # Check a web socket to see if something is running on that port # use strict; use Socket qw(:DEFAULT :crlf); use IO::Socket; my $http_method = shift || ‘GET’; my $http_server = shift || ‘’; my $html_page = shift || ‘/mmh/messagebrowser?MESSAGE=1&COUNT=50’; my $http_obj = IO::Socket::INET->new( PeerAddr => $http_server, PeerPort => 20550, Proto => ‘tcp’ ) or die “wwwb: could not create socket object: $!n”; print $http_obj “$http_method $html_page HTTP/1.0$CRLF$CRLF”; while ( my $line = <$http_obj> ) { $line =~ s/$CR?$LF/n/; print $line; } $http_obj->close;

on the top