Stop those hotlinking SOBs with .htaccess.
Is your bandwidth meter spinning like a top, but your page views just aren't where you think they should be for all that "traffic"? It's possible that you, my friend, are a victim of bandwidth theft due to hotlinking. Hotlinkers are dirty SOBs who steal your bandwidth by streaming your graphics, videos and/or music files onto their web site(s) directly from yours. Luckily daddy has a relatively simple solution to fix all the badness for you.
While there are a few options you have when you want to deal with hotlinkers, I'm going to demonstrate the easiest and often best suited solution: displaying an alternate graphic instead of the one that the hotlinkers are stealing from your web site. If you'd like more options or want to do something different feel free to leave a comment below and I'll answer as best as I can.
Now for the fun stuff. In the root of your blog's web space, find and download (or create, if necessary) the .htaccess file. After you have a local version, copy and paste the following (and we'll get into why some of the text is in bold in a moment) into the very beginning of the file:
If you don't copy+paste the text above into the beginning of your .htaccess file you may run into problems if you break something that already exists, so please use caution. Also, don't let all the mumbo-jumbo scare you off. It's pretty simple stuff. In fact, there are only six lines, and I'll walk you through what each one does.
-
# HOTLINK STOPPERThis line is just a comment (delineated by the # at the beginning of the line) to let you know what this section of your
.htaccessfile is for. You can comment out any line by prepending it with a # symbol. -
RewriteEngine OnTurns on the rewrite engine in Apache. Without this, none of the rest of the changes are necessary. Or possible.
-
RewriteCond %{HTTP_REFERER} !^$Sets a condition for the rewrite engine to ignore anyone with a blank referer. Don't worry about the
!^$, it's a regular expression, or "regex", and it works when looking for a blank referer. And yes, that's spelled correctly... for Internet purposes, anyhow. If you're interested in the details, read up on how a referrer came to be a referer. -
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com/ [NC]Sets a condition for the rewrite engine to ignore anyone that doesn't have the domain
example\.comin their referer. Replace theexampleportion with your blog's domain name, but make sure that if you've got a .org blog that you keep the backslash in from of the period, otherwise the regex will break. -
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?bloglines\.com/ [NC]Sets a condition for the rewrite engine to ignore bloglines.com. This line is optional, but I kept it in this example since Bloglines is a pretty popular RSS reader, and you're probably going to want your readers who use it to see the pictures on your server.
-
RewriteRule .*\.(jpe?g|gif)$ http://yourothersite.com/hotlink.jpg [R,NC,L]Here's where the fun begins. This line sets up a rule that will server any graphic (in this case a .jpg or .gif file) that is not ruled out from the conditions above to the file
http://yourothersite.com/hotlink.jpg, thereby circumventing those damned, dirtyapeshotlinkers. To add more file types, just add a pipe ("|") character aftergifand the extension (like apng) and you're good to go.A word of caution: do not use a graphic that is on the domain that you are trying to dissuade hotlinkers from using as you'll cause an infinite loop and in some cases may actually take down your own web server. I've seen it happen, and it ain't pretty. I suggest you set up a free blog account somewhere, such as wordpress.com, and add your hotlink graphic there.
That's pretty much it. All you have to do now is upload your new hotlink.jpg graphic and your .htaccess file and you're good to go. If you've done everything right then the days of your bandwidth being stolen by hotlinkers should be coming to a close.
A 6-Pack of Mac OS X Terminal Tricks.
I've been a proud Apple Switcher since 2006, but it took me a while to take all of my (not so) secret Windows knowledge and learn all new tips and tricks on the Mac. Being able to become as efficient in the world of Apple as I was with Windows didn't take as long as I thought, but it did have its bumpy parts.
Because of that, and my natural tendency to share knowledge, I've compiled a list of fun tips and tricks in Terminal (i.e. command-line stuff) that I've learned over the last few years. By no means did I discover these on my own... they are a compilation of OSX tips that I’ve found online or from friends with much more Mac knowledge that I.
-
Show all files, even system files, in Finder:
Open Terminal and type "
defaults write com.apple.Finder AppleShowAllFiles YES".Hold down the Option key and click on the Finder icon in the Dock and press Relaunch. You may have to wait a second or two for the relaunch option to display.
This one is a life saver for me. I hate not being able to see all files, so this is a must in my Mac machines.
-
Show full file paths in Finder:
Open Terminal and type "
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES".Another must-have! There are so many useful reasons to see the full file path in Finder, I don't get why it's not on by default.
-
Change the default (PNG) file format for screenshots:
Open Terminal and type "
defaults write com.apple.screencapture type EXTENSION", whereEXTENSIONcan be any of the following: BMP, GIF, JPEG-2000, JPEG, PDF, PICT, PNG, PSD, SGI, TGA, or TIFF.Don't get me wrong, I love PNGs, but sometimes you want a JPG and don't want to crack open Photoshop or some other graphics tool to do it.
-
Securely delete files from a drive:
Open Terminal and type "
diskutil secureErase freespace 3 /Volumes/DRIVE" whereDRIVEis the drive you want to securely delete.If you’re not comfortable using the command line, perhaps you should skip this one... it can be a dangerous tool in the wrong hands.
-
Create your own audio book with your Mac's default voice synth:
Open Terminal and type "
say -o AUDIOBOOK.aiff -f FILE.txt", whereFILE.txtis the path to a text file you want read.My kids love this one because they think there's a robot inside my MacBook Pro that is reading to them.
-
Force Apple Mail to show plaintext vs. HTML email:
Open Terminal and type "
defaults write com.apple.mail PreferPlainText -bool TRUE".I love HTML, but HTML email is, more often than not, a huge annoyance. I turn it off whenever possible.
I hope you've enjoyed these Mac OSX tips and tricks. If you have any that you feel are a must-have, or if you know of another way of doing any of the above, please let me know in the comments for this post.
10 “Gotta Have” WordPress Plugins for Your Blog.
One of the quickest ways to make blogging easier on yourself is to use WordPress plugins. From automating tasks like backing up your blog articles to guarding your site from spam, plugins enhance your website and help you maintain a top notch blog. Luckily for us all, WordPress makes installing and using plugins as simple as a few button clicks.
There are literally thousands of plugins available, but the ones I've listed are ones I use over and over for many reasons. Some are optional depending on your level of blogging or code expertise (and will be noted in the descriptions below), but most of these plugins can be used on any blog to immediately improve things. If you have any questions, comments, or suggestions on plugins please leave me a comment below!
-
Akismet:
Akismet is a spam control plugin. Installed by default on all WordPress blogs, Akismet shouldn't even be a question. It's ridiculously accurate in separating spam from real comments and it just works.
-
All in One SEO Pack:
If you're looking to increase the search engine friendliness of your site, start with this plugin. Coupled with some smart markup (read: HTML) and decent content, your blog will start seeing the love it deserves from Google, Bing, and other search engines. There are some great customization options available, too.
-
Exec-PHP:
In a nutshell, this WordPress plugin lets you add PHP code inside of posts. If you're even slightly tech-minded, or if you want to add more functionality to your posts, the Exec-PHP plugin is a no brainer. If you don't plan on using PHP I wouldn't worry about this plugin; but if you do this is a must have.
-
FD Feedburner Plugin:
Get your RSS feed out there with more panache with a Feedburner account (easily logged into with your iGoogle account). This plugin replaces the default feed and uses the Feedburner feed instead. Once you've set up your Feedburner account you can customize it with a ton of options that will help spread your blog around and gather interest to your site.
-
Google Analytics for WordPress:
This plugin automagically puts your Google Analytics code on each page/post as appropriate. It's a great way to get some basic stats and easily integrates with your website. There are plenty of free analytics packages out there, but this one is really simple to get started with and monitor.
-
Google XML Sitemaps:
When you update your blog this plugin makes all the necessary updates so Google can parse your site more easily. Highly recommended, especially in conjunction with the "All in One SEO Pack" above!
-
Permalinks Moved Permanently:
If you ever rethink how you've categorized posts or decide to update posts on the back-end, there's a good chance that you'll eventually run into a problem with broken permalinks. This plugin is a great go-between that helps you out while you're finding the broken links because it tries to find the update permalink and send them to the right page, all seamlessly.
-
PS Disable Auto Formatting:
The PS Disable Auto Formatting plugin lets you get rid of the automated formatting that exists in WordPress posts. Take control of your blog's posts and sculpt the markup as you wish. There are a few minor things to update and/or remember when using this one, but if you want to control your HTML in a post it's a great plugin to have.
-
WordPress Database Backup:
Don't get caught with your pants down! If your WordPress ever gets corrupted or if you get hacked, make sure you have a backup with this plugin. It can be configured to automatically backup your content so you can repair if/when necessary.
-
WordPress Gravatars:
So you've read my Gravatar post and want to hook up your blog readers, have you? Just install the WordPress Gravatars plugin and you'll be on your way. This plugin makes it really easy to have your commenters feel like a part of the blog.
One more thing to note: To make sure your WordPress blog runs as efficiently as possible, be careful how many plugins you install and use. Too many plugins can actually slow things down on your website.
Is the Apple iPad a Game Changer?
I've got a new post on my Posterous site regarding the newly-announced Apple iPad with the initial details of the Apple iPad and some quick thoughts on it. The short version: The Apple iPad is everything I thought it would be and more. And at a lower price, too! I'm pretty sure I'll be getting one since they look so damned useful.
The new iPad looks like the perfect mix of netbook size and laptop capability, and IMHO it's got the potential to be a real game changer in several areas.
-
Netbooks:
I've predicted the demise of netbooks before, and even if Apple haters completely ignore the iPad, I'm still convinced that the future of netbooks is coming. Soon.
-
Kindle:
Is it even a question that Apple is positioning the iPad to be a Kindle killer? With the iBook app and current (or future) deals with publishers of books (and textbooks?), newspapers, and magazines, the iPad has much more to offer the digital bibliophile than the Kindle.
I wonder what the future of the Mac Air and the iPod Touch are, considering how the iPad sits between the two. Is there still room for either when the iPad is essentially Mac Air-Lite or an iPod Touch++? The Air and the Touch both have features the iPad doesn't, but who knows what people will flock to? Time will tell.
Future enhancements like a camera, Flash capability, multi-tasking, phone capability, and maybe even a radio tuner would be great, but even as it is now this looks like a really smart jump in the right direction for ultra-portable computing. Apple has really knocked it out of the park with the launch of the iPad. I have to admit that I'm saddened that there's no multi-tasking out the door and the display is only 4:3 instead of 16:9, but it's only version 1.0 and I can live with that for now. And if the rumors of multi-tasking being in the iPhone 4 OS are true then hey... no worries.
Oh, and once they do get a camera on the iPad I can start padcasting.
I'll be using the iPad as my home blogging tool and general Internet goofing around machine. I can write, update my blog, and whatnot on one small machine and that's all I need it for. Personally I'm leaning toward the 64GB WiFi model, which is a steal at $699USD. Before the announcement today I didn't think a 3G model would be available, but I figured the 32GB Apple iPad would be around $899, so I'm very pleasantly surprised by the price. (I can use the $200 I'll be saving on the extra 32GB of storage and accessories like the cover and keyboard stand.) The least expensive model is the 16GB WiFi for only $499. Apple has really aggressively priced this to gain users. More info on iPad tech specs at the Apple site.
How I Use Twitter Lists.
Twitter lists are a great way to help organize your tweeps into categories, or lists, that you define. Getting started with Twitter lists is easy, but how you use them every day is another story. There are probably as many ways to use them as there are people who use Twitter, but today I'm going to focus on showing you how I use lists.
I've broken down how I use Twitter lists into 4 sections, and I'll go into detail with each of them below.
-
Filtering people into lists:
When Twitter lists made their first appearance, I decided to use mine like an email filter. I took a look at the people I was following at the time and started setting up categories based on a few general topics or interests and grouped together everyone who was an easy fit into one or more of my new lists.
These lists allow me to view tweets based on what different people tweet about, generally speaking. For local tweeps talking about local events I check out my NW Tweeps 01 list. If I'm looking to join a conversation regarding development, design, or blogging I go to my Dev Design Blog list. You get the idea.
-
Finding new & interesting people to follow:
I used to follow a bunch of other people's Twitter lists, but in the end it didn't work out for me. I found it difficult to sort through all of the different tweets on all of the different lists and make any sense of things as they were. There were too many of one kind of tweet and not enough of others and that made it a big time-killer. My solution? Use other people's lists as a starting point to find new people to follow instead of following their entire set of lists.
Now when I'm looking at someone else's list I look for who the most active tweeters are, see if they look like someone I might be interested in following based on my very exacting criteria (/sarcasm), and then follow them if they do. Lather, rinse, repeat.
-
Creating secret societies known only by me:
I'm a nice guy. I don't want to hurt anyone's feelings. But if I'm being honest... I have a favorites list. There are people whose tweets have a higher priority than others do for me, personally, and it's the one list that goes beyond topics or interests like the other lists because it's filled with personal friends, influential tweeters, and the like.
Creating a private Twitter list allows you to keep your cards close to your chest and still be in the game. Whether you're looking to keep your close friends behind the door like I use it, peruse Santa's list of naughty girls (or boys if you prefer) without your co-workers seeing it, or even if you just want to follow the whole "... and keep your enemies closer..." maxim, private lists are the way to go.
-
Read but don't necessarily follow:
Sometimes I find that I don't want to follow someone anymore, for various reasons; but I also don't want to unfollow and forget about them either. Or maybe I've never followed a particular tweeter at all, but I want to keep tabs on what they're tweeting because they look like they might be interesting but I'm not 100% sure. Either way, their addition to one of my Twitter lists is essentially a reminder service for me. One list where I do this a lot is my Movies Comedy Music Etc. list.
There are a lot of celebrity accounts on that list, as well as improv groups, theaters, etc., and for the most part I don't need (or want) to catch up with all of them every day. In that case I can use the list to drop by whenever it's convenient for me and see what the latest news is for each of them.
And there we go, my personal Twitter list usage guide. If you've found any of this interesting or you have any questions regarding something specific, feel free to leave me a comment and I'll get back to you ASAP.



