11 January 2010

Enabling extensions and add-ons in Firefox

If you are using a version of Firefox that hasn't yet been released to the public (e.g. a beta or RC version) you may find that some of your add-ons have been disabled.

In my experience, I've found that most add-ons and extensions work fine even if they are not yet officially compatible. To enable these add-ons you need to add a new boolean preference setting. To do this...

1) Go to about:config by typing this into your address bar and pressing Enter
2) Right click in the body of the page and go to New > Boolean
3) The preference name depends on the version of Firefox you are using, but will always have the form extensions.checkCompatibility.[verison]. For example...

Pre: extensions.checkCompatibility.3.6p
Alpha: extensions.checkCompatibility.3.6a
Beta: extensions.checkCompatibility.3.6b
RC: extensions.checkCompatibility.3.6

4) Set the value of the preference to false
5) Restart Firefox

You should hopefully now be able to use all your add-ons and extensions. If this doesn't work, it's probably because you've chosen the wrong name for the preference. Try resetting the preference by right-clicking on it in about:config and then try a different name.

Needless to say, all this is done at your own risk!

28 January 2008

Unsigned drivers in 64 bit Vista (x64)

In 64 bit versions of Windows Vista, you cannot install drivers that are not "signed". This means that if you're trying to install some strange hardware, or some customer drivers, you'll run into problems.

Fortunately you can disable this restriction by running the following from the command prompt...

bcdedit /set loadoptions DDISABLE_INTEGRITY_CHECKS

More details can be found here.

23 January 2008

Slow login system (ASP.Net)

A slower login system is much harder to break into with a brute force attack than a fast one.

If your login system takes 0.1 seconds to say whether the credentials were correct, a hacker could try 36,000 username and password combinations per hour per HTTP connection. If your login system took 5 seconds to return a response, only 720 combinations could be tried per hour per HTTP connection.

In ASP.Net, the following function will make your script pause for 5 seconds...

Threading.Thread.Sleep(5000)

If you're not happy with slowing down your login system for legitimate users, you could modify your script to only pause if the password was incorrect. Just don't tell anyone that's what you're doing!

22 January 2008

<thead> and page breaks

I learned today that printing a table with and tags will cause the header row to be repeated after a page break.

IE7 doesn't do this by default, but with a single CSS definition it can be made to do so...

thead { display: table-header-group; }

16 January 2008

IE caching AJAX requests

I've just discovered the IE caches any AJAX requests made using GET. This means that if you made an AJAX call to the same URL twice, the second request won't get sent, and the response from the first call will be returned instead.

There are two options...

  • Use POST
  • Append a random number to the query string

14 January 2008

MySQL: Sort ascending with blanks at end

It makes sense to have blanks at the start of an A-Z query, as a shorter length string should always appear before a longer length string starting with the same letters. However, sometimes it's convenient to clump any completely black records at the end.

I couldn't think of a perfect way of doing this, but here's a fairly nice solution...

ORDER BY IF(LENGTH(name)>0, CONCAT('1',name), '2') ASC

The IF() function is used to prepend a '1' to any non-zero length string, and '2' to any zero length string. For the latter, we already know that the string is empty so there's no need to use CONCAT().

10 January 2008

Ping a specific port

You cannot ping a specific port, it just doesn't make sense.

However, you can try to establish a Telnet connection to the port. In Windows, go to the command prompt (Start > Run > "command") and type...

telnet example.com 80

Easy when you know how.

If you're using Vista, you'll need to install Telnet first..

Telnet in Vista

Vista does not come with the Telnet client installed by default.

Go to Control Panel and then find the Turn Windows features on or off option. Scroll down to Telnet Client and tick the box. Once the installation is complete, you should be able to use the telnet command from the command prompt.