June 2009 Archive

FTP From Anywhere

June 30th, 2009

If you can’t use FTP due to firewall/proxy restrictions at your workplace or if you just don’t have an FTP client installed on your computer (and you can’t use the command line ;-) ) you can use net2ftp.

Essentially it’s a GPL licensed, web based FTP client so can be accessed from anywhere. I guess it goes without saying that you shouldn’t use where security is a high priority as your user name and password will be sent in plain text but it’s great for a quick photo upload to your blog for example.

Wireless Issues Resolved

June 26th, 2009

A few months back I mentioned how I had just bought a Linksys WRT610N dual band router. From day one the wireless performance was very disappointing (it briefly seems OK after installing Intel PROset Wireless software but that didn’t last long) and I’ve tried everything to fix the problem.

My main symptoms were.

  • Very low bandwidth that varied wildly. At most I could get maybe 8 Mb/s on my LAN, but this would vary right down to a few b/s. Sometimes downloads would start quite fast but suddenly throttle back to almost nothing and stay there.
  • Long delays doing DNS lookups. The status bar in Firefox would say ‘Looking up www.google.com…’ for 5 seconds before anything happened. This did not happen when connected with a wire and changing DNS settings (from OpenDNS to my ISP made no difference). I found someone with the same issue but with no resolution.
  • Strangely my connection was always very stable, it never dropped out or disconnected and the signal strength was always good or excellent.
  • Even connecting to the routers admin page would often take 20-30 seconds to load.

To name but a few things I tried to fix the problem:

  • Reinstalled the routers firmware.
  • Turned off the 2.4 MHz channel and only used 5GHz with WPA2 encryption.
  • Changed the advanced setting in the router, altered the Beacon Interval and Fragmentation Threshold as suggested on the Linksys forum.
  • Tried to trace the problem using Wireshark but I could see nothing obviously wrong.
  • Installed the Intel PROSet Wireless software to replace Windows Wireless Zero Configuration and changed the advanced adapter settings.

Not having another laptop with an N wireless card I just assumed that the router was at fault. Plus the fact that sometimes I can see up to 40 other wireless networks from my flat I also thought that interference could be a major factor (even though it wasn’t a problem with my old G router).

I gave up on the problem and just used a wired connection until last week when I noticed there was a new version of the Intel PROset to download (I was using driver 12.2.0.0 now it’s 12.4.0.0) so I installed that.

The difference is astounding to say the least. Using Filezilla to check FTP transfer speeds I’m now getting up to 81Mb/s in the same room as the router and about 60-70Mb/s in my lounge that’s 15 metres and 2 walls from the router.

On top of that the DNS issue has disappeared, so I can finally use my LAN as it was intended. I’ve often read how new firmware can fix a whole host of issues but I’ve never before experienced an improvement like this.

Custom Filenames Using Apache

June 23rd, 2009

If you look at any page on Ars Technica (like this one for example) you will see that they use an extention of ‘.ars’.

It’s very easy to set up Apache to do the same so you can use any extension you want. Even if your site is hosted elsewhere and you do not have access to the httpd.conf file you can still make the change by using the .htaccess file.

For example let’s say you want to use the extension ‘.data’ for you files, simply add this line to your .htaccess file.

AddType application/x-httpd-php .data

Now all pages called ‘.data’ will be processed by PHP. If you also use content negotiation then you will need to add ‘.data’ files you your DirectoryIndex so Apache looks for ‘.data’ files first.

It should look something like this.

DirectoryIndex index.data  index.php index.html

Moblin Updates

June 19th, 2009

I just installed the Moblin beta refresh created on 07-06-2009 and just for interest tried the update software setting. I was rather surprised that there were already 270 updates totalling 279MB (this was only 11 days after the release).

Moblin Updates

My point is that it’s clear that there’s some very heavy development going on right now even though it’s already a very stable and feature rich OS.

