Check These Out
simple and easy backup your history with timestamp
You can use wildcard with rpm search but you have to do 2 things:
1. use "-a" switch (means "all") with query ("-q") switch - argument is a pattern to use while searching for package names of all installed packages
2. protect wildcards, so that shell could not eat them - escape it with backslash ("\") or enclose all pattern between apostrophes ("'"):
$ rpm -qa 'co*de'
As you can see above it is possible to insert wildcards into middle of the pattern.
If you want, you can add "-i" or another rpm query options, "-i" will print package information for all installed packages matching pattern.
$ time perl -e 'if(opendir D,"."){@a=readdir D;print $#a - 1,"\n"}'
205413
real 0m0.497s
user 0m0.220s
sys 0m0.268s
$ time { ls |wc -l; }
205413
real 0m3.776s
user 0m3.340s
sys 0m0.424s
*********
** EDIT: turns out this perl liner is mostly masturbation. this is slightly faster:
$ find . -maxdepth 1 | wc -l
sh-3.2$ time { find . -maxdepth 1|wc -l; }
205414
real 0m0.456s
user 0m0.116s
sys 0m0.328s
** EDIT: now a slightly faster perl version
$ perl -e 'if(opendir D,"."){++$c foreach readdir D}print $c-1,"\n"'
sh-3.2$ time perl -e 'if(opendir D,"."){++$c foreach readdir D}print $c-1,"\n"'
205414
real 0m0.415s
user 0m0.176s
sys 0m0.232s
You need python-scapy package
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
I often use it to find recently added ou removed device, or using find in /dev, or anything similar.
Just run the command, plug the device, and wait to see him and only him
Trace python statement execution and syscalls invoked during that simultaneously
First we accept a socket and fork the server. Then we overload the new socket as a code ref. This code ref takes one argument, another code ref, which is used as a callback.
The callback is called once for every line read on the socket. The line is put into $_ and the socket itself is passed in to the callback.
Our callback is scanning the line in $_ for an HTTP GET request. If one is found it parses the file name into $1. Then we use $1 to create an new IO::All file object... with a twist. If the file is executable("-x"), then we create a piped command as our IO::All object. This somewhat approximates CGI support.
Whatever the resulting object is, we direct the contents back at our socket which is in $_[0].
Best result when file size less than half of RAM size
Show a simple table with disk IO for the specified host. you monitor a LOT of different thing. Mostly used for MRTG and similar, but this is nice for a quick look, which disk is busy.
"public" is your SNMP community
ensure that snmpd is running on the host which you intend to monitor