WordPress Page Spam

I’ve been getting spam to my page’s and pictures for years, but this last weekend I got 400+

Grrr, time to fight back.

The annoying thing is that both Media and Pages don’t have the ability for the Admin (out of the box) to say “no comments”, which is what I do to all my posts once I they get enough spam, and I don’t want to leave to open for active discussion.

So I found this support post with this code to stop Media comments:

add_filter( 'comments_open', 'no_media_comments', 10, 2 );

function no_media_comments( $open, $post_id ) {

	$post = get_post( $post_id );
// wordpress refers to images as attachments
	if ( 'attachment' == $post->post_type )
		$open = false;

	return $open;
}

I then found this page in the Codex with the ‘post->post_type’ defined and added another clause to block posts to Pages also and ended up with this:

function no_media_comments( $open, $post_id ) {

	$post = get_post( $post_id );
// wordpress refers to images as attachments
	if ( 'attachment' == $post->post_type )
		$open = false;
	if ( 'page' == $post->post_type )
		$open = false;

	return $open;
}

add_filter( 'comments_open', 'no_media_comments', 10, 2 );

Which I placed at the very bottom of my functions.php (Appearance -> Editor -> functions.php)

Getting SageTV to work with HDHR3-DT with NZ DVB-T Freeview

So the default install process of SageTV (7.1.9) and HDHR3-DT (release 20120405 or 20130117beta1), is incompatible for me with DVB-T/New Zealand Freeview.

When I did a channel scan, SageTV stops when it get’s to the first channel with content. Yet the HDHomeRun tools scan/dispaly all channels correctly.

The work around is to add the Video source’s as normal but don’t do the channel scan, add the second video source like the first (but use same guide data), exit SageTV and stop the service. Then edit the Sage.properties file and alter the ‘mmc/dvbt_region=Christchurch@Sugarloaf‘ entry to ‘mmc/dvbt_region=

thus from this:
Text to remove

to this:
with text removed

Now restart SageTV, do the channel scan, and it will complete as expected.

But don’t select ‘DVB-T Region’ menu item, otherwise you’ll have to edit the configuration above again.

3 Hours Down Time due to Hosting Server Upgrade

For the 12 people trying to view the blog, my apologies. My Hosting Service upgraded the back-end database, and the support people took three hours (normal business hours) to tell me to re-apply the passwords to the DB.

[Edit]To be fair, they inform me they were discovering the solution with another customer, which I have no problem with. I was just feeling a little out in the dark about the process of resolution. But really when there’s a fire, you just put the thing out, and its over now…

But were back in action now. So back to work.

Don’t leave development firmware on you camera…

It shouldn’t need to be said, but “Don’t leave development firmware on you camera” in late December I was trying to fix the Lossless NEF file corruption problem on my D5100. I loaded a firmware, found it didn’t fix the problem, and then went back to studying the code. I few hours later, as a family we went off to a New Years eve party, and I picked up my camera, and snapped some real keepers.

Next day, I plugged the SD card in and found that Lightroom was

Lightroom has encountered problems reading this photo. You will not be able to make adjustments to the photo.

Arrg.

There is a good example of how to pull the preview jpeg’s, but when I did that, the preview pictures were 570×375, and thus not worth keeping, so some reading of the help file and this command pulled the embedded 4928×3264 jpegs.

exiftool.exe -b -JpgFromRaw -w _jpgfromraw.jpg -ext nef -r .

Which is better sized albeit a little over compressed. But better than nothing.

Now to solve the lossless NEF problem once and for all, and try resolve if the raw files can truly be recovered…