It also highlights one of the great features about open source software, everyone gets the opportunity to see the progress and comment on it. It may be more exciting the way Apple, for example, releases it’s next versions but I can’t help think in the long run it’s better to be open.

The Easy Way to Install a WAMP Server

June 18th, 2009

I regularly use Apache, MySQL and PHP on Linux and have configured the classic LAMP set up many times before. I’ve also set up IIS and ASP.NET on Windows many times but until recently had never tried a WAMP server (basically the same as LAMP but on Windows).

The main reason for doing so was to test Joomla on Windows so I needed a development server plus I really miss the flexibility of using Apache and the .htaccess file.

I must admit to knowing nothing about WAMP servers so just assumed that I would download and install each component separately but soon realised that there are many preconfigured servers that are very simple to install.

I picked WampServer 2 and found that installing and running the server couldn’t be any easier. Basically if you can install ITunes then you can install this. All the configuration is done for you and the server is controlled from a tray menu that allows you to add PHP modules, Apache modules, edit the http.conf file, add aliases and so on.

The only fly in the ointment for me was that IIS already uses port 80 so I had to change Apache to listen on an alternate port (port 81 in my case), but even this is a very easy job explained here.

From start to finish it probably took 10 minutes to get the server working, and another 2 minutes to set up Joomla. It’s funny that a full open source server with database and server side language is far easier to get going than IIS and ASP.NET that’s for the most part already part of Windows.

XMLHttp, UTF-8 and Foreign Characters

June 5th, 2009

Living in Denmark I always have to develop sites that support the extra characters found in Danish names (ø,å,æ plus Swedish, Norwegian and all the other European characters). For this reason I always use UTF-8 encoding to avoid and problems with displaying the characters.

Just recently I had a major headache getting Firefox and IE6 to insert the same data (sent via a XMLHttp GET request to an ASP page) into a database, the two browsers seemed to treat the same data differently so with one page Firefox would garble the characters while IE worked fine, while on another page the opposite was true.

This lead me to investigate exactly what is required to correctly send UTF-8 data to an ASP page and insert the characters into a database, fortunately I found the solution.

  1. In the Javascript code you use to send the GET request make sure you add the correct headers as shown here.
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.setRequestHeader("Content-Type", "text/html;charset=UTF-8");
  2. Encode the querystring using encodeURIComponent() so a request looks like this.
    xmlhttp.open("GET", "yourpage.asp?e="+encodeURIComponent(data));
  3. At the start of your ASP page add the following lines (the CodePage=’65001′ refers to UTF-8).
    Response.CodePage = "65001"
    Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
  4. Finally make sure you save all your pages as UTF-8 (without the Byte-order mark, or BOM) and not ANSI. For this reason I recommend you do not use Notepad as it will add the BOM if used to save UTF-8 files. Use Notepad++ or some other program where you can choose the format to save.

Microsoft Sees Sense Over Windows 7 Starter

June 2nd, 2009

It’s all over the news but I’m happy to see that Microsoft have lifted the artificial 3 application limit on Windows 7 Started Edition. As much as this would have made life easier for Linux to compete it’s also ironic that to some extent the threat from Linux has forced this decision.

If there was no completion in the OS market do you really think that Microsoft would have done the same?

On the other hand they are still severely limiting the capability of the Starter Edition, to quote from the Windows Blog it DOES NOT include the following

  • Aero Glass, meaning you can only use the “Windows Basic” or other opaque themes. It also means you do not get Taskbar Previews or Aero Peek.
  • Personalization features for changing desktop backgrounds, window colors, or sound schemes.
  • The ability to switch between users without having to log off.
  • Multi-monitor support.
  • DVD playback.
  • Windows Media Center for watching recorded TV or other media.
  • Remote Media Streaming for streaming your music, videos, and recorded TV from your home computer.
  • Domain support for business customers.
  • XP Mode for those that want the ability to run older Windows XP programs on Windows 7.

I’m pretty sure that with Googles Android and Intels Moblin under heavy development, with some big players behind them, there’s still room for competition in the netbook OS market.