PostAsus GTX 480 (ENGTX480) Review

June 20, 2010 – 3:05 am
Post Image

I recently picked up an Asus GTX 480 to replace 2 SLI’d 8800GTX graphics cards, it’s a great upgrade, a major performance increase with only a slightly higher power requirement at load.

Read the rest of this entry »

PostApache Worker MPM, mod_fcgid and ISPManager issues

May 2, 2010 – 8:04 am

Tonight I changed over from Apache MPM Prefork to Worker MPM, after learning this is generally supported by ISPManager that I run, I had already changed to using mod_fcgid for PHP, but hadn’t removed mod_php as this was going to do as I run Debian and it has to be one or the other, installation was fairly simple until I was greeted by an apache error upon first run:

Starting web server: apache2Syntax error on line 6 of /etc/apache2/conf.d/phpmyadmin.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
 failed!

I quickly learned that this is because fcgi doesn’t support the php_admin_value command, so I went into phpmyadmin.conf and commented out those lines, I was then shown the same error by squirrelmail.conf, so I did the same and the server was able to start.

After this I tried PHPMyAdmin and Squirrelmail finding that there’s no handler for them and then I realised that they are running on the ssl server with ISPManager, so here is the solution (or atleast workaround) to get PHPMyAdmin and Squirrelmail to work again with ISPManager and fcgi.

First going back to /etc/apache2/conf.d/phpmyadmin.conf I edited in the initial commands to spawn fast cgi, you’ll notice I basically just copied from ISPManager’s user apache sections:


Alias /myadmin /usr/share/phpmyadmin/
<Directory /usr/share/phpmyadmin>
        FCGIWrapper /usr/share/phpmyadmin-php-bin/php .php
        FCGIWrapper /usr/share/phpmyadmin-php-bin/php .php3
        FCGIWrapper /usr/share/phpmyadmin-php-bin/php .php4
        FCGIWrapper /usr/share/phpmyadmin-php-bin/php .php5
        FCGIWrapper /usr/share/phpmyadmin-php-bin/php .phtml
	 AllowOverride All
	#RemoveHandler .php
	#AddType application/x-httpd-php .php
	#php_admin_value open_basedir /usr/share/phpmyadmin:/etc/phpmyadmin:/etc/phpMyAdmin:/tmp:.:..:./:../
	#php_admin_value upload_tmp_dir /tmp
	#php_admin_value include_path /etc/phpmyadmin:/etc/phpMyAdmin:.:..
	#php_admin_value session.save_path /tmp
	#php_admin_value safe_mode off
	DirectoryIndex index.php
	Order allow,deny
	Allow from all
</Directory>

and /etc/apache2/conf.d/squirrelmail.conf:


Alias /webmail /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
        FCGIWrapper /usr/share/squirrelmail-php-bin/php .php
        FCGIWrapper /usr/share/squirrelmail-php-bin/php .php3
        FCGIWrapper /usr/share/squirrelmail-php-bin/php .php4
        FCGIWrapper /usr/share/squirrelmail-php-bin/php .php5
        FCGIWrapper /usr/share/squirrelmail-php-bin/php .phtml
	#RemoveHandler .php  .php3 .php4 .phtml
	#AddType application/x-httpd-php .php  .php3 .php4 .phtml
	#php_admin_value open_basedir none
	#php_admin_value upload_tmp_dir /tmp
	#php_admin_value session.save_path "/tmp"
	#php_admin_value include_path .:..
	#php_admin_value safe_mode off
	DirectoryIndex index.php
	Order allow,deny
	Allow from all
</Directory>

Now to create the respective php-bin directories:
Create a file called php in a new folder /user/share/phpmyadmin-php-bin/ and in /user/share/squirrelmail-php-bin/ with the contents:

#!/usr/bin/php5-cgi

Make sure it has execute permissions for apache, perhaps changing the owner to apache's user/group would work, but apache must have execute permissions for this file or you will get a server error.

Lastly put the values for php_admin_value for PHPMyAdmin and Squirrelmail into a php.ini file in their own respective php-bin folders and you should be good to go, restart apache and they both should work fine again.

PostCache file not expiring in Bens Translator

May 1, 2010 – 8:13 am

Updated 07-05-2010: Changed the code to fix rather than remove the original check code as it seems the cache flush bypasses or doesn’t read the original check properly, so it needs the extra one.

