One-liner: how to count the total amount of specific lines in several files

Let’s calculate the amount of lines, containing the word “extended” in */*.conf files:

egrep -c extended */*.conf | 
awk 'BEGIN {FS=":"; sum=0;}{sum +=$2} END {print sum}'  

BTW, using awk alone is slower:

time awk 'BEGIN {sum=0;}/extended/{sum++} END {print sum}' */*.conf

real	0m0.94s
user	0m0.91s
sys	0m0.01s

time egrep -c extended */*.conf | 
awk 'BEGIN {FS=":"; sum=0;}{sum +=$2} END {print sum}'

real	0m0.13s
user	0m0.10s
sys	0m0.02s

fgrep is slower than egrep:

time fgrep -c extended */*.conf | 
awk 'BEGIN {FS=":"; sum=0;}{sum +=$2} END {print sum}'

real	0m0.21s
user	0m0.17s
sys	0m0.03s


> traceroute -m 100
traceroute: Warning: Multiple interfaces found; using x.x.x.x @ net0
traceroute to (, 30 hops max, 40 byte packets
. . .
8 (  122.807 ms  150.309 ms  168.517 ms
9 (  160.820 ms  164.675 ms  157.556 ms
10  * * *
11  Episode.IV (  188.004 ms  188.078 ms  277.575 ms
12  A.NEW.HOPE (  212.980 ms  182.796 ms  217.315 ms
13 (  208.230 ms  231.501 ms  187.249 ms
14  Rebel.spaceships (  223.330 ms  185.769 ms  231.825 ms
15  striking.from.a.hidden.base (  222.702 ms  199.810 ms  227.345 ms
16  have.won.their.first.victory (  186.517 ms  221.058 ms  201.745 ms
17  against.the.evil.Galactic.Empire (  185.988 ms  216.445 ms  186.553 ms
Continue reading “traceroute”

Firefox 18.0 crashes on Solaris

Update: fixed in v19.0beta (at least v19.0b1 build3 looks good): (19b1 does not save sessions, though ;-)

Firefox 18 (all betas and 18.0) crashes on Solaris 11 and OpenSolaris. The workaround is to set the following variables to “false”:


See bug 827971.

One-liners: simple ASA log parsers

Sometimes you do not need a detailed log-analysis but several simple one-liners that you can adjust without too much thinking how it works, what you did last time, etc. The examples below are absolutely NOT optimal, but rather modular for easy line-editing.

Continue reading “One-liners: simple ASA log parsers”

UPnP devices do not see each other

If UPnP devices do not see each other, most likely there are two problems:

Multicasts are not forwarded

Simple Service Discovery Protocol (SSDP) uses multicast IPv4 address The local switches must be able to forward such traffic. On a Cisco switch you run the following command to allow that:

no ip igmp snooping vlan 101

Firewall blocks UPnP traffic

Related ports: UDP-1900 and TCP-2869

Default passwords

Solaris 11: root/solaris
Cyclades console servers (e.g. ACS4): root/tslinux
Avocent ACS5000 console servers: root/avocent
Avocent ACS6000 console servers: admin/avocent or root/linux
Cisco VPN3000: admin/admin
Cisco ASA: empty
Netscreen: netscreen/netscreen
Avocent/Cyclades PM IPDU: admin/pm8 root/linux