Navigation


RSS / Atom



VoIP, SIP registration, and timeouts

2013-05-08 , , , Comment

Quick comment… Everyone in the family has multiple devices— phones, tablets, game consoles, computers— and these tend to make network connections that linger. If you have a firewall like I do, the default TCP and UDP timeouts are probably too high (often 3600 seconds) and when everyone is around on the weekend you get poor performance and strange complaints about how things don’t work. Separately, I have an OBI100 VoIP device providing phone to the house. The OBI100 has a default SIP registration period of 60 seconds and re-registers after half the interval, this is a bit too frequent so I have mine set to 300 seconds. As I’ve found, if the firewall expires the connection quickly you can end up with what looks like a valid registration at the SIP provider and can make outgoing calls but incoming calls fail. I’ve worked around it by expiring connections at 360 seconds for TCP and 180 seconds for UDP.

Comment


Handbrake settings for Roku 2-XS

2012-06-17 , , , Comment

Fiddled with encoding my son’s videos for the Roku 2-XS using handbrake this weekend. Original source are dvd rips, mostly of animation. These settings seem to work well for USB local media playback:

Video settings-
 Format: mkv
 Video Codec: H.264 (x264)
 Framerate: 23.976 (NTSC Film)
 Constant Quality: Enabled
 RF: 20

Audio settings-
 Codec: AAC (faac)
 Mixdown: Stereo
 Samplerate: Auto
 Bitrate: 160
 Gain: 0

Advanced-
 Encoding-
  Reference Frames: 4
  Maximum B-Frames: 4
  CABAC Entropy Coding: Enabled
  8x8 Transform: Enabled
  Pyramidal B-Frames: Default
 Analysis-
  Adaptive B-Frames: Optimal
  Adaptive Direct Mode: Automatic
  Motion Estimation: Default
  Subpixel ME & Mode Decision: 6: RD in I/P-frames
  Partition Types: Default
  Trellis: Encode only

Picture Settings-
 Anamorphic: None
 Cropping: Automatic
 Keep Aspect Ratio: Enabled
 Width: 1280

See the Roku SDK Encoding Guide for all the gory details. Given that as a household we’re used to standard definition from TiVo Series2-encoded digital cable and Netflix streaming on the Wii, the resulting encodes look really good.

Comment


procmail tip

2011-01-11 , , , Comment

I get a lot of email and sort it using procmail. Recently I’ve had to aggregate several separate mailgroups into one folder, without losing track of the original mailgroup. Procmail to the rescue.

I settled on tagging the subject like this:

:0
* ^Subject:\/.*
{ SUBJECT = $MATCH }

:0
* ^X-Orig-Subject:\/.*
{ ORIGSUB = $MATCH }

:0
* ^TO_\/(somegroup|another|third)
{
    LISTNAME = $MATCH
    GROUP=""

    :0
    * LISTNAME ?? somegroup
    { GROUP = "SG" }

    :0E
    * LISTNAME ?? another
    { GROUP = "A" }

    :0E
    * LISTNAME ?? third
    { GROUP = "T" }

    :0 fwh
    *$ ! ${GROUP+!}
    *$ ${ORIGSUB+!}
    *$ ! ORIGSUB ?? ($GROUP|$LISTNAME)
    *$ ! SUBJECT ?? (somegroup|another|third)
    | $FORMAIL -I "Subject: [$GROUP]$SUBJECT" -I "X-Orig-Subject: $SUBJECT"

    :0
    $MAILDIR/.aggregate/
}

Which works well enough but might need some explanation.

  • Lines 1-7, extracts the Subject and, if it exists my custom header. It uses procmail’s \/ operator to save the match.
  • Lines 9-12, matches the list name, again extracting the matching portion.
  • Lines 15-25, perform if/else matches against the saved name of the group.
  • Lines 27-32, checks that the group name is set, that our special header is not already set and that the original and current email Subject do not match the group or list name. If all these checks pass, it appends the group name the Subject and tacks on our custom header.
  • Lines 34-35, unconditionally writes the message to a maildir.

