FreeBSD ports tree visualisation

Have you ever thought of how ports tree looks like? There is a lot of categories, and in each category there is a lot of  ports, they have build dependencies, run dependencies, patch & fetch dependencies etc. Pretty simple.

But how it will look like if it was a picture? I built dependencies graph (sort of) from today ports tree, and tried to visualize it. I took only default RUN_ and LIB_ dependencies. Poor, poor browser — which died, struggling to make something of thousands ports and dozen thousands links.

Then I decided to show dependencies by category. So, in each category you can see all ports (which have at least one dependency) and ports on which they are directly depends on (even from other categories).

The color is pretty random, but size of graph nodes represents number of ports which directly required this one.

The leader is probably perl :)

You can see this all here, no plugins required, only javascript used and d3 library.

At start there is no category selected, so just click at one at top. In browser status bar you’ll see which one port mouse pointed at.

Warning! This can slow your PC!


Lg TV Remote how to

You know, if you are happy owner of LG Smart Tv, and also of some android device there is useful app in Play store.

It called LG Tv Remote, and it can be used as a Tv Remote for LG 47LM660S as well as for  LG 42LM660S.

But unfortunately, it’s DLNA era, and you can’t specify for this app where to search for TV.

They must be in same network. How handshake is happening?

You launch Lg Tv Remote on your android, and it sends broadcast message to port 9740, with info about itself.

It looks like this:

11:42:09.392715 IP 192.168.1.XXX.39391 > UDP, length 49
        0x0000:  4500 004d 0000 4000 4011 b573 c0a8 01dd  E..M..@.@..s....
        0x0010:  c0a8 01ff 99df 260c 0039 7a8f 5465 d869  ......&..9z.Te.i
        0x0020:  0100 0000 MACA DDRE SSMA CADD RESS MACA  ....(AA:BB:CC:DD
        0x0030:  MACA DDRE SSSS 0000 0008 5f6c 675f 726f  :FF:EE...._lg_ro
        0x0040:  6170 0000 0007 416e 6472 6f69 64         ap....Android

Pretty lame that MAC is sent as text, not in binary form :)

After this packet, Tv will show you few letters or numbers on screen, which you need to enter at your phone. After this, your smartphone can control your Tv just fine!


I’m not sure I’ll continue digging here, but this could be useful info for situation when you have Tv in one home network, and Android in other, and you are trying to forward ports to make them see each other.