Apr 26, 2013

Disable Windows 7 Teredo

Have you ever found your router with several entries in its NAT table labeled as Teredo? Windows is so awesome that it tries to create them using UPnP and will create another one if the first one didn't respond. Since my router has two interfaces and the working one is the second, Windows tries to use the default (the first one) and since it isn't configured and won't respond, it can make my NAT table quite lenghty over time.

Whats Teredo?

According to Wikipedia, Teredo is a transition technology that gives full IPv6 connectivity for IPv6-capable hosts which are on the IPv4 Internet but which have no direct native connection to an IPv6 network. So if you don't plan to use IPv6, you can disable Teredo without problems.

How to avoid this behaviour?

Its quite easy, disable or unconfigure Teredo. IPv6 is needed for Windows Homegroups, so if your using them you can just redirect Teredo to localhost to avoid unnecessary garbage in your router's NAT table.

Open a command prompt (cmd) and use the following to redirect Teredo:
netsh interface>teredo
netsh interface teredo>set state type=client

If you want to disable it, just type:
netsh interface teredo>set state disabled

Also you can check the current state with:
netsh interface teredo>show state

Teredo Parameters
Type                    : client
Server Name             : 0:0:0:0:0:0:0:1
Client Refresh Interval : 30 seconds
Client Port             : unspecified
State                   : offline
Error                   : failed to resolve server name

Apr 17, 2013

Compile Zotac MCE remote in Gentoo

Update (28/08/2013): This patch has been merged with the main portage tree as of lirc version 0.9.0-r3

If you own a Zotac ZBOX or similar hardware with the included MCE remote, you can find that upon compiling lirc in Gentoo, that the remote is not fully configured and not all buttons work. In this case you have two choices: configure the remote as default an map the buttons manually or use information in this post to compile lirc with zotac remote support and enable all buttons.

I've already filled a bug in Gentoo's Bugzilla to add the source to the main portage tree in order to avoid the following steps. The files you will need right now are: lirc_ebuild.patch and zotac.patch use left-click + save target as... These files will add the needed sources to compile the zotac remote and patch the actual portage ebuild of lirc, letting you reinstall it with the new added sources.
  • lirc_ebuild.patch: This patch needs to be applied to the current app-misc/lirc portage ebuild, you can find it in /usr/portage/app-misc/lirc, in order to apply the patch run the following:
    cd /usr/portage/app-misc/lirc
    patch -p1 lirc_ebuild.patch
  • zotac.patch: This patchs needs to be copied to the files folder in app-misc/lirc:
    cp zotac.patch
  • Manifest: Once the new files are copied, we need to rebuild the manifest file:
    cd /usr/portage/app-misc/lirc
    ebuild lirc-0.9.0-r2.ebuild manifest
Then we have the patches configured, we can define lirc devices as zotac in our make.conf file:

Once finished with the patchs and configuration, we can recompile lirc. The new version of lirc will have the zotac remote compiled and all the buttons mapped. This works almost out of the box on XBMC and I'm sure it works also in similar systems.

To avoid rewriting the modified version of lirc, add it to the masked packages:
echo "app-misc/lirc >> /etc/portage/package.mask"
This way it won't be recompiled when you update the portage tree.