Posts about Web

Site Moved to Fatcow Hosting

September 8th, 2009

You may or may not have noticed but my my site bobpeers.com went down over the weekend.

This blog seemed to work just fine but I was getting http 500 errors on my main site. Strangely I was able to view 2 or sometimes 3 pages before the error started but once I got the 500 error every page would then not work.

I viewed my hosts error log and first saw errors regarding these lines in my .htaccess file.

php_value session.use_trans_sid 0
php_value session.use_only_cookies 1

The simply stop the session ID being added to the URL and had been in my .htaccess file for ever. After removing these lines as a test I now saw lots of these errors logged.

[Fri Sep 04 03:45:46 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/blog/index.php with wrapper
/usr/local/cpanel/cgi-sys/php5
[Fri Sep 04 03:45:09 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/blog/index.php with wrapper
/usr/local/cpanel/cgi-sys/php5
[Fri Sep 04 03:44:51 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/HTTPErrors/500error.php with wrapper
/usr/local/cpanel/cgi-sys/php5

Seems like at some point my host went from using plain PHP5 to fastcgi but I have no idea if this is the cause of the error.

After 5 attempts to get a response from my hosts support without getting a single reply (and seeing that the forums are defunct and filled with spam) I decided it was time to jump ship.

After copying my content and MySQL databases he site is now back up running on Fatcow. it’s early days but I’m very happy so far.

My old host was very cheap but as the old saying goes ‘Pay peanuts and get monkeys’.

For reference my old host was Vonetwork and my advice is to steer clear!

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

3G Internet on Danish Trains

September 1st, 2009

The main train company in Denmark is called DSB and they have recently introduced wireless internet on many of their long distance trains.

In theory this is a great idea but in practice I can’t help but think they’re missed an opportunity. Remember when no so long ago you paid for your internet by the minute and so you connected, did what you had to do, and disconnected ASAP, well it’s the same for DSB.

If you don’t buy an access card then it costs 1 DKK per minute, even with a card it costs 299 DKK per month where I’m tied to using their WIFI hotspots.

Quite why I would do this when I can sign up for mobile broadband for between 200 and 300 DKK a month and have internet anywhere I go in Denmark (and abroad), even with unlimited use using the 3 network, is beyond my understanding.

Certainly last time I was on the train about a month ago the vast majority of people seemed to have their own USB dongles to access the internet. I don’t mind paying something (even though I really think it should be free) but this price is so uncompetitive as to be a joke. But then DSB was never known for good value or forward thinking.

On a related note the trains have their own computer that acts as a proxy server and gateway to the 3G network, users connect to this using an 802.11g connection. I didn’t pay for the internet but accessing the gateway I could see that it was running Ubuntu, the http headers are shown here.

Date: Thu, 13 Aug 2009 12:41:47 GMT
Server: Apache/2.2.8 (Ubuntu)
Accept-Ranges: bytes
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

Their on train solution I’ve translated from this DSB page and included below.

The chosen solution
DSB has chosen to offer wireless internet in the train, in cooperation with TDC. The solution is based on a combination of WiFi and 3G technology.

The train itself is thus a wireless WiFi solution. WiFi technology is the same as TDC for its Hotspot solutions, which are everywhere at home, at work, in hotels and elsewhere. The WiFi solution is based on a standard called IEEE 802.11g and has currently a capacity of 54 megabits per second.

Communication between the trains antenna and TDC terrestrial base stations / masts are using the latest 3G technology, called HSDPA (High Speed Downlink Package Access). Capacity as of early 2009 is up to 5.7 Mbits / sec. and will be expanded as the 3G technology is developed, and the need for higher capacity.

User’s PC communicate “WiFi” language to the trains Access Point. While the trains antenna communicates the “HSDPA” language with base stations / masts along the track and have a cable connection to the Internet.

The Train Access Point and the antenna are connected via cables to an Internet Controller. The Internet Controller is train solutions heart, and as such has 4 cardiac chambers. These are:

* An ethernet switch with firewall
* A mini-computer (which controls the particular capacity allocation among the users logged in)
* An HSDPA modem, and
* A power supply.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Why I Don’t Use Thunderbird Anymore

July 31st, 2009

I haven’t really embraced the whole data in the ‘cloud’ idea for a few reasons. Not least because:

  • I don’t trust most companies to securely look after my data
  • Even if I do trust them how can I be sure they won’t go bust and suddenly disappear with all my data

There is one area where I’ve ditched storing data locally and that’s email. I used to use Thunderbird to sync to my Fastmail account using IMAP but there’s a few reasons why I’ve ditched Thunderbird. Some are related to Thunderbird itself and some to my email provider.

  • Thunderbird development seems to have stagnated, if you search for Thunderbird 3 on Google you find lots of questions asking what’s the release schedule with no firm answer
  • It seems very heavy on system resources and performs sluggishly on my laptop. Everyone likes new features but not at the expense of performance and memory usage.
  • It’s hard to justify running an entire application just for the purpose of reading my email
  • I’ve been with my email provider for many years and trust them to look after my data
  • The web interface provides more functionality that Thunderbird ever did. Improvements in web programming using JavaScrpt and AJAX have led to fast, functional sites
  • In line with the above, the new browsers (Firefox 3, Google Chrome, Opera and to some extent Internet Explorer 8) have a vastly improved JavaScript performance making the interface very responsive

Having said that I’m still slightly nervous about only having an online copy of anything so maybe I should use something like IMAPsize to backup my data.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Hotmail UI Design Problem

July 24th, 2009

Yesterday my girlfriend was complaining that she wasn’t receiving mail from one of her friends, both of them use Hotmail and send many mails to each other so I couldn’t see a good reason for this.

On checking the ‘Blocked Senders’ (Options > Safe and blocked senders > Blocked senders) list in her account, sure enough I found that her friends address had somehow been added to the list. I simply removed the entry and, hey presto, problem gone.

It was only then that I realised that the ‘Delete’ and ‘Junk’ buttons are right next to each other and so it’s very easy to click the wrong one.

Hotmail UI

Plus there’s no warning when you click ‘Junk’ so it’s hard to know you’ve clicked the wrong button. Ideally they should be placed further apart to make this action harder to do by mistake.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

My Take on Google Chrome OS

July 15th, 2009

It seems everyone has an opinion on the Google Chrome OS announcement (me included!). In the past week I must have read 30-40 different articles or blogs on the subject.

Opinion seems very divided on whether it’s a serious threat to Microsoft Windows, no threat, or rather ironically, a threat to Linux.

I see it like this.

  1. Google will have a very hard time getting any market share if they only look at netbooks. Of course I’d be naive to think that they don’t intend to attack the desktop at some point.
  2. It will be even harder to get any traction on the desktop. Most people still expect to download some .exe file and just install it. The familiarity and enormous installed user base of Windows is a major hurdle to overcome.
  3. If it’s locked down to work with Google Apps then am I any better off then being locked into Apple or Windows environments.
  4. As for the comments that it further splits the Linux community I can’t really see the problem. I view diversity in the Linux world as a good thing and any work done by Google on instant-on system will undoubtedly feed through to the wider Linux ecosystem.
  5. At the end of the day Google were forced into this position. They must know that who controls the desktop also controls (or heavily influences) the online world. Microsoft constantly try to make our online experience a Microsoft-only one by changing the default browser without asking and search to Live Search (or Bing). There’s no way Google can rely on a future where visitors are fed to their apps using Microsoft tools.

Despite the obstacles, from a purely technical point of view, I’m looking forward to see what they come up with. Google have masses of smart people and if they can make a full OS boot and connect to a network in, say 5 seconds, I for one will be very impressed.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

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.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

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
Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

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.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

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.
Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

jQuery Lightbox

May 5th, 2009

I’ve just tried out a lightbox plugin for jQuery, it’s called jQuery Lightbox Plugin (balupton edition) and despite the rather long title it’s very easy to use.

One of the main advantages I can see over other libraries is that you only need to create one link to the main JavaScript file, all the other links are handled by the code. This makes including the script much easier as there’s only one line to add in the document head

<script type="text/Javascript" src="/lightbox/js/jquery.lightbox.min.js"></script>

The only problem I experienced is that using the constructor crashes IE6, so using this code doesn’t work:

$(function(){$.Lightbox.construct({
          show_linkback: false
          });
});

Fortunately there’s a workaround by appending the options to the script link so it looks like this:

src="/lightbox/js/jquery.lightbox.min.js?show_linkback=false

Online RegEx Tool

I also ran across this online regular expression tester, it’s done in Flash but you can also download it to your computer if you have Abobe Air installed. It makes for a very handy tool on your desktop.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Switch to our mobile site