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.

Access your Time Capsule Remotely

Wow. I feel like an idiot. I’ve had an Apple Time Capsule at my house for maybe close to a year now, and have just today realized how easy it is to access it from my office.

Disclaimer: this works for me, but I can’t promise it’ll work for you. The steps I’m showing are exactly what I did to get it to work.

The first thing I did was discover my home IP address. The quick and dirty way to do this is to just go to a site like this: http://whatismyipaddress.com/. Right at the top it shows your IP address.

Disclaimer Two: If you have Comcast Cable internet or similar, it’s possible that you do not have a static IP address. This means that occasionally, it could change. If it does, you’ll need to re-acquire your IP address this same way every once in a while. OR, you could use a DNS forwarding service like this: http://www.dyndns.com/. At the moment, I’m not worrying about it.

Next, go to your office. Open Finder (sorry, this is mac advice only) and press CMD+K. Enter afp://your.ip.address.

Go to Server dialog box

From there, you’ll get a login window with a username and password. You can leave the username to be whatever, and just enter the admin password for your Time Capsule. Hit enter, and your remote time capsule will be mounted and in your finder. So. Awesome.

I added mine to my Favorite servers, so I can quickly pull it up again later if it becomes un-mounted.

Hope this helps.

How to force Safari 4 to open new windows in Tabs

There’s a setting in the Preferences pane of Safari 4 that says “Open Links from Applications in ‘New Tab’ or ‘New Window.’ ”

Unfortunately, this doesn’t do anything when the link is already within Safari. Anytime a website tells the browser to open a new page, Safari’s default is to open a new window, NOT a new tab. For me, tabbed browsing is powerful because I DO NOT WANT multiple windows, just tabs, but soon, I start getting multiple windows with multiple tabs, and then I’m pissed.

Here is a quick way to make sure all new links open in a new tab (tutorial via switchingtomac.com):

Start by opening a Terminal window (Applications -> Utilities -> Terminal). Enter the following command:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

Terminal Command

Now restart Safari. Links that used to open in a new Window will now open in a new Tab instead.

Safari 4 Tabs

If you decide you want to change back, just re-enter the command but replace true at the end of the command with false.

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...

Tips: Change the default width of “column view” in Finder (Mac OS X)

I’ve always been really frustrated by the narrow widths of the column view in Mac OS X’s Finder. I’m regularly widening them to see more of the file names, and wishing they stayed wider when I open the next one. So, today I searched for a solution.

In Mac OS 10.4 [and greater] the default width of the Finder’s columns can be changed by option-dragging the column handle to your preferred width. When you close the Finder window and open a new one it will open with the columns sized as you indicated.


Change default column widths in Finder (Mac OSX) from Jason Glaspey on Vimeo.

It’s so easy to do, it’s almost frightening.

Original tip found here.

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.

Domain Shortcut Helps Type URLs in Your iPhone More Quickly

This is truly an awesome feature and I’m really glad Lifehacker posted about it. This is honestly one of those things that make reading a bunch of websites worth it sometimes, as it just made my iPhone experience so much happier.

domain-shortcut.pngFirst, in Mobile Safari, just hold down the .com button for a second to see other domain options (namely .net, .edu, and .org). Second, when the keyboard has the @ symbol but no .com key, you can hold the ‘.’ (period) key to get the same domain shortcuts…

Read the whole story here.