Search Results

The Farthest I’ve Traveled from Home…

…would be my time in Operation Desert Storm in 1991. I was in Saudi Arabia and Kuwait. 020712-N-5471P-004 According to this distance calculator, it's almost 8,000 miles (great circle distance) from Los Angeles (where I lived at the time) to Kuwait City. My unit was actually based in King Khalid Military City, Saudi Arabia and [...]

…would be my time in Operation Desert Storm in 1991. I was in Saudi Arabia and Kuwait.

020712-N-5471P-004

According to this distance calculator, it's almost 8,000 miles (great circle distance) from Los Angeles (where I lived at the time) to Kuwait City. My unit was actually based in King Khalid Military City, Saudi Arabia and Camp Doha, Kuwait, but Kuwait City will do for distance calculations.



The second farthest would be on our Panama Canal transit cruise from a few years ago. That distance was "only" 3,264 miles from home.



I couldn't get too much farther away from home; the antipodal point (~12,000 miles) from me is in the middle of the Indian Ocean.

Powered by Plinky

Comments off

Speeding up Safari (Mac) by turning off its cache

WARNING: This procedure worked for me but I do not guarantee it will work for everyone. Use at your own risk. I primarily use Apple’s Safari browser, along with Google Chrome and Opera. Chrome is almost to the point where I might be willing to switch, but right now I’m very comfortable with Safari. With [...]

WARNING: This procedure worked for me but I do not guarantee it will work for everyone. Use at your own risk.

I primarily use Apple’s Safari browser, along with Google Chrome and Opera. Chrome is almost to the point where I might be willing to switch, but right now I’m very comfortable with Safari. With one major exception: after an hour or two of heavy use (multiple tabs and windows, reloading pages, lots of script-heavy pages) the browser’s performance drops to a level that is just unacceptable, especially on a 2.4GHz Core 2 Duo MacBook Pro with 4GB RAM. Page loads are sluggish and almost every click on a page results in a beachball for a few seconds. After a bit of Googling and experimenting I narrowed the problem to the browser cache. It seems that Safari’s mechanism for searching its cache is, let’s say, suboptimal.

Unlike most other browsers, Safari provides no user-accessible preference for adjusting or disabling its cache. So I looked deeper.

  1. Close all Safari tabs and windows. Don’t exit Safari, just close all its windows.
  2. Empty Safari’s cache: Safari menu -> Empty cache
  3. Exit Safari.
  4. Open Terminal*: Applications -> Terminal or Spotlight -> “Terminal”
  5. In the Terminal window, type:
    chmod a-w Library/Caches/com.apple.Safari/Cache.db
    (the above should be all one line; hit Return or Enter at the end of the line)
  6. Type: ls -al Library/Caches/com.apple.Safari/Cache.db
    (the above should be all one line; hit Return or Enter at the end of the line)
    You should see:
    -r--r--r-- 1 [your user name] staff 26624 Sep 28 17:33 Library/Caches/com.apple.Safari/Cache.db
    The details will differ, but the important part is -r--r--r-- which is Unix for “read-only for everyone”. That means Safari can’t write to its cache file, effectively turning it off.
  7. Relaunch Safari and browse normally. If your results are like mine, you’ll note that the sluggish performance of Safari after an hour or two of heavy use is now just gone.

*Just re-emphasizing the warning at the top of this post. If you follow these instructions exactly, nothing untoward should happen. However, Terminal is the window into the deepest, darkest inner workings of Mac OS X. It’s possible to really screw things up with a simple typo. If you have any doubt, don’t do it.

Comments off

SFGate with no comments: a Greasemonkey script