I use Bens Translator on my site and it has been working great, however at some point I noticed that none of my old cache was expiring, so I did a bit of digging and this i what I came up with:

I know from when I had the old version 1.41 before the filemtime fix that I had an issue with getting warnings regarding filemtime, but gives no real info on what was the issue with the file, well it actually does, but it’s easily overlooked, more on that later, here’s the error it gave:

Warning: filemtime() [function.filemtime]: stat failed for _it in /my-path-here/wp-content/plugins/bens-translator/core/functions.php on line 1703

I have figured out this is because the function bentr_move_cached_file_to_stale in /core/functions.php is doing a time check on the $filename variable, as shown below:

/**
 * Checks if Cache file is older and moves to stale folder
 * @since 0.9
 */
function bentr_move_cached_file_to_stale($filename,$lang){
  bentr_debug("bentr_move_cached_file_to_stale:: Run");
  $bentr_error_expire_time = EXPIRE_TIME;
  if (file_exists($filename)){
    $filetime = filemtime($filename);
  }
  else {
    return;
  }

  $filetime_days = (time() - $filetime) / 86400;
  bentr_debug("EXPIRE_TIME::$bentr_error_expire_time::$filetime_days");
  if (EXPIRE_TIME > 0 && $filetime_days >= EXPIRE_TIME ){
	global $bentr_cache_dir;
	global $bentr_stale_dir;
	$cachedir = $bentr_cache_dir."/$lang";
	$staledir = $bentr_stale_dir."/$lang";
  $src = $cachedir . '/' . $filename;
  $dst = $staledir . '/' . $filename;
  if (!@rename($src,$dst)){
	  bentr_debug("Unable to move cached file $src to stale $dst");
  } else {
	  bentr_debug("Moving cached file $src to stale $dst");
  }
  }
  ELSE {
    $expire_time_error = EXPIRE_TIME;
    bentr_debug("Created less than $expire_time_error day(s) ago");
  }
}

However $filename is just the name of the file as it is pulling $hash at line 1115, not the full path, here is the code earlier in the file that sends the $hash variable’s contents to the function as $filename:

		//check if needs to be scheduled for a new translation
		$filetime_days = (time() - filemtime($filename)) / 86400;

		if (EXPIRE_TIME > 0 && $filetime_days >= EXPIRE_TIME ){
			bentr_debug("bentr_get_page_content :: The file $filename has been created more than " . EXPIRE_TIME . " days ago. Scheduling for a new translation");
			bentr_move_cached_file_to_stale($hash,$lang);
		}

So that instance of filemtime works fine because it is dealing with the full path, but the instance of filemtime in the bentr_move_cached_file_to_stale function fails because it is dealing with just the $hash variable which appears to be just the name of the file, but it doesn’t even have to run because it has already run in the above code before it is called, so the error message above was telling me what was wrong as it was giving me just the filename, not the full path.

The reason why I checked version 1.41 is because that is the last version of the code where the script even runs, so it seems the fix for the filemtime bug:

  if (file_exists($filename)){
    $filetime = filemtime($filename);
  }
  else {
    return;
  }

…is the reason why it won’t expire the pages, it’s ending the function early if the file doesn’t exist, but of course the file doesn’t exist because it is given just a file name, not a full path. So… this version of the function bentr_move_cached_file_to_stale should work:
Updated due to findings about the cache flush:

/**
 * Checks if Cache file is older and moves to stale folder
 * @since 0.9
 */
function bentr_move_cached_file_to_stale($filename,$lang){
  bentr_debug("bentr_move_cached_file_to_stale:: Run");
  $bentr_error_expire_time = EXPIRE_TIME;

  	global $bentr_cache_dir;
	global $bentr_stale_dir;
	$cachedir = $bentr_cache_dir."/$lang";
	$staledir = $bentr_stale_dir."/$lang";
  $src = $cachedir . '/' . $filename;
  $dst = $staledir . '/' . $filename;

  if (file_exists($src)){
    $filetime = filemtime($src);
  }
  else {
    return;
  }

  $filetime_days = (time() - $filetime) / 86400;
  bentr_debug("EXPIRE_TIME::$bentr_error_expire_time::$filetime_days");
  if (EXPIRE_TIME > 0 && $filetime_days >= EXPIRE_TIME ){

  if (!@rename($src,$dst)){
	  bentr_debug("Unable to move cached file $src to stale $dst");
  } else {
	  bentr_debug("Moving cached file $src to stale $dst");
  }
  }
  ELSE {
    $expire_time_error = EXPIRE_TIME;
    bentr_debug("Created less than $expire_time_error day(s) ago");
  }
}

