Category Archives: Web Related

Redirect URLs to hide Google Analytics query strings

One of the great things about Google Analytics, is how easy it is to track your incoming traffic. And if you’re running an email campaign, or pushing some other outside link source, you can use their link builder to create a query string that tracks the individual sources and campaigns. (See their tool here.)

However, the only problem with this is that if you’re encouraging social sharing at the destination URL, those query strings can cause problems. Facebook sees them as unique pages, and twitter sharing looks ugly. So, I found this solution that quickly and easily cleans up the URL for social sharing, while maintaining the tracking from the query string.

Basically, just add the following code below your _trackPageview call.

if (window.history && history.replaceState && location.search.match(/utm_/)) {
_gaq.push(function(){
history.replaceState({}, "", location.pathname); //assuming you want no query string
});
}

This was originally posted at Stack Overflow here.
http://stackoverflow.com/questions/934119/track-campaigns-with-google-analytics-without-query-string-parameters

Connecting Sequel Pro to Bluehost databases

I found the instructions to this in a thread over at bluehostforum, but thought I’d re-post them here and provide what worked for me.

I’m using Sequel Pro, formerly CocoaMySQL, to connect to databases on my Bluehost account. Here’s what I did.

To pull all the info together, I had to add my IP to:
Cpanel > Databases > RemoteMySql

When you launch that function in Bluehost’s Cpanel, it’ll list your IP address for you, so you just hit the Add button.

Then in Sequel Pro:
Host: your domain name w/o the http://www
Port: 3306

Add in the database name, username, and password and you’re good. Remember that your username is the first 8 letters of your primary domain, followed by an underscore and the actual username. Such as http://domainname.com would be domainam_username.

Hope this helps.

Weird IM Spam using Coho and Trout and Salmon

So, I’m always annoyed and curious when I get these weird spam messages, and I finally looked them up to see what this was all about. It turns out it’s not technically spam, but some experiment. You can read more about it here at this wikipedia article It was originally called The Great Hatsby, and has since morphed into the Coho bot.

Regardless, it’s annoying to me and is possible to turn off. Here are directions borrowed from this site posting the original info.

You can stop the messages by typing:

$optout

Then it will respond with:

OPERATOR: Are you sure you want to opt-out? If you do, you will *never* be contacted again on the account “”. There is *no way* to opt back in and undo this.
If you are sure, type “$optout DADD”. Remember, this is permanent and irreversible!

Type what it asks:

$optout DADD

And you will recieve one final (hopefully) message:

OPERATOR: You have opted out. The account “” will *never* be contacted again. Good bye!

Hope this helps some of you.

Download websites quickly using SSH and rsync instead of FTP

So, I’m a complete idiot around the command line, so when someone teaches me how to do something, I write it down so I don’t forget. Today Matt showed me how to quickly and much more easily download an entire online folder via SSH using rsync rather than the slow and tedious method of just using FTP like I had been.

Here’s how:
First, open Terminal or PUTTY or whatever you use. Navigate to the folder where you want the download to go to, then type this:

rsync -vraze ssh [username]@[host]:[path to files]

Remove all brackets, as they are only there to show placeholders.

an example would look like this;

