Checking TLER setting for linux hard drives

When using hard drives in a NAS, it’s important that the drives have a proper TLER setting. This setting tells the hard drive to stop error recovery after a certain amount of time. NAS systems have their own error recovery system, so a drive taking a long time to recover for an error can actually negatively impact the rest of the NAS array.

for drive in $(ls -la /dev | grep -E 'sd[a-z]$' | awk '{print $10}'); do echo "Checking TLER setting for drive ${drive}:"; smartctl -l scterc /dev/${drive}; echo ''; done

To turn the setting on for a drive that states it is disabled:

smartctl -l scterc,70,70 /dev/sdg

include wpdb outside wordpress

If you need to load the WordPress database outside of WordPress (for cron jobs, specialty pages, etc) simply put this at the beginning of your script:

define( 'SHORTINIT', true );
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );

This will tell WordPress to load up with as little as necessary. If you don’t have the SHORTINIT call then it will load all of WordPress as normal (which you probably don’t want).

I started a YouTube Channel

I’ve been watching lawn care videos on youtube for a while now, and I’ve been joking about making my own. Then friends started telling me I should. And today Justin concinved me to. So here we go..  I’m now known as Grass Daddy!

If you have a lawn, go ahead and subscribe to the channel. I’ll show  you tips and tricks I use on my grass to make it look amazing.

How To Make Numbered Lists Look Amazing in WordPress

After writing my blog post on 5 reasons to use lists in blogs, I had people email me asking how I made my lists look so good. I’ll admit, before that post my lists looked ugly. But I spent quite a bit of time playing around to get it to look that way.

What I ended up coming across was some css tricks that let you do numbering in different styles. I had to modify it to work with the lists I was making. First, I’ll give you the code to put into your theme’s custom.css file:

.fancy {
    counter-reset: fancy-counter;
    list-style: none;
}

.fancy li:before {
    content: counter(fancy-counter);
    counter-increment: fancy-counter;
    left: -40px;
    position: relative;
    top: 25px;
    font: bold 50px/1 Sans-Serif;
}

.fancy strong {
    margin-left: -30px;
}

Once this is in your theme’s custom.css file, you can create a new numbered list with WordPress just like you always have, with two exceptions:

  1. You must use the bold tag at the begging of each section. As you can see in the css above, strong (which is what WordPress uses for bolding), has a margin that is being offset by 30 pixels. This is to counter the space the numbers take up.
  2. You must add the fancy class to the <ol> tag. This can be done by changing your WordPress Visual Editor from Visual to Text mode. Change the <ol> to <ol class=”fancy”>. This prevents lists outside of your content from getting changed, ensuring your blog doesn’t break.

That’s all there is to it. Seems complicated at first but once you get it figured out it really doesn’t add much to your flow when creating new posts. But it has an amazingly beautiful effect that’ll help your blog look that much better.

Database Server Maintenance

While investigating sluggish behavior on our database server this morning I noticed that a couple of our settings were not properly optimized. As a result we’ll be updating these settings tomorrow to ensure our website is as fast as can be.

The actual process is quite simple, and should have a small amount of downtime. We’ll be doing it sometime between 2AM and 9AM EST. The actual window of downtime shouldn’t be longer than 15 minutes.

I’ll be posting updates on this post. Our server techs will be handling the process to ensure it’s done as quickly as possible. I’ll update here if I get a more specific time frame.

Update: The process went smoothly with only a few minutes of downtime. Hurray!

5 Reasons to Use Lists in Blog Posts

When it comes time to write blog posts it can be really difficult getting your thoughts organized into one post. Today I’m going to tell you 5 reasons why you should use lists in blog posts!

  1. They are easier to write. When you come up with a topic, it’s easy to keep it focused when it’s broken down into simple chunks. It really can help when you’ve got writers block to use a list to get your groove on.
  2. They are easier to read. I’ll admit it, I skim over blog posts. I love blog posts that use lists because I can skim and skip what I know and read what I don’t. Then end result? I end up at your blog more often than ones that don’t.
  3. Lists go viral. Now I’m guessing this is because they are easier to read so when you come across a post that isn’t in list format it just won’t go viral. But it’s true, my facebook feed is filled with these kinds of posts, and google serves me these pages all the time in my results too.
  4. Lists make you look authoritative. It’s kinda funny but when someone has a blog post with 5 reasons of this or 5 reasons of that, they look like they thought it out more than someone who wrote the same content but didn’t put it in list form. There could be 5 more reasons, but the fact that they are numbered and presented that way makes it appear much more thought out.
  5. They keep you on track. This has helped me before. I tend to go on tangents and move off topic. But when you say these are 5 reasons to use lists, I quickly stop myself when I realize I’m writing about another topic. In the end a much better blog post comes out because it’s kept on topic.

So there you have it, from the master blogger himself, 5 reasons to use lists when blogging!