I have tested it and it works fine for me every time I have run it, also I can’t figure out how the code could have worked for anyone, if $hash gave a full path which is the only way it could have worked then by the time the function is at the end the path would be doubled and would error out at the end anyway, ie /path/to/file/path/to/file rather than just /path/to/file.

Another little thing that I noticed was that the backup function doesn’t work in the admin area, because on line 5 of /core/bentr-cacheman.php there’s an incorrect path causing it to create an empty tar, the line should be:

  exec( "tar cfvz $path/benstranslatorbackup.tar.gz ".WP_CONTENT_DIR."/ben-translate-cache");

Still not sure why the translation warning bar won’t show though.

Edit: Translation warning bar wasn’t showing because my body tag has no spaces in it and functions.php line 1082 has a space after the body tag that causes it to skip it on my site, removing the space worked for me and should work for all websites due to the regular expression:

$page = preg_replace("/<body[^>]*>/i", "$replace" ,$page);

PostD-Link DIR-655 Firmware 1.34b03 Beta

April 22, 2010 – 3:08 pm
Post Image

D-Link has released the 1.34b03 Beta firmware for the DIR-655 router.

Changelog:

Disabling the SecureSpot feature, the router will not query Bsecure when the feature is disabled
Statistics will not clear under “Status>Statistics”

The first fix was available in the previous firmware 1.34b02, I have found it stops connections that people have noticed the router give to the Bsecure servers when SecureSpot is not running. The second fix addresses a bug that appeared in that firmware causing the statistics page to report ridiculously high stats.

Using this firmware is at your own risk and will most likely void your warranty if something goes wrong.

Download:
D-Link DIR-655 1.34b03 Beta Firmware (1.33 MB) 22-04-2010 or download from D-Link
MD5: 15644CB5660A27E7DC3EAF2CEA785CC7

PostD-Link DIR-655 Firmware 1.34b02 Beta and SharePort 3.0

April 15, 2010 – 9:15 pm
Post Image

Update 22-04-2010: D-Link have released the 1.34b03 firmware that fixes an issue with the statistics page for this firmware. Get it here.

D-Link has released the 1.34b02 Beta firmware for the DIR-655 router.

Changelog:

This code addresses disabling the SecureSpot feature.
The router will not query Bsecure when the feature is disabled.

Using this firmware is at your own risk and will most likely void your warranty if something goes wrong.

Download:
D-Link DIR-655 1.34b02 Beta Firmware (1.33 MB) 15-04-2010 or download from D-Link
MD5: DBE6A2D2628894B3253024111307735E

D-Link has also released SharePort version 3.0 for Mac OSX and Windows.

There doesn’t appear to be a changelog but I will add one if it appears.
Add a comment below with any results you have regarding these.

Download:
SharePort 3.0 Windows (5.47 MB) 15-04-2010 or download from D-Link
MD5: D42166F5E46E6AAA845BDC4B42EFAE32
SharePort 3.0 Mac OSX (9.01 MB) 15-04-2010 or download from D-Link
MD5: 30B1B71D1CADC69B5C5EB4D39247F38D

PostAge Of Empires 2 in VMWare

March 14, 2010 – 1:22 am
Post Image

Ever since I ran Hidden & Dangerous Deluxe in a VMWare Windows XP machine in order to get around Windows 7 and Vista incompatibilities I have wondered what other games this would work with and how to get it working a little easier.

I haven’t played Age Of Empires 2 or the Conquerors expansion in a while so I was surprised when after installing it and starting my first game I ended up with strange colour issues, eg, red grass and purple water, the game would also crash occasionally when trying out different compatibility modes. So I tried my Windows Vista laptop, but the same thing happened with it, I tried using Wine on my linux laptop but 9 times out of 10 it causes x.org to crash and other times it just ran too slowly.