rsync -vraze ssh jason@getbetterat.com:/path/to/files/* .

You'll have to enter a password, then VRROOOOMMM away it should go.

Hope this helps. And again, this is pretty obvious stuff to anyone who's used command or SSH before, but I don't, and it's online for my benefit...

WordPress for the iPhone

This is a test/ review of the new iPhone app from wordpress. It will be short since I am writing it from my iPhone, but so far, set up took less than a minute and I’m already composing. This is fantastic. It’s also COMPLETELY intuitive. Everything has been right where it should be, and the options are clear and concise.

At the moment I’m trying to add an image. Not completely obvious I guess, which is contrary to my last point. Oh well.

photo

Update: It seems that when you’re typing in the body of the post, you only type. After you hit Done, you can then add an image (either from the camera or from the library), set a timestamp, edit the categories, etc. Then, you just hit publish.

The photo above was taken from my iPhone of the iTunes App Store showing the WordPress App. Special Note: The image was resized automatically, and automatically linked to the larger version of the image. This is also fantastic. I imagine someday you’ll be able to set preferences for the way this is handled, and what the thumbnail size is (for easier and more seamless integration into different themes), but for now, this is a fantastic 1.0 piece of software and I’m thrilled to have it in my arsenal.

Douchebag WordPress Plugin

Got a douchebag always leaving lame comments? Mark him with an icon that lets everyone know how you feel.

douchebag plugin

The Douchebag plugin for WordPress is pretty much the greatest idea ever. There are a lot of times when I dislike a comment, or a commenter in general, but you don’t want to a) delete the comment, or b) be a jerk to them by calling them out in the comments. With the douchebag plugin, you can quickly give them a very ‘not-so-subtle’ hint without censoring them or even typing a word.

the interweb is the greatest place in the world.

Check out the Douchebag Plugin at Young Go Getter

Hardcore advanced renaming of files in Mac OS X and Windows

Renamer4Mac is an advanced file renaming tool for Mac OS.

Where was this app just a few weeks ago? I needed this desperately and ended up bugging my programmer for 30 minutes as we wrote a shell script (never done that before) to make some pretty sophisticated file-renames. However, I was pretty nervous to hit “go” in case I missed something… Now, here this is with live previewing, so you can see exactly how your files will be renamed before you hit Go.

Renamer4Mac supports Regular Expressions (yay! regex), search and replace, insert/overwrite of text, numbering files, and capitalization. Whew. It’s also donationware, so make sure you support these guys if you like their work.

Renamer4Mac

Renamer4Mac, found via lifeclever.com.

Porn Spam and the search for Links

I noticed this morning that a comment had made its way into my queue for moderation on one of my rarely updated sites this morning. When I went to moderate it, I saw as I expected that it was spam and filled with links to porn sites. It had the usual “lesbian licking party” with some link to some url that specializes in lesbian licking parties. As I deleted the comment, I have to admit, for a split second I thought “I like lesbian licking parties… I wonder if this site is any good…”

Now, for those reading, I didn’t go and check out the site. I stay away from that shit. However, it did occur to me that I delete all the spam I get pretty quickly because there is nothing in it for me to keep that comment. It’s filled with junk and I don’t want it on my site. However, taking the idea a little further, what if this site gave me free access to it’s paid content? Now, I’m going beyond porn here, what if sites that wanted links just went to the site owners and said “Hey, we’ll give you a month’s free account if you let us do some nasty, link-filled commenting in your system? What if SEO experts just offered up free goodies to people when they needed more links? It’s better than buying them because in the case of free memberships, those memberships have no value outside of the people who are willing to pay for them, so giving them out to a handful of people, in order to get a truckload to sign up, is a positive exchange.

Now, a non-porn specific way to do this would be an SEO going to a handful of sites that pass decent PR, and working out a deal, some free service in exchange for the ability to get any number of links posted on the original site. That way, the SEO gets his links all over the web, and can probably give out the same piece of advice to almost everyone, a simple “advanced” eBook or something. Maybe 30 minutes of personal 1-on-1 advice, in exchange for 20+ links? I think that’s a pretty good deal, if it’s saving you time getting decent links in the long run.

Quickly and easily add images to your site or blog without hotlinking

Man, I love adding cool images to my blog posts, but sometimes it can be a pain to find an image, download it, upload it, get the path, and blah blah blah. So, imgred.com makes it easy to embed images in your site, but instead of hotlinking to the original source, imgred downloads it, places it on their own server, and allows you to hotlink from there.

But how does it work? Well, I tried it with this image from Lifehacker, who wrote up this very same topic.

Hotlinking from an article about hotlinking

So, if you see an image above, then it must be working.

As you can see from the image, all you have to do is add “http://imgred.com/” to the beginning of the absolute path to the image online. Pretty easy. Now, I’m about to hit submit and see if it works…

Technorati Tags:

Firefox Inline Autocomplete

I spend most of my day with my hands on the keyboard and a web browser open. So, one feature I’ve come to absolutely love is Firefox’s inline autocomplete. Basically what this means is that when you’re typing into the address bar a URL, and you’ve visited a similarly named site before (for instance, I type in “goo” and google.com is in my history), it autocompletes inside the address bar. So instead of having to move to the arrow keys and scroll down to it, the best match is automatically filled out. I love this feature so much, but whenever I use a new machine, re-install my settings, or something, I have to look it up on Google again. So, I’m posting it here, for you and for me.

To enable autocomplete in the Firefox:

1. Go to about:config in the URL field and press enter.
2. Right-click somewhere on the page and choose New > Boolean value
3. Enter browser.urlbar.autoFill as the preference name (note, this is case-sensitive: ‘F’, not ‘f’). I just copy and paste it, makes it easier.
4. The value should default to true, but double check.

You’re done. So nice, so easy. Here’s a screen shot of it in action.

Firefox inline autocomplete

Special thanks to Geek Ramblings for this tip. I always went to his site to remember, but I just want to have it on my own site for ease of finding…