After a few months (sorry!) of downtime, my SFGate-NoComments Greasemonkey script is back up at Userscripts. I realize the previous sentence makes very little sense to anyone but me, so I’ll expand it: After a few months (sorry!) of downtime You saw my to-do list(s), right? SFGate-NoComments The “comments” sections in SFGate (San Francisco Chronicle’s [...]

After a few months (sorry!) of downtime, my SFGate-NoComments Greasemonkey script is back up at Userscripts.

I realize the previous sentence makes very little sense to anyone but me, so I’ll expand it:

After a few months (sorry!) of downtime

You saw my to-do list(s), right?

SFGate-NoComments

The “comments” sections in SFGate (San Francisco Chronicle’s Web site) articles are disgusting, horrible, rude, homophobic (?!), racist and in every other way awful. I wanted a way to read stories on SFGate without even having to force myself not to look at the comments section.

Greasemonkey script

Greasemonkey is a mechanism by which arbitrary code can be injected into Web pages during load or after they are completely loaded. It’s available for almost every modern browser*. Some common uses for Greasemonkey scripts are adjusting font sizes and colors on pages where the Web developer apparently worked on a 30″ inch screen and has 20/10 uncorrected vision and the color sense of a three year old, removing page elements and otherwise enhancing usability of Web pages.

Userscripts

Userscripts.org is an online repository of thousands of user-submitted Greasemonkey scripts. I placed my script there when I first wrote it early this year.

How does it work, you ask? Pretty simple in concept, a real hair-tearer in execution. Using Greasemonkey scripts’ ability to access the structural elements of a Web page, and knowing (from examining the page source code) how comments sections are named and placed, my code goes through the DOM looking for specific items. When it finds them, it makes them disappear. This was made more difficult by the fact that SFGate is now using a third-party comments solution which loads after most of the rest of the page has already finished loading, so I had to make my code wait until the page, including comments, had fully loaded before executing. The result is that the comments links and sections do show for a second before disappearing, but I find that acceptable considering the outcome.

This was an interesting challenge for me and as usual, it was impossible until it became easy. I would be willing to look at extending or duplicating it for other sites with similarly offensive comments sections. Let me know in the comments below if you’re interested. Yes, I realize the irony.

*Greasemonkey for:

  • Safari/Mac: Greasekit** or NinjaKit. I haven’t tried NinjaKit yet.
  • Opera: Enable user scripts and point it to the directory where you’ve downloaded your scripts.
  • Chrome: Native support, just click “Install” from Userscripts pages.
  • IE: See links here. I haven’t tried any of these because I use IE only under extreme duress.

**Use this version of GreaseKit if you are on OS X Leopard. The current posted version was compiled for Snow Leopard.

Comments off

Block comments on SFGate.com

The “comments” section under every SFGate.com article is a cesspool (I’m not the first person to say this but I can’t immediately find where it was said first) filled with hate, bigotry, trolling and various evil. Sure, you don’t -have- to click through to the comments but SFGate helpfully shows the three highest-rated comments below [...]

The “comments” section under every SFGate.com article is a cesspool (I’m not the first person to say this but I can’t immediately find where it was said first) filled with hate, bigotry, trolling and various evil. Sure, you don’t -have- to click through to the comments but SFGate helpfully shows the three highest-rated comments below each article–and the worst, and most prolific, commenters have hacking scripts that artificially inflate their comments’ ratings. Here’s another view on SFGate’s comment section: link.

Feeling that “out of sight, out of mind” is a good policy, my first UserScript hides several DIVs associated with comments on SFGate article pages. Here’s the source:

// ==UserScript==// @name SFGate-NoComments// @namespace http://www.userscripts.org// @description Hide comments on SFGate.com articles// @version 0.2// @include http://www.sfgate.com/*// @copyright 2010+, Andrew Rich (http://www.project-insomnia.com)// @license (CC) Attribution Non-Commercial Share Alike; http://creativecommons.org/licenses/by-nc-sa/3.0/// ==/UserScript==

var commentsDiv = document.getElementById('commentspage');commentsDiv.style.display = 'none';var commentslinksSpan = document.getElementById('commentslinks');commentslinksSpan.style.display = 'none';var commentBoxWrapperDiv = document.getElementById('articlePageCommentBoxWrapper');commentBoxWrapperDiv.style.display = 'none';var recCommentsDiv = document.getElementById('sfgate_recommended_comments');recCommentsDiv.style.display = 'none';var commentsListDiv = document.getElementById('commentslist');commentsListDiv.style.display = 'none';var commentsContainerDivAttrs = document.getElementById('Comments_Container_viewall').attributes;commentsContainerDivAttrs.getNamedItem('class').value = '';var commentsContainerDiv = document.getElementById('Comments_Container_viewall');commentsContainerDiv.style.visibility = 'hidden';

I hope this is useful to you and thank you for reading. You can install it easily from the UserScripts.org link above. Tested in Safari 4.0.4 (5531.21.10) with GreaseKit 1.7 on Mac OS X 10.5.8 Build 9L30. Should work in other UserScript-supporting browsers (Firefox, Opera, Chrome “Dev Channel”) without issue.

Comments off

Confessions of a Switcher (part 3)

This is part three of a theoretically infinite series. It’s been roughly five months since I brought home the MacBook Pro and almost that long since my last update to this series. I’ve become incredibly comfortable in the OS X environment and, with a very few exceptions, can do anything I ever did in Windows. [...]

This is part three of a theoretically infinite series.

It’s been roughly five months since I brought home the MacBook Pro and almost that long since my last update to this series. I’ve become incredibly comfortable in the OS X environment and, with a very few exceptions, can do anything I ever did in Windows. In the event I do need Windows, I can use VMWare Fusion to boot Windows XP from a Boot Camp partition with seamless desktop integration. Just today I found a solution to one of the last Windows requirements — syncing my HTC Mogul phone, a Windows Mobile device. Normally one would use ActiveSync to sync a Windows Mobile device, or pay $30 for Missing Sync. I’ve found a free product that does exactly what I need and no more: Eltima Software’s SyncMate. It syncs my contacts and calendars to the Mac’s Address Book and iCal, respectively, and can mount the WinMo file system as an external volume on the Mac for file transfer.

Here’s a current list of third-party software I’m using.

  • Angry IP Scanner — the built-in Network Utility has most of this application’s functionality; I use either or both depending on what exactly I’m trying to do.
  • Book Collector
  • ChronoSync — I haven’t actually started using this yet, but I’ve installed the trial and am checking it out.
  • CrossOver Office — supposed to allow (some) Windows applications to install and run directly in OS X, but I’ve had little success as of yet.
  • Fetch — seems to be the best ftp client for OS X.
  • Google Earth
  • Jolly’s Fast VNC — even in public Alpha, this is the best VNC client I’ve found for OS X, and (apprehensive of using an Alpha) I tried quite a few before this one. Does what it says on the tin.
  • Logitech Harmony Remote software — Web-based programming tool for my Harmony 880 and 670 universal remotes.
  • Movie Collector
  • NetNewsWire — my choice for RSS newsreader. I started with the built-in Mail application, but it couldn’t handle 200+ feeds with any stability; I tried Endo and gave it a couple of months, but eventually gave up on it after one too many crashes and system resource grabs — plus, its UI is a nightmare. NNW does what I want and does it well.
  • OpenOffice.org — the excellent free, open-source alternative to Microsoft Office I’ve been using for years, now in a spiffy new OS X-native version.
  • Opera — if you’ve been reading Project Insomnia for lo, these many years, you know I’ve been an Opera fan for quite a long time. Since switching to Mac I’ve converted almost completely to Safari. I keep Opera around for alternate-browser testing and also use it when I need to have more than one Google Account session open simultaneously, but it’s pretty much fallen off my radar in general.
  • Remote Desktop Connection — the only Microsoft software on my OS X partition is a fine port of the standard RDC client.
  • SketchUp — nifty 3-D sketching tool which I have so far been completely unable to learn. I’d like to use it to model the cabinet wall we want to build in the living room.
  • SplashID — password vault, works with the Mogul to keep all my many and varied passwords safe. Syncing SplashID between the Mac and the Mogul is one of the very few remaining tasks for which I still need Windows; the Mac version doesn’t sync directly but only imports saved files.
  • SyncMate — see above.
  • TextWrangler — this is a terrific text editor that handles code of all kinds, from PHP to HTML to Java.
  • TinkerTool — essentially the OS X equivalent to TweakUI.
  • Transmission — BitTorrent client.
  • VLC Player — for the rare filetype that QuickTime + Flip4Mac can’t handle.
  • VMWare Fusion — see above.

I’m assembling a list of useful tips and tricks, things I’ve learned by trial and error or lucky Googling. That will probably be the subject of part four of this series.

Comments off