Archive for the ‘Random’ Category

How to Unlock Garmin maps

Sunday, July 4th, 2010

For information only, How to Unlock Garmin maps.

First get your hands on the desired Garmin City Navigator Downloadable Update for your country/city (MapSource A).
In the compressed file should be the folders IMG, support and Windows plus a readme.txt.

You will need a version of Garmin MapSource 6.13.1 or older which does NOT support Unlocking via the internet (MapSource B).
This can be found in older version of the downloaded map update files (perhaps a 2007/2008 version).

Run the CN.msi installation file to install the old version of MapSource (B).

Run MapSource (B) and the UnlockWizard.

Now get your hands on Garmin Unlock Generator V1.5,
Enter your 10 digit Unit ID, and select map product , enter the FID (MapID) of the newest Downloadable Update (the one you want to Unlock).
Click generate, copy the 25 digit map unlock code and paste this into the UnlockWizard.

At this stage you will have the older version of MapSource (B) with some old map.

Run the CNMENT2010Update_ENU.msi file in IMG folder (MapSource A).

Run MapSource (A). That’s it. The map should now be Unlocked.

8 Suits – eight suited playing cards

Saturday, June 12th, 2010

8 Suits, as you guessed is a deck of playing cards with an additional 4 suits, the clover, tear, crescent and star for a total of 104 cards plus a number of jokers.

Priced at $12 USD per deck plus $5 per postage ($13 per postage internationally), it is a little steeper than The Fat Pack, at roughly $16 USD including international postage. Unfortunately, I discovered the former after ordering the 8 Suits.

8 Suits - 8 suited playing cards
8 Suits - new suits clover, tear, crescent and star
8 Suits - height of deck

The following show how 8 suits affect the probability of standard poker hands;

Poker Hand         No of Combinations        Probability
--------------------------------------------------------
Royal Flush                         8       0.0000000870
Straight Flush                     72       0.0000007829
Five of a Kind                    728       0.0000079163
Flush                          10,216       0.0001110887
Four of a kind                 87,360       0.0009499522
Full House                    244,608       0.0026598662
Straight                      327,600       0.0035623208
Three of a Kind             3,075,072       0.0334383181
Two Pair                    5,381,376       0.0585170567
Pair                       41,000,960       0.4458442418
No Pair                    41,834,520       0.4549083692

Total                      91,962,520       1.000000000

To view the probabilities for any other numbers of suits.

Poker hands probability calculator for any number of suits and ranks (denominations)

Saturday, June 12th, 2010

After purchasing a 5 suited deck of cards and an 8 suited deck of cards, I decided to work out how the numbers of suits affect the probabilities of each poker hand.

Further, the following can calculate combinations and probabilities for any number of suits and any number of ranks (number of denominations).

You will notice;

  • at 5 suits a Flush overtakes a Full House,
  • at 6 suits a Flush overtakes a Four of a Kind, and
  • at 13 suits a Flush overtakes a Five of a Kind.

If you don’t believe the numbers, you are more than welcome to add them up and email me.

(thanks to CodeCogs for there LaTeX Engine)

Complete list of Foundation Fieldbus devices and search tool

Thursday, June 3rd, 2010

Currently it is quite difficult to search for a particular device by either device model, Vendor ID or Model ID on the Fieldbus Foundation website.

The following provides a means to easily search this data, via the offline tool ‘Foundation Fieldbus device search’.

The tool enables searching via Vendor, Model, Type and even Vendor and Model IDs.
Foundation Fieldbus Device Search tool

Download the Foundation Fieldbus Device Search tool.

Download the raw text file output.

Cheap SSD from Compact Flash card for older laptops

Thursday, April 22nd, 2010

Okay, so this post is about 3 years too late, but I thought I would post it anyway.

I have a number of old laptops which I use as digital photo frames, we are talking original Pentiums II here. The problem is given the age of these, the hard drives are either extremely noisy and about to die, or already conked out. So what is a cheap reliable solution for these aged drives, a Compact Flash memory card and an IDE adapter.

I advise buying the dual models as it gives you four alternate ways to play with (two dual slots, and single jumper for selecting either master or slave). Two identical Toshiba laptops, would only accept these devices in a specific different configuration, perhaps it was the different adapter models though. A 4GB Compact Flash card can be purchased for $10, with the adapter around $2.

Below are two versions of the IDE to Compact Flash adapter;
IDE to Compact Flash adapter
IDE to Compact Flash adapter

And a cheapy Compact Flash card;
IDE to Compact Flash adapter

