Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather
You are here: Home / Archives for 2011

Archives for 2011

Moving the modem

2011/05/23 By staze

Since moving into my home, I’ve had my cable modem in our office. A room above our garage that has coax run to it from the garage, which is where the CATV coax enters the house. Coax enters the house through a wall, goes into a splitter, and heads from there up to our office. Total run length from the splitter is about 30ft. With the modem in the office, and then in the garage, the data for the modem follows (Update 5/26/11: After a couple days, the signal levels changed a bit in its new location. I’ve found online that 6 dBmV is actually a bit on the high side for signal strength, but within acceptable limits):

Office Garage Garage 2
Downstream Freq 567.00 mhz 567.00 mhz 579.00 mhz
Downstream Power 3 dBmV 4 dBmV 6 dBmV
Downstream SNR 36 dB 36 dB 35 dB
Modulation QAM256 QAM256 QAM256
Upstream Freq 32.400 mhz 32.400 mhz 22.800
Upstream Power 44 dBmV 43 dBmV 42 dBmV
Channel Type DOCSIS 2.0 (ATDMA) DOCSIS 2.0 (ATDMA) DOCSIS 2.0 (ATDMA)
Symbol Rate 5120 kSym/sec 5120 kSym/sec 5120 kSym/sec
Modulation QAM64 QAM64 QAM64

[Read more…]

Filed Under: Home Ownership Tagged With: cable modem, CATV, Coax, Comcast, DOCSIS

WordPress _transient buildup

2011/05/03 By staze

WordPress uses DB entries called _transients to cache certain data. Cached entries are by default, things like RSS info, when cron last run, etc. If you use a plugin like Google Analytics Dashboard (GAD hereafter) though, you also get cached data relating to that. Unfortunately, either due to a bug in WordPress, or something left out of GAD, this cached info doesn’t seem to be deleted after it’s designated expiration time/date (_transients have a set expiration time, but they don’t seem to matter for GAD set transients).

Looking around online, I found someone who was dealing with a similar problem here.

The trick was to add the following to my the functions.php file in my theme.


add_action( ‘wp_scheduled_delete’, ‘delete_expired_db_transients’ );

function delete_expired_db_transients() {

global $wpdb, $_wp_using_ext_object_cache;

if( $_wp_using_ext_object_cache )
return;

$time = isset ( $_SERVER[‘REQUEST_TIME’] ) ? (int)$_SERVER[‘REQUEST_TIME’] : time() ;
$expired = $wpdb->get_col( “SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE ‘_transient_timeout%’ AND option_value < {$time};" ); foreach( $expired as $transient ) { $key = str_replace('_transient_timeout_', '', $transient); delete_transient($key); } }

Later in the day, when that cron task ran, it removed all the expired transients from my wp-options table, and at midnight, when my system cron task ran to optimize my DB tables, the table shrunk down to the size it should be. If you so wanted, you could add the optimize operation to the above, but I figure it’s not that big of a deal once things are under control. As always, back up your DB and any files you modify before implementing changes. If you have access to a mysql console, you can also try the query out by doing something like:

SELECT option_name FROM wp_options WHERE option_name LIKE '_transient_timeout%' AND option_value < now();

You'll want to change "wp_options" if you have a different prefix set for wordpress. Theoretically, that query should show you all your expired transients.

Have fun!

Filed Under: Coding Tagged With: GAD, transient, Wordpress

404’s and sitemaps

2011/04/24 By staze

Just did a bit of a tweak to my site to address something that I always thought sucked, but never really looked into: 404s.

404s traditionally are ugly, and unhelpful. They say “can’t find what you’re looking for” and that’s about it. With the advances since PHP and CMS’s have come about, this doesn’t have to be the case. So, I’ve replaced my previously stock, and ugly, 404 page with the wonderful 404 info from Yoast, as well as implemented an HTML sitemap as per his other post here. The only other thing I did was modify the 404 page a bit so that if someone tries to look for a file on my site that’s a PNG, GIF, JPG, JS, etc, they get a basic “file not found”. This code came from here.

It’s all pretty boring, but I think it’ll make the user experience of my site a bit more friendly. And it’s more inline with Google’s current thoughts about 404 pages.

Filed Under: Miscellany Tagged With: wordpress 404 yoast binarymoon

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017
  • February 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in