Two takes on programmers:
The Evolution of a Haskell Programmer
I found these on the Haskell Humor page.
Two takes on programmers:
The Evolution of a Haskell Programmer
I found these on the Haskell Humor page.
There are a lot of virtual machine interpreters out there. Java was the first well-known one, but VMs are also used for .NET, OCaml, Python, and the new Parrotcode VM will likely be used for Perl 6.
I started a discussion on the OCaml mailing list about some other bytecodes OCaml could target, with very interesting results. OCaml interpreters or compilers already exist for both Java and .NET.
There’s more to this than meets the eye, though. There are many different languages supported by .NET even though the .NET CLR does not lend itself to many of them very well. There are also a number of languages supported by the Java JVM, and Parrot is looking to support a good number, too. So it appears that no VM is going to promise the mythical language convergence .NET was talking about. Rather, we’re going to have too many choices. I wish we could standardize on a single VM and go with that.
Update 9/23/2004: There is now a page for this book on my homepage, Complete.Org.
My latest book, Foundations of Python Network Programming, is now available for purchase (Amazon, bn, AllDirect, buy.com). This book is designed to show you everything from fundamentals of networking and low-level protocol design to work with higher-level protocols such as IMAP, HTTP, and FTP. For more information, please see the letter to the reader from the book’s back cover.
This is not a basic reference like Python comes with. Rather, it’s a hands-on guide. There are over 6600 lines of example code and the text strives to show you the big picture. For instance, there are several different ways of getting directory information from an FTP server, and some are not documented for use this way. The chapter on FTP explains them and provides example code to illustrate. There’s also an Apress page with details.
Below is the book’s Table of Contents along with a partial list of the examples you’ll find in each chapter:
Continue reading Foundations of Python Network Programming
I’ve long been of the opinion that all mail readers suck. Some of them really suck. That’s why I wrote OfflineIMAP, after all.
Today I embarked on my periodic survey of mail readers to see what had changed. Things are encouraging but still not quite good enough. I have IMAP mail on two servers and I read it from four clients. I want to see the same mail on each client, and be able to work offline if I need to, and sync my changes back up later. I also maintain “Saved” folders for messages I want to archive indefinately. I want to see which folders have new messages and which ones have old messages. Finally, I want to be able to navigate entirely with a keyboard for all common functions.
Let’s take a look at how they all stack up.
First, there’s mutt with OfflineIMAP. Mutt by itself is not even worth mentioning; its IMAP support is so slow and buggy that it doesn’t even begin to make the cut. With OfflineIMAP, it’s actually pretty nice. I can easily create a macro to move messages to my Saved folder. I can also create macros to manage the two different e-mail account identities, using the correct one for replies automatically. So far so good. What mutt stinks at is the folder list. It just doesn’t have a good one at all. Also, since OfflineIMAP must be used, the integration is just not as clean as it could be.
Next, there’s the new KMail 3.3. This program has improved vastly recently. What was once a graphical client with more bugs than an entomologist’s lab is now a mostly reliable mail program. It integrates into the KDE or Gnome applet well for new mail notifications. It does everything I want with IMAP (with only one bug relating to non-selectable folders, which I can work around.) However, despite the khotkeys system, it is not possible to reliably script it to move a message to a saved folder or redirect it to my special storage address. Argh.
Then, there’s Mozilla Thunderbird. Another good contender, supports offline reading and all of that. Has nice junk mail features built in too. But its IMAP support is SLOW. When you delete a message, it goes out to the server (unlike KMail, which can cache this action). how do you like deleting 20 messages, having to wait 2 seconds after each press of Delete? Also, it suffers from the same scripting problem as KMail.
So it looks like I’m sticking with mutt+OfflineIMAP for now, but definately keeping a close watch over kmail.
Paul Graham has written a tremendously insightful article analyzing great hackers. It is well worth a read whether you’re a hacker or not. Here are a few quotes:
Note for the English-impaired: hacker does not mean someone that is attempting to breach security in this context.
OK, so it’s a few years old, but I’d never heard of it before. Check out this amusing little story.
Somehow I missed this story, and it doesn’t seem to have gotten lots of press, but hey. I’ll give Microsoft credit for doing something right.
Although it is only a very small thing, very late.
Found this today: Tapestry – Your Favourite Comics by RSS
Tapestry is a series of RSS feeds for online comics. They help you keep up to date from within your favourite news aggregator, especially if you happen to miss a few days. Works great with the liferea reader. (Tapestry folks — you should add that to your list.)
OK, so I was looking for some new weblog software for this site. I had been using Drupal, but it was just not working well. It’s XML-RPC API was limited, it was slow, and it took a lot of effort to maintain a blog, which was poorly suited as the site’s primary purpose (as an example: there was no way to make it say anything other than “jgoerzen’s blog” for the title).
So, I went hunting for other blog software. Turns out a lot of people have been doing this lately, for completely unrelated reasons. Anyway, there’s a great comparison chart. He finally made a personal choice, but is continuing to maintin the list.
Slashdot also ran an article on MovableType recently, in which many people are looking for new options.
A lot of people have asked about IPv6 in Debian. There have been some instructions floating around, but all of them I’ve seen are overly complex. Here’s how to set up your own 6to4 tunnel in about 5 minutes (assuming your kernel is IPV6-ready), without the need of freenet6 or any other tunnel broker. You need only a real IP address (static is best) and a basic understanding of IPv6 to proceed. This article will configure your host or your router.
These instructions set you up with 6to4, which requires no outside tunnel broker. However, there are not many 6to4 routers out there. If you are connecting to other non-6to4 sites, chances are god that performance will not be good. This is not a flaw in IPv6 itself. I suggest setting up 6to4 first, since it is fairly easy; once you have it working, then move on to others if you like.
First, you need to obtain an IPV6-ready kernel. I strongly recommend 2.6.1 or above if possible. Check the IPv6 kernel system check page to make sure your kernel is IPV6-ready, and for info on compiling a new kernel if not. In addition to basic IPv6, I also recommend that you compile in IPv6 netfilter support.
Next, you need to add a tunnel to your /etc/network/interfaces file. First, you will need to know your public IP address in IPv4. It will look something like 10.20.30.40. Next, you need to get that in IPv6 notation. Here’s a quick shell script to do that:
#!/bin/sh
printf “2002:%x%02x:%x%02x::\n” `echo $1 | sed ‘s/\./ /g’`
Just run that with your IP address as an argument. In this example, for 10.20.30.40, the result is 2002:a14:1e28::. This is your prefix. All your IP addresses will begin with that. Please see the link above for more on IPv6 addressing if you don’t understand the “::” part of this.
Now, you have all the information to create your own IPv6 tunnel. Edit /etc/network/interfaces and add these lines:
iface sit1 inet6 v4tunnel
address 2002:a14:1e28::2
netmask 64
endpoint any
local 10.20.30.40
up ip -6 route add 2000::/3 via ::192.88.99.1 dev sit1
down ip -6 route flush dev sit1
up /etc/network/ipv6rules.sh
ttl 64
The address line contains the IPv6 address you calculated above, followed by a “2”. The local line contains your local IP address. Now bring up the link with ifup sit1. You should now be able to run ping6 www.ipv6.org and get results back. If you don’t have ping6 on your system, install the iputils-ping package. If this works, add sit1 to the auto line in /etc/network/interfaces.
The /etc/network/ipv6rules.sh is a little script that closes off some ports to your system. If you don’t want to use it, delete that “up” line. Here’s one version that I recommend:
#!/bin/bash
ip6tables -F
ip6tables -I INPUT -i sit+ -p tcp –syn -j DROP
ip6tables -I FORWARD -i sit+ -p tcp –syn -j DROP
ip6tables -I INPUT -i sit+ -p udp \! –dport 32768:60999 -j DROP
ip6tables -I FORWARD -i sit+ -p udp \! –dport 32768:60999 -j DROP
ip6tables -I INPUT -i sit+ -p tcp –dport 22 -j ACCEPT
ip6tables -I FORWARD -i sit+ -p tcp –dport 22 -j ACCEPT
# Uncomment the following lines if this is a router
#echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
#echo 0 > /proc/sys/net/ipv6/conf/all/accept_ra
#echo 0 > /proc/sys/net/ipv6/conf/all/accept_redirects
#echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
#echo 0 > /proc/sys/net/ipv6/conf/all/router_solicitations
This script will close off incoming TCP connections, and UDP connections to low UDP ports, except for TCP to port 22 (ssh).
If you are setting up a host, you’re done. If this is a router, read on…
Router Configuration
If you’re setting up a router, there are a couple more quick steps. First, you need to configure your ethernet interface for ipv6. Insert a clause like this in /etc/network/interfaces:
iface eth0 inet6 static
address 2002:a14:1e28:1::1
netmask 64
Of course, replace the first first part of “address” with your real IPv6 address. (Note the added “:1::1” after the address.) Now run ifdown eth0; ifup eth0 to make the changes take effect.
Next, apt-get install radvd and edit /etc/radvd.conf. It should end up looking like this:
interface eth0
{
AdvLinkMTU 1480;
AdvSendAdvert on;
prefix 2002:a14:1e28:1::1/64
{
};
};
Mind the semicolons (and lack thereof); radvd is picky. Now /etc/init.d/radvd restart and use ps to make sure it’s running. radvd is similar to dhcp for IPv6, but a lot easier.
At this point, your IPv6 network is ready. All clients on your network that are IPv6 capable should automatically assign themselves an IPv6 address and be ready to go. For Debian clients, all you need is IPv6 support in your kernel; you do not need to do anything on them at all.
Revisions