Fixing GNU Mailman to handle mimetypes

I host a few neighborhood email lists on my Linux server running the excellent GNU Mailman list server software. Part of my setup involves stripping pictures/documents from emails and storing them in the list archives instead. This way 300 neighbors don’t get a 5 MB attachment emailed out to them: if anyone wants to view the picture/document all they have to do is click on a link in the original email and it will be fetched from the archives.

Tonight I noticed that the MIME type image/pjpeg wasn’t being properly parsed by Mailman’s Scrubber.py script. Having dealt with MIME type problems before, I suspected that the problem wasn’t with Mailman itself but the operating system’s definition of the MIME type.

Sure enough, checking the /etc/mime.types file revealed there was no image/pjpeg type defined. A little more Internet hunting brought me to this post on the Mailman list, confirming the missing mime.type info as the culprit:

On Jan 6, 2010, at 8:18 AM, Ralf Hildebrandt wrote:

> * Ralf Hildebrandt :
>> I have a list where the attachments are removed and stored on the
>> mailman server itself.
>>
>> This works like a charm, but SOME image attachments of the type:
>>
>> image/pjpeg
>>
>> are stored as “attachment.bin” instead of “attachment.jpg”
>>
>> Why?
>> Example below:
>
> adding “image/pjpeg” to /etc/mime.types fixed that:
>
> image/jpeg jpeg jpg jpe
> image/pjpeg jpeg jpg jpe

This is because Mailman uses Python’s mimetypes module to generate the file
name, and I believe that consults /etc/mime.types where available. Since
before you edit Python didn’t know anythig about image/pjpeg, it assumed it was
random binary data, hence the .bin suffix.

-Barry

From what I can find out, image/pjpeg is a type that Microsoft products choose to use instead of the image/jpeg that the rest of the world uses. I guess those crazy Redmonders are just trying to keep us on our toes, eh?

How Skype gets around firewalls


Here’s a fascinating description of how the Skype VoIP application can poke holes through firewalls – bypassing your network security. What’s even more eye-opening is that there is little that can be done to block it.

Anyone who has used the popular Internet telephony software Skype knows that it works as smoothly behind a NAT firewall as it does if the PC is connected directly to the Internet. The reason for this is that the inventors of Skype and similar software have come up with a solution.

Naturally every firewall must also let packets through into the local network – after all the user wants to view websites, read e-mails, etc. The firewall must therefore forward the relevant data packets from outside, to the workstation computer on the LAN. However it only does so, when it is convinced that a packet represents the response to an outgoing data packet. A NAT router therefore keeps tables of which internal computer has communicated with which external computer and which ports the two have used.
Continue reading

TestDisk for undeleting files

My son Travis accidentally deleted a digital movie he took with his camera. He was so disappointed, so I took up the task of trying to undelete the file. If his camera’s SD card was formatted with Linux’s ext3 filesystem his file would be impossible to retrieve.

Fortunately, all digital camera cards are formatted with the tried-and-true MS-DOS vfat filesystem, which makes undeleting files trivial. I even found a Linux tool called TestDisk that can easily retrieve deleted files. In seconds, I had fetched Travis’s deleted file.

If you are a Linux-head like me and need to bring a file back from the dead, try TestDisk!

Could Raleigh’s greenway paths be fiber paths?

Capital Area Greenway

I was thinking again (I know, I know. I should stop that bad habit) about Raleigh and the potential for a municipal Internet network (or a Google one). It occurred to me that the miles and miles of greenways Raleigh enjoys would make the perfect place to run a fiber backbone across our city. We’ve got greenways stretching into every corner of our city and more are being built and stitched-together every year. Why not make burying conduit part of every greenway construction project going forward?
Continue reading

Is Google stifling municipal broadband investment?

I was thinking more about the Google Fiber project today. It occurred to me that Google might actually be doing more to put the brakes on municipal broadband than Time Warner Cable and its cronies ever could.

