Categories
Computers Gadgets Linux

Ladies in red – ALIX & iPod Nano

I recently bought an ALIX 2C0 that goes very well to my iPod Nano. ALIX is an embedded hardware platform that can run a number of operating systems – many quite simple to work with. It is made by a Swiss company. Their previous models were called WRAP and I had one of those. The first impressions of this computer is that it is significantly faster than the model it replaces. The system is powered by a 433MHz AMD Geode processor and comes with 128MB RAM and a compact flash slot for storage. If that is not enough for you, there are 500MHz/256 models available. And despite the red colour it is quite friendly on the environment, drawing less than 5W.

Ladies in redALIX 2C0

Before you rush out and get this with the idea that it could replace your current desktop – hold your horses. The connector on the left is a serial port, not a display connector. This kind of computer is used to make routers or access points, not something you would run a desktop operating system on.

I haven’t fully figured out what I am going to use it for but I have some thoughts. I will get back to that, as well as a walk-through of installing a Linux distribution on it.

Categories
Computers Linux

Unicast to broadcast

Unicast to broadcast

Sometimes it might be beneficial to redistribute unicast UDP traffic to multiple other clients. I tried to accomplish this using iptables but it doesn’t seem to be able to resend the packets to the local broadcast address.

This program provides a solution to this problem. It listens on a specified UDP port on all local addresses and resends those packets to the local broadcast address. To avoid creating a loop the incoming and outgoing ports must be different. The application can also ensure that only packets coming from a specified source are being retransmitted. While the latter doesn’t provide any real security since it is trivial to spoof the source IP address, it does provide some immunity from other applications.

The source code for the application (uc2bc) is included in the gzipped archive below. Just compile with “gcc -o uc2bc uc2bc.c”. A sample init script is also included. This would go in the /etc/init.d folder.

Thanks to Andreas who got me (re)started with socket programming on *NIX.

Attachments

Categories
Computers Linux Music

SqueezeCenter 7.0 is out!

Finally! I have been running SlimServer 6.5.4 for a long time and it was time for an upgrade but SqueezeCenter, the promised replacement for SlimServer, just never seemed to materalise. Sure, the development branch has been available for some time but for once I wanted to hold on until the real thing was out.

SqueezeCenter 7.0

And now it is here. Logitech released SqueezeCenter 7.0 yesterday. The upgrade from my previous installation of SlimServer 6.5.4 on Ubuntu 7.10 was very straightforward. I just did:

# apt-get update
# apt-get remove ––purge slimserver
# apt-get install squeezecenter

The effort is well worth it. I have just barely started using the new interface but it is much slicker and also feels a lot more responsive.

Categories
Computers Linux

Networking lost when cloning Ubuntu image

I use Microsoft Virtual Server 2005 R2 to host a couple of server. I have become accustomed to having template virtual machines so I don’t have to start from scratch for every installation. When I did that to a newly installed Ubuntu 7.10 I immediately noticed that I lost all networking.

It turns out that Ubuntu 7.10 has moved some settings for MAC address mapping for interfaces to the file /etc/udev/rules.d/70-persistent-net.rules. Edit that file and make sure that the MAC address matches the MAC address given by the virtual host.

Categories
Computers Linux Windows

Reducing clock drift in Linux 2.6 under Virtual Server

The combination of Ubuntu 7.10 (or any other 2.6 kernel based Linux distribution) and Virtual Server 2005 R2 leads to extreme clock drift, causing the clock in the guest operating system to drift several minutes per hour. This amount of drift is beyond what NTP can normaly cope with and while some people have advocated running ntpdate as a cron job every hour, such an remedy would only reduce the issue since it would drift many minutes before it would be reset again.

Microsoft has issued a knowledgebase article that describes a solution to the problem.

In short, add “clock=pit” to the kernel options in /etc/grub/menu.lst.

Categories
Computers Linux

Installing Ubuntu 7.10 on Virtual Server 2005 R2

I was trying to install Ubuntu 7.10 on Virtual Server 2005 R2 and was continuously met by an error saying “your installation CD-ROM couldn’t be mounted”.

Ubuntu CD mounting error

It seems that every time I try to install Ubuntu, I run into problems. Last time it was caused by lack of hardware support in the CPU on my VIA motherboard for some compiled-in feature. That was solved by using “alternate” build. In this case it seems to be a mismatch between my version of Virtual Server and Ubuntu. What worked this time was to use a minimal installation ISO which pulls down the rest of the installation over the network. This still doesn’t make the CD work but I have no use for the CD in this specific installation so that is fine by me.Sidenote: The same version worked flawlessly in VMWare Fusion. Lessons learned?

Categories
Computers Gadgets Linux Photography

Moblogging with WordPress and Nokia N82

OK, so despite its flaws, Nokia N82 does have its bright sides. The camera is actually quite good when there is sufficient ambient light around as can be seen in the picture of downtown Dallas below. My point of reference is my normal camera which is a Canon EOS 20D so I have been utterly disappointed by earlier phones with camera function. In low light, however, the supposedly fantastic Xenon flash on the N82 is no match to a proper flash. Ahhh, all these compromises…

