Brownian motion

The quick brown fox jumps over the lazy dog

 

Archive for 27 June 2008

40Gb Internet — to mamma’s home

Peter Lothberg installed to his mom’s home 40Gb/s Internet connection — here is him report at RIPE 55 Session, and here — his mom finishes installation:

Here is more photos.

This new Cisco CRS-1 4-Slot Single-Shelf System they have installed over there.

I’m shocked :-)

Some technical details::

  • FO length — ~412 km
  • 3.5dB (unoptimized), DWDM
  • EDFA amplifiers, dispersion compensators
  • Ethernet/G.709
  • 10-15 BER
  • ~1.56kW, ~300 euro/month

His report is interesting, really :-)

Miniature Earth — valid XHTML markup

BTW, to have XHTML validated page, it was necessary to change the code provided by YouTube.

For Miniature Earth they provided:

<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/kIUCTbi_XZs"></param>
<embed src="http://www.youtube.com/v/kIUCTbi_XZs"
   type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>

Should be like this:

<object width="425" height="344" data="http://www.youtube.com/v/kIUCTbi_XZs"
    type="application/x-shockwave-flash">
<param name="movie" value="http://www.youtube.com/v/kIUCTbi_XZs"></param>
</object>

Here is the info — Flash Satay: Embedding Flash While Supporting Standards.

Miniature Earth

It seems that… It looks like I must keep these numbers/proportions in my memory.

Extract part of FreeRadius’ log — Python

I just have wrote about Extract part of FreeRadius” log with a little awk script. Then I decided that it whould be easier and quicker than with Python.

Here is a Python script, which does the same (and written in the same way):

#!/usr/bin/python
#
#
 
import sys, re
 
pattern = sys.argv[1]
file = open(sys.argv[2])
 
cp = re.compile(pattern)
 
total = 0
selected = 0
good = False
lines = 0
 
set = []
 
while True:
    line = file.readline()
    if not line:
        break
 
    lines += 1
 
    set.append(line)
 
    if cp.search(line):
        good = True
 
    if line == '\n':
        if good:
            print ''.join(set),
            selected += 1
 
        good = False
        set = []
        total += 1
 
sys.stderr.write("%i records (%i lines) processed\n" %(total, lines))
sys.stderr.write("%i records matched\n" % selected)
sys.stderr.write("Pattern was: '%s'\n\n" % pattern)

Nothing special, you see.

What I considered interesting in this script? — it works near 30% faster than awk. And I don’t know how to optimize my awk script :-)

Take a look, this is awk:

time awk -f cutlog.awk pattern='Station-Id = \"XXXYYZ[0-2]\"' detail-YYYYMMDD > detail-YYYYMMDD.part
276358 records (6874776 lines) processed
49574 records matched
Pattern was: 'Station-Id = "XXXYYZ[0-2]"'
 
33.90user 0.29system 0:34.19elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+306minor)pagefaults 0swaps

This is Python:

time python cutlog.py 'Station-Id = "XXXYYZ[0-2]"' detail-YYYYMMDD > detail-YYYYMMDD.part
276358 records (6874776 lines) processed
49574 records matched
Pattern was: 'Station-Id = "XXXYYZ[0-2]"'
 
26.60user 0.24system 0:26.85elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+732minor)pagefaults 0swaps

update:
Well, I have tried to «optimize»:

    # in place of:
    if cp.search(line):
        good = True
    # to write:
    if not good and cp.search(line):
        good = True
        continue
# and the same for awk script.

There is no significant difference. And no significant difference when to change order of checking (first «if line is empty» and then «if line matches» or otherwise), use print instead of printf etc.

Excellent site about CSS!

The very nice site for beginners — http://css.maxdesign.com.au/. A lot of information, examples, step-by-step solutions.

BTW, there i’ve found another good page, Floats, Margins and IE — examples and workarounds for MSIE’s problem related to rendering floats.

Pages

Recent Posts

Most Rated

Highest Rated

Tags

Archives