As long as the possibility is out there that Google may build a network in a certain city, that city won’t be investing in its own broadband infrastructure. Google is guaranteed to disappoint the huge majority of applicants with its selection of a few cities, but nevertheless I can forsee city officials everywhere holding up Google as an excuse not to spend money on developing their own broadband. “Let’s hold off until we hear from Google,” they’ll say.

Google would do well in furthering its “fiber everywhere” cause by not keeping everyone in suspense.

Google creates fiber Internet resource site

In response to the overwhelming demand that 1,100 communities showed for the Google Fiber project, Google created the Fiber for Communities website. This site is a collection of resources that is intended to pave the way for communities to acquire fiber Internet.

I really like how Google has positioned this new effort. They know that their fiber project will only serve a handful of communities, leaving many to fend for themselves. By creating this site, Google shows it is committed to sharing its findings and supporting those communities who want to make this jump.
Continue reading

Integrating QEMU with your Linux desktop

Here are some handy tips for making QEMU work much better with your Linux desktop. You can now park QEMU on an unused workspace and not have to click in your QEMU window to use your mouse in a QEMU guest.

Integrating QEMU a bit with your desktop

Presently you have to run QEMU with a slightly lower resolution than your real desktop or run it in full-screen mode to get a decent experience out of it. With a patch I have written and a few tricks it can work a bit better.

via Integrating QEMU a bit with your desktop.

Close, but not quite

I put on my geek hat last night to see if I could get Bluetooth audio streaming to work from my mobile phone to my Ubuntu desktop. I got tantalizingly close! After adding “Enable=Source ” in the /etc/bluetooth/audio.conf file and rescanning my laptop’s available services from my phone after I made that change (among the other steps outlined in this page, suddenly the phone would connect to my laptop. It wouldn’t last long, however as soon as I began to stream music to my laptop it would disconnect. I’m not really sure why, too. It probably has something to do with PulseAudio, which I have rarely messed with and don’t completely understand.

I bet you this is a cinch to do under OS X. Sigh.

Streaming music to Ubuntu from a Bluetooth device

I’ve been intrigued by my new Samsung phone’s apparent ability to stream music to my laptop via Bluetooth. Ubuntu doesn’t appear to be able to do this out of the box and I had no idea where to search for this.

Today, I found the secret, thanks to this page:

After a few people asking me how to use the A2DP Sink with BlueZ, I’ve decided to write this mini-tutorial with a step-by-step on how to establish a A2DP stream from any device to a BlueZ-enabled host.

Before we start the hands-on, let’s see a little bit of nomenclature. In our use-case we have an stream being transmitted between two devices through a pipeline. Our pipeline is constructed of the remote host, BlueZ and PulseAudio. Each element of this pipeline has a Source (SRC) and a Sink (SNK) interface. The stream is handled between different elements by being sent from one element’s source to another element’s sink. So, the big picture of our pipeline is something like this (with the stream being represented by an arrow):

via 1, 2, 3, 4, A2DP Stream « jprvita’s weblog.

It’s still wonky out the wazoo but it looks like it can be done. I will wrestle with this more this evening.

N&O covers broadband fight

The N&O covered the municipal broadband fight today. While it does quote opponents of the moratorium like Rep. Bill Faison, it doesn’t challenge the statements of Sen. “Fiber will be obsolete” Hoyle, who obviously has little or no idea what he’s talking about. Hoyle has been comparing the debt of municipal broadband projects (cost: $28 million) to the debt used to build the Shearon Harris nuclear reactor (cost: $4 billion), a laughable comparison on its face. The numbers simply don’t compare.

The article also failed to mention that the state’s Local Government Commission has vetted all of these projects and declared that them to be on sound financial footing. And that until now Wilson hadn’t raised its pole attachment fee in over 30 years.

In spite of these flaws, the comments to the story’s web edition are running overwhelmingly in favor of municipal broadband projects. Clearly there is reason for caution before blocking them with a moratorium.