Okay, so the speed of these aren’t too great, but for what I am using them for they are perfect.

RSS feed aggregator/combiner in PHP with Magpie RSS (v2)

Wednesday, March 3rd, 2010

I have recently upgraded the code to combine multiple RSS feeds, for the original version see this post.

To install, extract the following zip file to a directory where you want your combined feeds to be displayed, I use thydzik.com/combinedfeed as thydizk.com/feed is already used by WordPress.

Edit index.php for your site, and make sure the temp directory has write permissions (mod 755). That should be it. Enjoy.

thydzik RSS feed aggregator v2.zip

Thanks to Magpie RSS and Feedcreator.

<?php
	$TMP_ROOT = "temp/"; //a atempory folder for storing the cached feeds, need to have write access (mod755)
	$DOMAIN_NAME = "http://thydzik.com/";
	$SITE_TITLE = "Travis Hydzik's blog feeds";
	$SITE_DESRIPTION = "A collection of Travis Hydzik's blog feeds";
	$SITE_AUTHOR = "Travis Hydzik";

	$FEEDS_ARRAY  = array( //the collection of urls linking to individual feeds
		"http://hydzik.com/feed/",
		"http://sonyaandtravis.com/feed",
		"http://thydzik.com/feed/"
	);

	$MAX_ITEMS = 10;
	$SHOW_FULL_FEED = FALSE;

	//stop editing from here onwards

	define('MAGPIE_DIR', '');
	define('MAGPIE_CACHE_DIR', $TMP_ROOT);

	//include magpie rss http://magpierss.sourceforge.net/
	@require_once(MAGPIE_DIR.'rss_fetch.inc');

	//include universal feed creator http://sourceforge.net/projects/feedcreator/
	@include(MAGPIE_DIR.'feedcreator.class.php');

	//create the basic rss feed
	$rss = new UniversalFeedCreator();
	$rss->useCached();
	$rss->title = $SITE_TITLE;
	$rss->description = $SITE_DESRIPTION;
	$rss->link = $DOMAIN_NAME;
	$rss->syndicationURL = curPageURL();

	//get all items is all feeds
	$total_temp = 0; //temp total number of posts in all rss feeds
	foreach ($FEEDS_ARRAY as $single_url) {
		$array_temp[$single_url]['page_title'] = url_grab_title($single_url); //grab the page title

		$rss_temp = fetch_rss($single_url);
		$items = array_slice($rss_temp->items, 0, $MAX_ITEMS);
		$array_temp[$single_url]['rss_data'] = $items;
		$total_temp += count($items);

		$array_temp[$single_url]['rss_pointer'] = 0;

		preg_match('@^(?:http://)?([^/]+)@i', $single_url, $matches);
		$array_temp[$single_url]['site_url'] = $matches[0];
	}

	while ($total_temp <> 0 && $MAX_ITEMS > 0){// loop while there are remaining posts to process
		$date_timestamp_temp = 0; //initialise to 0
		foreach ($FEEDS_ARRAY as $single_url) {
			$this_date_timestamp = $array_temp[$single_url]['rss_data'][$array_temp[$single_url]['rss_pointer']]['date_timestamp']; //get the date stamp of this post
			if ($this_date_timestamp > $date_timestamp_temp) { //if this date stamp is the newest, save where it came from
				$date_timestamp_temp = $this_date_timestamp; //update with this date stamp
				$temp_url = $single_url; //save the url feed
				$pointer_temp = $array_temp[$single_url]['rss_pointer']; //save the item number
			}
		}

		$total_temp --; //decrement total remaining posts to process
		$MAX_ITEMS --; //decrement number of posts to display
		$array_temp[$temp_url]['rss_pointer'] ++; //increment post index of used post rss

		//get the saved item
		$item = $array_temp[$temp_url]['rss_data'][$pointer_temp];

		//create the new item
		$item_new = new FeedItem();

		//add all the copied basics
		$item_new->title = $item['title'];
		$item_new->link = $item['link'];
		$item_new->date = $item['pubdate'];
		$item_new->author = $item['author'];
		$item_new->source = $temp_url;

		//to show full feed or blurb
		if ($SHOW_FULL_FEED) {
			$item_new->description = $item['content']['encoded'].'<p>Copyright &copy; <a href="'.$array_temp[$temp_url]['site_url'].'">'.$array_temp[$temp_url]['page_title'].'</a>. All Rights Reserved.</p>';
		} else {
			$item_new->description = $item['description']       .'<p>Copyright &copy; <a href="'.$array_temp[$temp_url]['site_url'].'">'.$array_temp[$temp_url]['page_title'].'</a>. All Rights Reserved.</p>';
		}

		$rss->addItem($item_new);
	}

	// a quick function the grab a pages title
	function url_grab_title($rss_url) {
  		$contents = file_get_contents($rss_url, TRUE, NULL, 0, 3072);
  		$contents = preg_replace("/(\n|\r)/", '', $contents);
		preg_match('/<title>(.*?)<\/title>/i', $contents, $matches);
		return $matches[1];
	}

	//get page url (for syndication), source http://www.webcheatsheet.com/PHP/get_current_page_url.php
	function curPageURL() {
		$pageURL = 'http';
		if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
		$pageURL .= "://";
		if ($_SERVER["SERVER_PORT"] != "80") {
			$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
		} else {
			$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
		}
		return $pageURL;
	}

	// get your news items from other feed and display back
	$rss->saveFeed("RSS2.0", $TMP_ROOT."feed.xml");