Downtown Dallas

The phone also comes with Nokia’s Lifeblog feature and the camera is preconfigured to use the Flickr or Vox online services. That may be very well for most people out there but I am the kind of guy that wants to set up the system myself. So I just had to find a blogging platform that could be interfaced by the Lifeblog application in the phone.

One of the blogging platforms I tried to make work was of course WordPress and I quickly found the lifeblog4wp project and tried it out on various releases of the software but just couldn’t get it to work. Then, early January an update to lifeblog4wp was uploaded to the project’s web page on SourceForge and I tried it out on a clean installation of the latest version of WordPress. Lo and behold – it worked!

So for anyone out there who has, like me, been frustrated about the problems of moblogging from Nokia N82 using lifeblog4wp – use WordPress 2.3.2 and the version of the script uploaded on 2008-01-05. Then just follow the instructions within the lifeblog.php file.

Categories
Computers Linux

Blocking spam to postfix postmaster

RFC822 from way back in 1982 stipulates that any SMTP mail server system must accept mail for postmaster@<domain> so that someone may send email to the administrator of the email system without knowing any personal email addresses.

When setting up my postfix server I set up DNS Blacklists (DNSBL) to block email being sent from known open relays to minimise the number of spam. This was a great success and I now very rarely receive any spam to my personal address. However, a year or so back I noticed that email were coming in to the postmaster address, past any spam checks. I quickly learned that postfix by default disables any blocks for the postmaster address and when I searched the Internet it looked as if a recompilation of postfix was necessary.

Then, eventually, I found that if the value address_verify_sender is set to something else than postmaster@<domain> DNSBL could again be enabled for the postmaster alias. The value address_verify_sender is used when the mail server verifies the sender. It can be set to null but that will probably lead to problems since many mailservers will not accept it. The solution is simple – I created another alias in /etc/aliases and set the same alias to address_verify_sender in /etc/postfix/main.cf.

Now DNSBL is in place for postmaster@<domain> but it is disabled for the address used for verification. However, that address is not as easily guessed and doesn’t get any spam. Legitimate email to postmaster@<domain> still gets through so I don’t feel that this is in violation to RFC822.

Categories
Computers Linux

Migrating from Drupal 4.7.3 to WordPress 2.3.2

I used to run this blog on Drupal 4.7.3 and really hadn’t upgraded the software in more than a year. For some reason, the whole blog felt very slow and it took ages to get into the administration pages. It was clearly time for change. The question was whether I should upgrade to Drupal 5 or switch platform altogether. To be honest, I really didn’t actually use any of the more CMS-ish features of Drupal and I have a couple of other sites on WordPress so I thought long and hard about switching to WordPress.

But what about all the previous content? Sure, I hadn’t written that much but there was a little and it is always nice not having to start from scratch. Unfortunately there didn’t seem to be any recommended solution for migrating the content. Some other bloggers had posted MySQL scripts that could take the data from one format to another but it was supposedly very uncertain if it was going to work with my combination of versions. Now, I have no problem whatsoever in writing SQL scripts and do so ever so often in my job – I just felt that there had to be a simpler way. And there was.

It turns out that WordPress has a very nice RSS import feature and I had set up Drupal to provide an RSS feed. I just switched on the setting in Drupal that makes the RSS feed include all the text and not just the teaser but then I had one small issue – Drupal doesn’t let you show more than 30 posts in the RSS feed.

It was time to get dirty and jump into the PHP code. 43% down in the file /modules/system.module there is an array with the number of posts to show. Just stick “, 9999” (or some other large number) at the end of the list and go back to the setting page in Drupal and pick it. Then just save the RSS feed and import it into WordPress. Ta da!

 

Categories
Computers Linux

Making Postfix listen to a secondary port

Some ISPs that I use block outgoing SMTP traffic on port 25. As an example, my mobile operator  Telenor blocks outgoing traffic from my phone on TCP port 25 which means that I couldn’t connect my laptop through their network to send email using SSL-encrypted SMTP via my company’s SMTP server. I can understand their intention but they make it very difficult for people like myself to use external mail servers for outgoing mail. The standard solution to this is to use the submission port (TCP 587) and if there is a fully configurable firewall in front of the mail server it is normally straightforward to make the firewall send traffic on two external ports (25 & 587) to the same internal port.

However, in my case it wasn’t so easy. The firewall could route traffic to internal IP addresses but it couldn’t change the destination port.

After briefly consulting Google, many people talked about having Postfix listen to multiple ports but others warned about the risk of ending up with an open relay. Naturally I didn’t want that so I looked for an easier solution. And there is. Just use iptables to rewrite the port on incoming packets:

iptables -t nat -A PREROUTING -p tcp --dport 587 -j REDIRECT --to-ports 25

To make this stick when the server is rebooted, use iptables-save or similar and apply the rules when the network is activated. The nice thing with this setup is that Postfix is not touched and still only listens to port 25.

css.php