Skip to content

Category: Uncategorized

PHP Generate Color in Rainbow

I had to create a script that generated rainbow between 2 to 768 colors in the rainbow. It returns an array that can be referenced. It’s ideal for 5 to 700 results.

// Generate Rainbow Points.
function generatecolorcodes($numberofcolor)
	// Find numbers to pick.
	if ($numberofcolor > 0 && $numberofcolor <= 768)
		$divis = round(768 / $numberofcolor);
		$s = 0;
		while ($s < $numberofcolor)
			$cwheel = $s * $divis;
			if ($cwheel >= 0 && $cwheel < 256)
				$red = 255 - $cwheel;
				$green = 0 + $cwheel;
				$blue = 0;
			if ($cwheel >= 256 && $cwheel < 513)
				$red = 0;
				$green = 255 - ($cwheel - 255);
				$blue = 0 + ($cwheel - 255);
			if ($cwheel >= 513 && $cwheel < 768)
				$red = 0 + ($cwheel - 512);
				$green = 0;
				$blue = 255 - ($cwheel - 512);
			$red = dechex($red);
			$green = dechex($green);
			$blue = dechex($blue);
			if (strlen($blue)<2) {$blue = '0'.$blue;}
			if (strlen($green)<2){$green = '0'.$green;}
			if (strlen($red)<2){$red = '0'.$red;}
			$outarray[$s] = "#" . $red . $green . $blue;
	return $outarray;

Don’t cheap out on web hosting.

Just heard a horror story of a company who decided to change hosts to their new IT guys and it backfired. It’s not best to trust a small business web hosting company who does not handle web hosting primarily. They may have servers that work but they may not have reliable services like Backups, Backup Power, etc.

Websites are important and many use the hosting account to run their emails too. They did in this case and lost them all. I had them on a service that had backups. The hosts I recommend at this point in time is Dreamhost or Hostgator. I prefer Dreamhost for their free SSL certs (using Let’s Encrypt) plus user isolation incase of security incidents on just one of your sites. If you’re used to using cpanel go with hostgator. Neither will give you 100% uptime but they do their best (much like others I didn’t name) to make sure things are fixed quickly.

Net Neutrality

It’s a shame this is where we are. The FCC is going to be voting to strip Net Neutrality rights. This is not good, and speaking as a person who has set up and manage TONS of servers on different carriers I can tell you this breaks rules that helps keep everyone honest.

While I don’t believe ISPs will be doing tiers in the way people over-react to, I do see legitimate throttling like so…

(These are examples, they are not doing this currently, only theoretical)

Spectrum has their own voice service, to encourage people to use their service they will intentionally starve connections to that service to make their service look better. They could do anything from providing poor routing, not upgrading where needed to handle the load or just having a lot of packet loss making the phone call sound terrible.

AT&T offers DirecTV Now and U-Verse service. They could slow down or not give proper bandwidth to services like Sling TV, PlayStation Vue, Hulu TV, etc. This would make their services look better by giving the illusion that a service is worse when it really wasn’t the producing company’s fault.

Verizon has a NFL deal and if you were trying to watch NFL on their network from a different legit source they could slow you down or just not provide reliable service so you would get a bad feeling about what you’re paying for and dump it for verizon’s.

In the past things like this has happened, and it would make a triumphant return if their lobbyists get their way.

This should not be a divided issue. There is literally no benefit to the customers, only the freedom for the companies to do what they do best… Try to get all the money they can from us pathetic chumps. From what I have seen our current government is not remotely listening to the people at this time, they are setting up their friends and other wealthy donors with the bonuses that they really want. We have to do what we can, call your politicians… It’s pretty much all we can do. Get more information here.

Fraghouse Nations server is back up for the holidays

One of the game servers I set up a decade ago is back for the winter. Updated with TitanRPG for better leveling. Fraghouse Nations is a group of custom mods that weren’t necessarily designed to work together all into one unique experience. It uses standard invasion but with a lot more monsters and on custom maps designed for this mode. There are customized Vehicles, Weapons, Maps, Monsters, and more?! The leveling is set up so you can get to a point where it’s relatively easy within about 45 minutes.

You can find this server under the Assault Tab where you will find the other legacy PWC-Gaming servers.