Archive for July, 2009

Become a mobile coder–buy my mobile solar setup!

July 30th, 2009

Since I don’t have a need for any of my solar gear anymore I’ve decided to put it up on Ebay.  So, get on it if you are interested in a 130 watt solar panel, 35 amp charge controller and 1500 watt power inverter!

Combine all that with mobile internet, and you never have to leave the beach.

Getting a weighted random value in PHP

July 15th, 2009

I am mainly posting this code here because I keep misplacing it on my own hard drive.  And that usually leads to it being forgotten and lost…  if there is anything confusing here, don’t hesitate to ask in the comments–I wrote this a bit fast.

What is a weighted random value?  Take a look at this (poor) example…

You have an array of shades of grey in hex:

$colors = array('000','1f1f1f','3f3f3f','666','999','ccc','eaeaea','f0f0f0');

You have a table of data and you want to give each row a random background color that is one of those shades.

Simple, right?  echo $colors[array_rand($colors)];

But, what if you want to return the colors around #999 more often than the rest?  » Read more: Getting a weighted random value in PHP

It’s been a busy week!

July 15th, 2009

For all of those curious as to why forum replies have been a little sparse lately, there is a reason.  I’m in the process of moving to a new house right now and I am (finally!) just about done.

Moving is not fun.

Securing WordPress: Plugging the WordPress version leaks

July 12th, 2009

WordPress is probably the most commonly used blogging platform around.  Mostly because it’s free.  Being #1 brings a lot of headaches as it makes the software a target for hackers and spammers.

As with securing your home, the best you can do is make your WordPress install a little more secure in the hope that that hacker or spammer will move down the line to the next install on their list.  Nothing you can ever do will make you invincible.

WordPress loves advertising the version number of the install for statistical reasons.  The problem with this is that when a bad guy knows the version of your WordPress install, they will know which vulnerabilities to use to break into it.  By not letting them know this version number, it makes it just a little more difficult to break into your blog.

» Read more: Securing WordPress: Plugging the WordPress version leaks

Oops… domain was down

July 7th, 2009

Well, I put off paying my domain bill a little too long and Mawhorter.net (and Facelift/Forums/Docs) were all down briefly today.

All is back to being right.