Howto listen mp3 in the bathroom ?

I was looking for a simple way to listen some good music while I’m not in my living room (hum, I’m mean in the bathroom). There is a lot of small MP3 players right now, the only issue is that most of them cost a lot of money if you want to put a great amount of mp3 on..

Another way, perhaps look at wifi powered mp3 player like the one made by Roku. But you know, this cost a little money (around 200$), just a bit too much for the bathroom ;)

So, I decided to look at FM transmitters, but I read on most websites that they don’t perform really well. Ok, let’s go for a DIY way, after a little search on eBay, I found a small (really small) FM transmitter pair for 15$ from Sure Electronics.

http://jkx.larsen-b.com/photos/Electronic/DSC02440.sized.jpg

Hum, let’s give it a try:

  • plug a 12v PSU
  • solder a long (70cm) wire antenna
  • solder a stereo jack (and plug it to the soundcard output)
http://jkx.larsen-b.com/photos/Electronic/DSC02444.sized.jpg

And this little stuff, is really working great !! I haven’t test the range right now, I have a clear listen all around my home.

/Enjoy Neighborhood

Howto to spam-protect your python-based blog with bayesian filter.

As severall people, I run into issue with some spammer using my comment system to spam, and post backlinks. (Even using some funny stuffs)

I ‘m already using a good email spam filter: SpamBayes, so I decided to test bayesian filtering for the spam on this blog too.

I decided to give Reverend a try:

from reverend.thomas import Bayes

SPAM_DB='spam.bayes'
guesser = Bayes()

# load the spam DB
try:
    guesser.load(SPAM_DB)
except IOError:
    print "Creating a new spam filter database"
    guesser.save(SPAM_DB)

def train_spam(text):
    guesser.train('spam',text)
    guesser.save(SPAM_DB)

def train_ham(text):
    guesser.train('ham',text)
    guesser.save(SPAM_DB)

# try to guess the spam / ham ratio of a text
def guess(text):
    spam = 0
    ham = 0
    value = guesser.guess(text)
    for o in value:
        if o[0] == 'ham': ham = o[1]
        if o[0] == 'spam': spam = o[1]
    return (ham,spam)

Small, and really simple module no ? The next step, simply add a ‘spam’ and ‘ham’ attributes on your comment post. And add two methods to train the comment as a spam or a ham.. And of course, only display comments which have a good ratio ( >1) ham/spam. This took me about 1 hour to implement…

After a week, of train, this is working very fine, not a single false positive, and it filter every spam since the first trains. As I get around 20 spams post per day, this is quite a good news ;)

Enjoy Bayesian ?

Howto transform a NetGear WG311 into a Atheros Mini-PCI wireless card

I was looking for a atheros mini-pci for a while. I want to remove the broadcom from my laptop. You can find some mini-pci wireless card in special shop, but they’re a little pricey.

A week ago, a friend give me a WG311 (FS version I think). After 1 min, I decide to remove the metal stuff of this PCI card. And, I discover this:

http://jkx.larsen-b.com/photos/Electronic/DSC02437.sized.jpg

This looks like a Atheros mini-pci no ? Ok, it’s time to unsolder no ?

http://jkx.larsen-b.com/photos/Electronic/DSC02438.sized.jpg

Take 2 seconds, a good iron and that’s it. You have now, a nice Atheros mini-pci.

http://jkx.larsen-b.com/photos/Electronic/DSC02439.sized.jpg

The only issue: This card has only one antenna connector, but this don’t really matter in fact, I think.

Bye ..