I had since deleted my VMWare virtual machine, so I looked for a quicker option and came across this to quickly convert an XP mode virtual machine to a working VMware image usable in the free VMWare Player, in total it took about 15 minutes to get up and running and at no cost other than a Windows 7 license that can use XP Mode.

The game works fine out of the box, here’s an example:


Having problems? Download video: MP4 | OGG

That example was for the expansion pack but it also works fine without.

PostDowngrade D-Link DIR-655 1.3x Firmware

January 31, 2010 – 2:17 pm
Post Image

I have been debating whether or not I should put this up, however after much testing I have concluded that it is safe, it works and many other people have used this method, it goes without saying that this is still quite dangerous to do as nobody knows why D-Link doesn’t allow the downgrade to take place and they may believe it can cause bricked routers.

There is firmware floating around that allows a D-Link DIR-655 to downgrade to pre-1.3x firmware (and also to other countries’ firmware), here are the results of my testing:

First I factory reset my router, it was running the 1.33NA b01 firmware, then I firmware upgraded it to the DIR655A4_FW131RUB10 firmware file that I will make available at the end, this is a modified version of an official Russian firmware, (apparently 2 bytes is all that has been changed).

D-link DIR-655 Downgrade 1

The first step, upgrade to the RU firmware

Once this was complete I was running the modified firmware, as you can see it is still in English.

D-link DIR-655 Downgrade 2

Here I am running the modified firmware

Then I was free to upgrade/downgrade to any firmware I wished, so I decided to try the official Australian Firmware 1.21 and this worked perfectly.

D-link DIR-655 Downgrade 3

Back on the Australian firmware

Here is the chklst.txt info on the firmware to prove it downgraded successfully.

D-link DIR-655 Downgrade 4

chklst.txt of AU firmware

You can download the modified firmware below:
Modified RU DIR-655 firmware (1.49 MB) 31-01-2010

PostD-Link DIR-655 1.33NA Firmware final released

January 31, 2010 – 1:24 pm
Post Image

D-Link have been quick to release new versions of the 1.33NA firmware recently, now they have released the final 1.33NA version.

In my experience it is one of the better versions of the 1.3x firmware family, here is the changelog:

  • Fixed: Correct HNAP issue.
  • Fixed: DNS relay issue ( WAN Slowdown )
  • Added: Advanced DNS descriptions

Remember this cannot be downgraded by official means to anything pre-1.3x or other international firmwares, however you can always try the unofficial way.

You can download it here:
D-Link DIR-655 Firmware 1.33NA (1.47 MB) 31-01-2010 or download from D-Link

PostD-Link DIR-655 Firmware 1.33b01NA

January 16, 2010 – 7:52 pm
Post Image

Update 31-01-2010: There is a new firmware version 1.33NA final that can be found here.

D-Link has released a new firmware for the DIR-655, version 1.33b01NA.

It’s not known yet what has been changed though it appears to be working quite well for people.

You can get it here.

Remember that this is the North American firmware so while it is compatible with other countries’ hardware it cannot be downgraded to pre 1.3x NA firmware OR to any other country’s firmware, so once you go NA, you can’t go back.

Please visit the D-Link forums post about it here before you install the firmware as this doesn’t have support from the usual places. Feedback can be left in this forum post.

Also let us know how it goes in the comments below.

PostNginx and HTML5 Video in Firefox

January 13, 2010 – 12:54 pm
Post Image

Recently I moved my site to a new VPS run by me, the whole process went smoothly and after removing a few server specific .htaccess commands the site was up and running again.

I noticed however that the HTML5 video files that I have been using on a trial basis had stopped working with a big X in the middle of the video frame, but only in Firefox.

This indicates many possible problems with the video, some of which I could immediately dismiss as the file worked fine and other browsers such as Chrome had no issues playing it.

I remembered that it’s important to make sure the mime types are set correctly in apache, easily done with a modification of the .htaccess file in the site’s root directory, however I already had them in place, after trying different things I finally realised that nginx was serving the files directly so I did the following steps:

Open up the Nginx mime type configuration file, eg: /etc/nginx/mime.types
Paste these lines after the last video mime type, in my case it was avi:

    video/ogg                             ogm;
    video/ogg                             ogv;
    video/ogg                             ogg;

Restart nginx, it should then serve ogg video correctly to Firefox users.