Comment


What's so hard about RFC-822 addresses?

2010-11-24 , , , Comment

Ran across another website with a broken shopping cart that would not accept my email address and abandoned an order tonight. It’s clear from RFC-822 (ok, at least to technical folk) that the list of characters that may not appear in the atoms composing the local portion of an email address are:

  • space
  • parenthesis “(”, “)”
  • brackets “[”, “]”
  • at sign “@”
  • semi-colon “;”
  • colon “:”
  • period “.”
  • greater than sign “>”
  • less than sign “<”
  • comma “,”
  • quotation marks

What is so hard about this list dating back to 1982 that web-form validation can not get it right?

Comment


"bugroff" license

2010-06-29 , , , Comment

I ran across an interesting Open Source license the other day, John Carter’s Bugroff License, included below. It’s among the license acceptable to the Debian project.


Richard Stallman of the Free Software Foundation devised, in addition to some marvelous software, the GNU General Public License (GPL for short). Or the CopyLeft it is sometimes called.

It is quite a revolutionary document, using the “copyright” tool to to protect your right to use free software.

Unfortunately using copyright to protect free software is a lot like using a Jackal to guard the hens.

In fact, various inconveniences relating to this have resulted in modifications such as the LGPL (Library General Public License) and more recently the NPL (Netscape Public License)

I call these matters mere inconveniences, the real damage will occur when the Jackal’s, (sorry, I mean lawyers), actually get to test the GPL in court for the first time.

Thus enter my version.

Its very simple.

Entirely consistent.

Completely unrestrictive.

Easy to apply.

The “No problem Bugroff” license is as follows…

The answer to any and every question relating to the copyright, patents, legal issues of Bugroff licensed software is….

Sure, No problem. Don’t worry, be happy. Now bugger off.

All portions of this license are important..

  • “Sure, no problem.” Gives you complete freedom. I mean it. Utterly complete. A bit of a joke really. You have complete freedom anyway.
  • “Don’t worry, be happy.” Apart from being good advice and a good song, it also says :- No matter what anyone else says or does, you still have complete freedom.
  • Now bugger off. The only way to get rid of pushy Jackals is to ignore them and not feed them. The GPL is just begging somebody to take it to court. Can’t you just see it. Exactly the same thing that happened when some twit (not Linus) registered Linux as his own personal trademark. People got upset, started a fund, and hired, off all ruddy things, a Jackal to try and defend the chicken! Who really benefits from this trademark / patent / copyright thing anyway? The lawyers. Who made it up in the first place? The lawyers.

OK so the last part of the license sounds a bit harsh, but seriously folks, if you are a :-

  • Lawyer asking these legalese questions… You should go off and learn an honest trade that will actually contribute to life instead of draining it.
  • Programmer asking these legalese questions… You have amazingly powerful tools in your hands and mind, use them to ask and answer the worthwhile questions of life, the universe and everything. Stop mucking about with such legal nonsense and get back to programming.
  • User/reader asking these question… Don’t worry. Go off and be happy. Have fun. Enjoy what has been created for you.


Comment


Yeah, we'll get right on that

2009-02-14 , , , Comments

A colleague of mine tells a story about being harangued during an outage because his system was too slow and to do something about it, where the punchline is that doing something about it would mean either increasing the speed of light or reducing the distance or both. I thought it was a joke until the other day when I myself saw one of these design requirements come through.

The designer expects a 10ms round-trip. The end-points are roughly 5000 miles away. Now if you’re not laughing already, I’ll do the back of the envelope for you- The speed of light in a vacuum is 1,079,252,848.8 km per second. The distance is approximately 8000 km. This works out to just a little under 16ms round-trip before considering that data networks are slower than light, that the network and application protocols involve several round-trips and that the application on each end must process the data.

A teammate politely pointed them in the right direction.

Comment


« Older Posts