Archive for November 2008

Privacy Matters

Nov 28, 2008 3:53:35 PM

As written on PrivacyMatters.nl:

Met de film PrivacyMatters willen we het bewustzijn vergroten over alle aspecten van privacybeperkende maatregelen, van datamining tot beveiligingscamera’s, van loyalty cards tot identiteitsdiefstal. Maar vooral willen we iedereen uitdagen de dialoog aan te gaan om op zoek te gaan naar de balans tussen privacy en veiligheid.

This short movie is available as WMV, MP4 or FLV.

 

Quick tip for irssi+screen users

Nov 23, 2008 2:59:00 AM

Place the following line in your ~/.bashrc:

alias irc='screen -rd irc || screen -U -S irc irssi'

Now if you restart your shell (log in again), and you type irc, irssi will be started in a screen. If it was still running, your previous screen session will be resumed.

 

HAR2009: it's going to happen!

Nov 19, 2008 11:58:00 AM

From Slashdot:

On their site, the people behind Hacking at Random (the successor of What the Hack, a four day outdoor hackers conference) announced a date and location: "On August 13-16, 2009 the 20th anniversary edition of the four-yearly Dutch outdoor technology-conference will take place near Vierhouten, NL".

This event promises "four days of technology, ideological debates and hands-on tinkering". Given that these events happen only once every four years, I wouldn't want to miss it for the world!

Of course I will make sure that I won't miss this event! Together with the Mononoke crew we'll team up for a week of hacking, slacking and having a blast.

 

IPv6 for the masses, meet Teredo

Nov 19, 2008 11:33:00 AM

Teredo is a tunneling protocol designed to grant IPv6 connectivity to nodes that are located behind IPv6-unaware NAT devices. It defines a way of encapsulating IPv6 packets within IPv4 UDP datagrams that can be routed through NAT devices and on the IPv4 internet.

Enabling Teredo on your device is quite simple:

  • In Mac OS X, you can use Miredo OSX port
  • In (Debian/Ubuntu) Linux, just apt-get install miredo
  • In Windows Vista, Teredo is enabled by default
  • In Windows XP, open a shell, and netsh interface ipv6 install ; netsh interface ipv6 set teredo client
  • Or read how to enable Teredo on other platforms

With Teredo enabled you can use IPv6 practically everywhere you have IPv4 connectivity, happy IPv6 hacking!

 

Python LazyDict

Nov 4, 2008 2:42:00 PM

I'm a great fan of the dot notation, instead of foo['bar'] hash notation. Also because the Django and Jinja templating engines use dot notation for all their object attribute/key lookups.

You can also use assignments and lookups on a dictionary, using the __setattr__ and __getattr__ methods:

class LazyDict(dict):
    def __getattr__(self, attr):
        if attr in self:
            return self[attr]
        else:
            raise AttributeError, "'%s' object has no attribute '%s'" \
                % (self.__class__.__name__, attr)

    def __setattr__(self, attr, value):
        if hasattr(super(LazyDict, self), attr):
            raise AttributeError, "'%s' object already has attribute '%s'" \
                % (self.__class__.__name__, attr)
        self[attr] = value

This allows you to do:

>>> from lazydict import LazyDict
>>> foo = LazyDict()
>>> foo.bar = 42
>>> foo.bar
42
>>> foo.biz = LazyDict()
>>> foo.biz.qux
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lazydict.py", line 6, in __getattr__
AttributeError: LazyDict instance has no attribute 'qux'
>>> foo.biz.qux = object()
>>> foo.biz.qux
<object object at 0xb7d26468>

Update Nov 12, 1008

Incorporated Floes' suggestions from the comment below, thanks!

 

Visitors

Locations of visitors to this page