From the time I first heard its name to this month, I’ve been a huge fan of the internet music service, Pandora. It let’s you set up radio stations around particular songs or bands and then plays you music it thinks you may like. Also, it’s a free service (nothing quite like free).

It’s not without its problems which, lately, have been completely turning me off. First of all, it seems that over time, the algorithm for guessing what kind of music is similar to your taste is getting worse and worse. Either that or I’m listening to the wrong kind of music. Also, once you tell it you like a song, you’d think it would use that song to find more similar songs…but no, it plays that song over and over day after day until you thumbs-down it or put it on the shelf for a month (after the month is up, it starts playing it incessantly again). The past few months, they did the inevitable, which is to start playing annoying ads inbetween songs, and turning off your radio after 15 minutes or so of playing time just so you have to go back onto the site and look at ads.

The straw that broke the camel’s back was this: they used to have it so that when you used up all your song skips on one station and they kept playing shit you hated (happens quite often), you could go to another station and click through a few songs. Not anymore, you get a total number of song skips for your account, no longer for each station. This means that if one of your stations starts to piss you off and you skip a bunch of songs, you cannot skip more songs in other stations. What does this mean?

It means that I turn off Pandora and listen to music I have on my computer. Why would I want to be forced to listen to shitty music on ALL my stations? I keep telling it: NO JIMMY BUFFET but it doesn’t fucking listen.

I’m not just writing to complain though! There is something a lot better than Pandora. I don’t think many people know that they do internet radio (or maybe I’m just really ignorant), but last.fm has internet radio that’s a lot better. You can listen to combinations of tags (a lot like beeets, but for music and not events), and adding a song by an artists plays songs that are actually similar to it (no more Jimmy Buffet when I want Simon and Garfunkel).

Good music, good interface, no audio ads (yet!), no obnoxiously-low limits on skipping…in fact I’ve never hit any limit for skipping songs. Check out last.fm. They kick Pandora’s ass.

I can’t tell what’s better: the actual text art or the jubilant avatar next to it. Either way I cracked up when I saw it. Great ad, too. Here’s the original post. Update – as I predicted, the phallic text art was removed =(
penis

Maybe it’s my lack of Mac know-how, or maybe my total disdain for the damn things, but the Mac Mini we have in our office is a stubborn little shit. No matter how hard we try, it won’t start up Sphinx at boot, nor will it run cron-jobs. I guess I don’t blame the Mini as much as OS itself.

OS tries to be user friendly by providing a UI for things that you’d normally need a command line for in a unix system. The problem is that they implemented it in such a way that the command line doesn’t work for things there are a UI for in many cases. Either that or I’m going insane, but either way a linux dork should be able to figure out how to get something as simple as cron jobs and boot programs running, but alas, no luck.

We originally got it because it would be our personal server for testing and running linux programs (like Sphinx search!) but it turns out it’s kind of a pain. I do love the OS interface when I’m using it, but most of the time I’m on it through remote SSH.

Well, I could live with just starting Sphinx manually every time it boots, but today MySQL just decided to quit randomly without warning. Now, this Mini is just for development, there are no actual sites running on it, so no REAL harm, but damn. The fact that it isn’t running anything on it should be reason enough for it to not suck.

I’d like if Apple would make an interface through OS for startup/crons instead of making you edit some backwoods-hick xml file hidden under some obscure camel-cased directory.

Aside from the Mac only running SSH and the GUI reliably, it does everything we want it to except for everything. It looks cool though. My advice is to never get a Mac, at least not until they can program stable kernels and not, like a pack of rabid wild apes, use launchd with its xml-jedi-mind-trickery. Who’s idea was that? And since when did cron stop doing everything we’ve ever wanted?

A while ago, I wrote a snippet about MySQL replication. Well, I finally started playing with it not long ago, and was very successful. Apparently it works well, even for someone who hasn’t set it up before. Nice. I haven’t actually set this up on beeets because we don’t need it yet, and also I haven’t played with it enough to feel confident using it on a production basis.

That said, our Lyon Bros aframe framework now supports replication. It sends selects to the slave, writes to master, last_id to master, transactions to master, etc. Basically the only thing that slaves get are dumb selects (which are most of the queries anyway). I had the opportunity to test this out with the play MySQL replcation setup, and it works perfectly. It was nice to see something that complicated actually working.

Right now, it only supports connecting to two servers: master and slave (it holds off on connecting to those servers until one of them actually gets a request to save time on request startup). Basically, aframe doesn’t support load balancing. This means that if you have more than one master or slave, to use replication effectively, you’ll have to use a MySQL replication load balancer (either software or hardware). This will give you a single IP address to send requests to, but distribute the requests automatically to improve load times.

Hopefully we’ll need to set this up soon, but for now, just the one MySQL server will do =). Sometime within the next few months, we plan on releasing aframe as open source. It’s licensed and ready to go, but we have no documentation…and just saying “check out CakePHP and hope it works the same” won’t fly…especially since aframe is 23,148,855,308,184,500x better than Cake.

One thing I’d like to check out on round two of replication tinkering is Maatkit. From what I hear, it automates a lot of stuff I would be writing scripts for and checking every day. I looked at it a while ago and it seemed overly complicated, but that was even before I tried to get a server replicated. Maybe nowadays it would be easier.