?>

Heat problems with iStar BPN-350SAS 3×5.25″ to 5×3.5″ SATA Trayless Backplane

Sunday, January 24th, 2010

Recently I posted about the use of an iStar BPN-350SAS in my RAID 6 array, well due to Australia’s extreme summer temperatures I have had a number of drives in the enclosure fail due to overheating.

Whilst I like the design and build of the BPN-350SAS there are some extreme flaws in the cooling design must likely due to implementation costs or interference with the units cosmetics.

Firstly, the 2x 60mm fans do not provide enough airflow; secondly, there are simply not enough paths for the air to flow. If you look inside the unit you will see 5 slits behind the PCB, and that is all there is for hot air exhaust. If you look at the front bezels, beneath the locking key hole plastic are 3 air vents, and this is all there is for the cool air intake.

Now, my solution has improved all off the above by first, removing the 60mm fans and installing 2x 80mm fans, these are connected via a molex connector. You can observe that 2x 80cm fans protrude 20mm on one side so it was necessary to install the protruding fan once the unit was installed into the case. Secondly, additional air holes on the back of the unit and on the top and under side of the unit to allow more air to circulate. I also removed the 5 springs that popped the drives out, but this was more to improve the backplane’s connection with the drives.

iStar BPN-350SAS modified - top air intake holes

iStar BPN-350SAS modified - top air intake holes and 80mm fan

iStar BPN-350SAS modified - botton air intake holes and 80mm fan

iStar BPN-350SAS modified - installation in case with 2 80mm fans

Dell PowerEdge SC430 with 8x WesternDigital 1TB drives in RAID-6

Friday, September 25th, 2009

Sometimes a man just wants to show of; this is one of those times.

My latest project was upgrading my full 2TB server (Adaptec 2410SA with 4x Seagate 750gb drives in RAID-5) to a 6TB server (Adaptec 3805 with 8x Western Digital 1TB drives in RAID-6).

Dell SC430 with installed iStar BPN-350SAS

Obviously, the Dell PowerEdge SC430 wasn’t designed for 9 drives (an extra for the OS) so it was quite challenging fitting it all on. It was made significantly easier by purchasing an iStar BPN-350SAS which allows for five 3.5″ drives to be squeezed into three 5.25″ bays. Plus it is tray-less, and looks very sleek. There was a significant problem in that the SC430 only supported two 5.12″ bays, after quite a bit of hacking the case up, I then realised that the motherboard was preventing the BPN-350SAS to fit in horizontally, with extreme luck and millimetre clearance, it did manage to fit in vertically, but with the extension of the P4 connector and two capacitors that were in the way. Refer to the following pictures.

Dell SC430 motherboard original

Dell SC430 motherboard modified

Dell SC430 showing motherboard clearance of iStar BPN-350SAS

The SC430 now had the two standard bottom hard disk drive cages and the five from the BPN-350SAS which meant I was still two drive spaces short. I removed the drive cage from a Dell Optiplex GX270, which I managed to luckily remove easily with a long stemmed drill to remove the rivets. I removed the SC430′s card fan, and riveted the GX270′s cage in place. This allowed me to still use rails for easy removal of drives. The SC430′s card fan was relocated as an exhaust fan to the back, mainly to stop BIOS from pausing on fan fault during boot-up.

Dell SC430 with new Optiplex GX270 HDD cage

Minor problems were; cable protrusion and the side panel not closing. This was fixed by using SATA power cables which had clip on connectors forming a natural right-angled connection, and also by carefully whittling the SATA cable connections so a tighter angle could be formed.

Dell SC430 cable management of 9 drives