With Amazon S3 being as good and cheap as it is, it’s almost essential for what I need it for…storing images and large static files. The problem is there is no interface besides SOAP, and if you don’t know how I feel about SOAP, let me tell you: it makes my head want to fucking explode. It’s insanely complicated for what it does. It tries to standardize so many things that it’s completely bloated…sending the message “hello” from one computer to another in SOAP takes oh about 10 years…5 years for a team of 50 supercomputers working in tandem to build the header and message body (which will total about 400 mb when finally complete), .02ms to send, and 5 years in decoding. Use JSON, you crackheads. Sure you’ll actually have to document it, but nothing is worse than SOAP, not even documenting.

That’s besides the point though. S3 chose to use SOAP, so I refuse to write my own client for it. This means that, as of late, the world is without a good free S3 uploading client. S3Fox, the firefox extension, is ok…it can’t handle SSL connections though, so expect to lose your private key to a sniffer about 10 seconds after your first request. JungleDisk is now a completely paid service (I already pay for S3, I’m not paying those guys to fucking USE it). Linux has some great command line tools for S3 (yay…), but that leaves windows with either S3fox, JD ($$$), or a handful of shitty S3 clients.

Right now, I have to use a PHP script I built around the S3 PHP Class to do any uploading that doesn’t make me vomit. The S3 class works REALLY well…it lets you assign ACL while uploading, change headers for images (for browser-side caching, mmm) and best of all, doesn’t completely suck. Let’s all thank Donovan Schönknecht for writing something that actually works well and communicates with S3.

Here’s a piece of code I wrote that wraps around the S3 uploader. It uploads images, sets Cache-Control headers, and removes the images. What you want to do is copy your images into a folder, run this file one directory up (change $start_folder to == the name of the folder your images are in), and sit back. It will upload all your images, directory structure preserved, publicly viewable and with cache-control headers.

< ?
	// quick config
	$bucket			=	'your.bucket.com';
	$start_folder	=	'images';

	// settings
	error_reporting(E_ALL);
	ini_set('display_errors', 1);
	ini_set('max_execution_time', 3600);

	// include S3 class
	include 'S3.php';
	$s3	=	new S3('[your key]', '[your secret]', false);

	// get list of files. if you don't want a subdirectory, just change this line to not need one. hopefully you know PHP...
	$files	=	recurse(array(), $start_folder);

	// loop over files and upload
	for($i = 0, $n = count($files); $i < $n; $i++)
	{
		$ext	=	preg_replace('/.*\./', '', $files[$i]);
		$type	=	'image/jpeg';
		if($ext == 'jpg')
		{
			$type	=	'image/jpeg';
		}
		else if($ext == 'gif')
		{
			$type	=	'image/gif';
		}
		else if($ext == 'png')
		{
			$type	=	'image/png';
		}

		if(
			!$s3->putObject(
				$s3->inputFile($files[$i]),
				$bucket,
				$files[$i],
				S3::ACL_PUBLIC_READ,
				array(),
				array('Cache-Control' => 'max-age=31536000', 'Content-Type' => $type)
			)
		)
		{
			echo '<span style="color:green;">Failed: upload of '. $files[$i] . '';
		}
		else
		{
			echo '<span style="color:green;">Succeeded: upload of '. $files[$i] .'';
			unlink($files[$i]);
		}
	}

	function recurse($files, $dir)
	{
		$d	=	scandir($dir);

		for($i = 0, $n = count($d); $i < $n; $i++)
		{
			if(!preg_match('/^\./', $d[$i]))
			{
				if(is_dir($dir . '/' . $d[$i]))
				{
					$files	=	recurse($files, $dir . '/' . $d[$i]);
				}
				else
				{
					$files[]	=	$dir . '/' . $d[$i];
				}
			}
		}

		return $files;
	}
?>

Feel free to modify, copy, blah blah…but give credit where it’s due. Let it be a light to you when all other lights go out. Hopefully it helps someone, because it sure helps me out.

I used to love firebug (a firefox extension). Notice my purposefully not linking to their extension page. In recent months, they have crippled the plugin’s functionality and UI. In order to activate it on a page, I no longer get a checkboxes and a big button to push, I now have to click a very obscured arrow icon and enable it. If that wasn’t bad enough, the “close firebug” icon, which used to be in the far right where one would expect it to be (and where it had been for years) is now a “turn off firebug” button, with the “close” button now moved two buttons over. Great, now I keep turning it off instead of minimizing it…which brings us back to finding the obscure arrow.

You think that’s bad? Try using google maps with newer versions of firebug. It completely hangs. There isn’t a whole lot of info on this, but try it. Load a page that uses the JS google maps API and it will wait for gg.google.com indefinitely. Turn off firebug and what happens? OMG it wurkz fine!

Firebug: please revert to your older and much more useful interface, and fix your stupid gmaps problems (perhaps take a look at how a 204 http code is supposed to work lol hax wtf). Also, if you can’t make your interface useful, can you at least quit fucking it up more and more? kkthxbai

Hey, sea monkeys. I didn’t like the old KTR design so decided to make a new one and put in wordpress. The great thing about this is that wordpress is 100x better for blogging than the custom system we built. Not that Lyon Bros couldn’t, make an awesome blogging system, but it’s already built and it works well. I installed WordPress on beeets a while back and fell in love. Nothing is easier, except for skinning it, which can be a pain in the ass.

So that’s the update. Articles and blog posts have been merged since they’re pretty much exactly the same as far as storage goes…but now they are categorized. Yay.

So, welcome to the new killtheradio.