OSX Spotlight – Filter “Safari history item” and mailboxes

Most folks browse the web and some do so often. This creates a history which Safari conveniently stores for future reference. The feature is especially useful when you go to “History -> Show All History”.

What isn’t so useful is searching for a file and receiving thousands of results for “Safari history item”. This shouldn’t be an issue because there is an option to remove “Safari” from Search Results, however, this option fails to remove Safari history items from Spotlight search results.

To disable Spotlight from searching “Safari history item”:

  • Open System Preferences, go to Spotlight and click on Privacy pane
  • open a new Finder window
  • browse to <home> /Library/Caches/Metadata/Safari
  • Drag and drop “History” folder from Finder to Privacy pane
  • Filtering Specific Mailboxes: browse to Library/Mail/
  • Find offending .imapbox, .mbox, or any other; drag and drop onto Privacy pane

As far as I can tell you can filter many of the Spotlight searches by adding any of the folders in Library/Caches/Metadata. Here is what my Privacy settings look like:

 

Spotlight Privacy Filter
Spotlight Privacy Filter

Hopefully you made it here and didn’t see this:

failed search

OSX Spotlight – Filter “Safari history item” and mailboxes

Apple only poised for Enterprise

As I began working this evening I realized I haven’t backed up my laptop in a few months. In fact, three months ago I backed up to a system which recently crashed. I lost data and freaked out a little and losing my laptop hard disk right now would be bad. After hearing about someone’s laptop being stolen I can’t procrastinate any longer. So what am I going to do about it?

Well, after purchasing two 500GB USB drives and a Time Capsule, I’m going to connect some cables and CLICK FOUR TIMES. Then every month I’ll CLICK FOUR TIMES, swap out one of the 500GB “archive” drives, then take the other off site. For less than $500 and 52 clicks a year I will have “secure” historical backups of my laptop.

This does NOT happen in IT.

With a business of 5-50 employees and non-Apple systems, secure offsite backups will cost anywhere from $3-30k worth of software, hardware, media, and/or bandwidth. There are valid reasons for the costs, however, once a solution is in place you maybe looking at paying for a full time employee which will cost much more than four mouse clicks.

While seemingly far-fetched, there are few differences between backing up my laptop and backing up a business; let’s keep in mind that no matter how much data is involved, the process of securely backing up, storing, and restoring data is the same. The backup life-cycle consists of transferring data to offline media, archiving, restoring, and retention. Upfront costs are typically associated with how much data you have and the recurring cost correlates with your retention and archiving policies. What a business adds in complexity is gathering data for backup, as the data may reside on multiple servers and/or desktops. The second complexity a business adds maybe proprietary software which requires additional licensing to efficiently backup data without downtime.

Unfortunately at this time there isn’t a four click backup solution for IT in small or enterprise businesses. Backups are costly and complicated. Moreover, while you can deploy Time Machine for all Macs, not every machine is a Mac and servers typically run Windows or Linux. So, while Apple has done a great job of solving the task of backups by integrating the service into their OS for free, they have not solved what is still a significantly difficult task in IT. Apple is poised for the enterprise yet continues focusing on consumers. Considering all the new avenues Apple has ventured in the last five years — Aperture, AppleTV, iPhone w/Exchange support, iLife/FinalCut/Logic, iTunes, iWork, MobileMe, Shake, and Time Machine — I have to ask myself why Apple remains out of the enterprise?

Apple only poised for Enterprise

Surveys, DNS, and Your Brand

In the last 6 months I have received and/or completed surveys for the following:

  • Purchasing a new car (2 total; Dealer – Auto Nation and BMW Assist)
  • Sun Microsystems CommunityOne event
  • Nine Inch Nails (yes, the band — I purchased the new album by naming my price)
  • PayPal ‘Phone Handling Opinion’
  • Microsoft Feedback Program
The surveys came as links in emails and were provided by 3rd party companies such as Auto USA (not a dealer), comScore, Customer Sat, Benchmark Portal, Zoomerang, and Question Pro.
This reflects poorly on these brands and immediately causes me to associate them with ‘spam’. Fortunately I know better – dynamic DNS isn’t easy, outsourcing surveys to another company is cheap, and I was cognizant of events which triggered a survey. Only when buying a car and participating in Microsoft’s feedback program did I “opt in” to receiving these surveys. Microsoft and the car dealership (BMW of Dallas) both notified me of the surveys before I received them.
None of the surveys were sent from an email address I recognized and none of the email messages had links to a domain I recognized. Sure, the emails had links to the respective company, however, any teenager with a godaddy account could produce the same result.
All of the surveys were ugly or lacked respective branding. How am I suppose to know any of these surveys are genuine?
The irony here is that companies spend a significant portion of their revenue on their brand and customer service only to outsource their only feedback request to survey systems which are ugly and don’t appear genuine. This easily lays to waste all of the value created by building the brand in the first place.
To me, a brand exists for two kinds of persons – your customers and everyone else. Which one is most important? If you only care about revolving business and not keeping recurring revenue from long-term customers then it is obvious you don’t need to care about your customers and can focus only on everyone else. This can work great for three years but sooner or later people are going to figure out you suck — and say so on the Internet for millions to read. If you’re looking for long-term recurring revenue from customers who come back on a consistent basis then you will be more interested in their feedback so you can improve you products, business model, and continue satisfying your customer.
Surveys seem now, to be one of the first chances a customer gets to give feedback. Shouldn’t you make the customer feel safe, secure, empowered, proud, and vocal to be submitting feedback about your brand, company, and products?
The answer is obvious, yet, none of the surveys I mentioned so far gave me such an impression. One company has this year, and I was surprised. The company was Blizzard for their game, World of Warcraft. There was a discrepancy in the game and I opened a ‘ticket’ which was resolved and I was informed I would receive a feedback request. Blizzard did everything I would expect:
  • Notified me ahead of time I would receive an opportunity to give feedback
  • Sent notification from an email address with a domain I recognized
  • Feedback questionnaire resided at a domain I recognized
  • Questionnaire site promoted company’s brand and assured me I was at the right place
  • Questionnaire gave me the opportunity to leave free-form comments
After looking around I found a few survey sites who easily enable you to integrate your site with their survey system — all you have to do is point DNS at their service. Of course it’s not free, but if you really care about what your customer thinks then it’s worth the price. Surveygizmo seems to offer the service for $159/mo — I can’t vouch for them, but it’s the first one I found who listed DNS as a feature. Coupled with some CSS and any standards-supporting web designer it’s not difficult to help your customer feel comfortable about answering your questions.
With all of that said, my best experience giving feedback as a new customer is when I opt-in and receive a courteous phone call where I’m also able to give commentary. Talking to a human being gives me more confidence and being able to tell them how I really feel gives me the impression somebody is listening.
If you’re genuinely interested in what your customers have to say then be sure and make it appear that way. When it comes down to email-initiated surveys, the delete key is all it takes for anyone to forget you care.
Surveys, DNS, and Your Brand

iPhone purchase “Experience”

I picked up an iPhone yesterday and was rather lucky in doing so.  I learned a bit about the lines as well, which I’m sure has been blogged about enough already but I didn’t find anything with a quick google search. Moreover, my experience at the Apple store at Knox Henderson could be different than those of others or those who have opted to work with ATT.

I called the Apple store yesterday around 1815 and actually assumed they were out of stock. My question was along the lines of “Hi, do you know when you will get more phones and when I should be there to have the best chances of getting a new phone?”. To my surprise her answer was that they had phones in stock and I should arrive ASAP if I wanted one. I then kindly asked my friend, who was driving, to haul ass to the Apple store.

When I arrived there was a small line outside the Apple store. I entered the store and asked someone about the line and what I should do because I could see people holding white vouchers and I didn’t want to get in line for nothing. The associate stated they’d given out the last voucher and would be giving out no more; at this point I stated I was very disappointed would not have wasted my time if a representative on the phone had not told me there were phones in stock.

As it turns out, the vouchers were being given out because the purchase and activation process takes so long. Apple is personally selling, activating, configuring, and answering questions for EVERY SINGLE iPhone customer. As it turns out, they limited the number of vouchers because there wasn’t enough time in the day, not because they were out of stock.

I do have one suggestion. Find an Apple store in a Mall so the line outside the store is indoors and air conditioned. It got up to a lovely 103F yesterday and sweating outside isn’t much fun. We tried to buy margaritas to drink while in line but forgot it’s illegal to leave a restaurant with a drink.

Last but not least – it seems all of the ATT stores in Dallas are only fulfilling pre-orders and they are not expecting store shipments for 10-21 days (…which grew from 3-5 days)

So in conclusion, your chances of a getting a phone at this time is random, the lines are BYOB, and the wait is because of the stupid in-store-only activation process.

iPhone purchase “Experience”

TextMate and Logitech Control Center (LCC)

If Logitech’s control center decided to start messing with TextMate, getting weird errors such as those found here, below is simple fix:

Delete the “LCC Scroll Enhancer Loader” folder from `/Library/InputManagers`; it also wouldn’t hurt to delete the LCC scroll enhancer bundle from `/Library/Application Support/Logitech`

Unless you are very picky about scrolling, and Apple’s built-in scrolling options aren’t good enough for you, then this solution is much more sensible than removing LCC altogether. As a quick note, you’ll know if you’re having this particular problem if you see “May 13 13:56:02 hostname <Application>[287]: LCC Scroll Enhancer loaded” in /var/log/system.log, for every application you open.

Thanks to max.goedjen and the folks over in this Growl Discuss thread. If you’re like me and just searching for just TextMate… you might not have found this.

TextMate and Logitech Control Center (LCC)

PHP4 + PHP5 compatible overloading

While I don’t necessarily enjoy PHP, it’s not such a terrible language. At least for version 5. Lately I’ve been working on a project called ‘migrations’ which is essentially a PHP utility to generate / track / apply changes to a database in a similar fashion to the migrations system in Ruby on Rails. Of course, it’s got more magic than migrations (only because we know we’re going to use subversion) and it’s got to work with PHP4.

Let’s get back to the subject though. When writing any type of class that needs to be polymorphic or ‘dynamic’ in a sense that method calls can be made when a pre-defined method doesn’t exist, then ‘overloading’ is the magic PHP provides to satisfy your needs. As a note, polymorphism is simply the ability of a method to take varying parameters or by which a different method will be executed based on the types and/or quantity of methods required. For example, you could have a different method defined for function($array) than function($string). PHP doesn’t care about types and so doesn’t support polymorphism per se but by using overloading you can essentially accomplish the same thing. In my case however, I’m simply wanting to allow execution of non-existent methods against on object. The purpose is that I want to be able to log each method call and it’s result in order to track what’s going on. You’ll quickly see what I mean in the examples.

PHP5 Basic Example:

class dynamicClass {
    function __call($method, $arguments) {
        trigger_error('Call to undefined method ' . __CLASS__ . '::' . $method . '()', E_USER_ERROR);
    }
}

Now have a class in PHP5 with overloading enabled. Without trigger_error, PHP will always think that you’re calling a valid method! In PHP5, there is no way to tell the interpreter the called method is invalid and you are responsible for triggering an error.

PHP4 Basic Example:

class dynamicClass {
    function __call($method, $arguments, &$return) {
        if($method == __CLASS__)
            return true;

        trigger_error('Call to undefined method ' . __CLASS__ . '::' . $method . '()', E_USER_ERROR);
    }
}

 
In PHP4, overloading was experimental for awhile and is now not well documented because it changed so much in PHP5. The first two lines of the __call method exist because the class doesn’t have a constructor defined but we don’t want to return false or null – if we do – PHP will throw a warning that we made a call to an undefined method, as it tries to call the non-existent constructor. Without overloading PHP4 ignores non-existent constructors, however, since we’ve overloaded and the constructor doesn’t already exist – PHP4 hits __call. This is different from PHP5 wherein PHP5 will not try to make an overload call for any constructor. This is likely because in PHP5 constructors or pseudo-static methods (they are not called within the context of an object even though the constructor has access to the object – this is why you get to use the $this variable even in a static context – if you couldn’t PHP5 constructors wouldn’t work ;) )

So between these two examples we can see some obvious limitations.

  1. don’t use overloading for anything regarding constructors
  2. php4 uses &$return declaration for return, php5 uses return()
  3. php4 is the exception, not php5; php5 autoload will work just fine
  4. in php4, you’re class is limited to being declared from within an eval() block

This makes for complications if you want to create a class with overloading which will work both in PHP4 and PHP5. There is the safe way, not-so-safe way, and the somewhat-safe way that’s a little slower! First, I’ll show you the not-so-safe way which I’ll be using simply because this is a utility and not something I expect someone to modify and secondly because integration tests tell me if/when something breaks. If you don’t write tests I would highly recommend the ‘safer’ way.

File – dynamicOverloaded.class.php:

class dynamicOverloaded {
    function __call($method, $arguments /*PHP4, &$return*/) {
        /*PHP4if($method == __CLASS__) return true;*/

        // You're overloading logic

        $return = $resultFromYourMagic;
        return ($return ? $return : true);
    }
}

You maybe asking yourself now “wtf” or “how is that supposed to work?” and you would be right – it’s not going to work yet. In order to make this work, you can’t require() or include(), or otherwise execute this file. Unless of course, the version of PHP is >= 5, in either case, the following code will do the trick.

The not-so-safe way:

if(substr(PHP_VERSION, 0, strrpos(PHP_VERSION, '.')) < 5)
    eval('?>' . preg_replace('|/\*PHP4(.*?)\*/|', '\\1', file_get_contents('path/to/dynamicOverloaded.class.php')) );
else
    require_once('dynamicOverloaded.class.php');

As with any php script, you have to include it. But in this case we’re eval()’ing the contents of the file instead of including it when using PHP4. Before eval we’re stripping /*PHP4 */ comments and leaving the code within it intact. The result? It’s like pre-compile macros for PHP. This is called the not-so-safe way primarily due to all of the limitations and bugs from eval().

But what is the safe method, and what if I’m doing something eval() doesn’t like?

In this case, you want to change your code to check for the version of PHP – create one class called yourClass.class4.php and yourclass.class.php; if using PHP4… you get the idea. Make your require() statements dynamic. The class4.php script will have the same code but you’ll remove the /*PHP4 */ comments before you save the file (leave the code between the comment markers in place). As you can see the real trick is to have your classes declared in separate files. The problem with this and the reason it’s not called “safe” is because you’re going to have to keep your changes to the class synchronized across both files at all times! While annoying, you can be happy know that you’re not eval()’ing code or executing temporary files.

But what if I don’t want to have to keep changes synchronized between class files and I don’t mind it being a tiny bit slow?

Before requiring the class file so you’ll want to name the base class yourClass.classX.php with the /*PHP4 */ blocks of code in it – before performing require() you literally ‘compile’ the class by running the preg_replace and saving the result to a temp file on disk; then require() the tmp file and delete the tmp file. Now obviously there can be some risks associated with executing a file which is written to disk by the executing process (esp if it’s a web server) but you can do a few things such as making the file name random to mitigate risks. Whatever you do, be sure the temporary location is relatively safe (consult chmod man page) and that above all the generated script is deleted after it’s executed.

PHP4 + PHP5 compatible overloading

Top Ten – No Background iPhone Processes

First of all I have to say I loathe the idea that Apple is not allowing background processes (per their documentation). Not to say Apple won’t change those provisions, but as-is, I don’t agree with disallowing background processes. On to the list (no particular order):

  1. mac worms (the kind that would spread across macs and iphones)
  2. making your iPhone a social communications device, for free
  3. p2p could be used to download and share music, for free
  4. battery life decreased more than 60 seconds
  5. turning iphone into free wifi hotspot takes away from ATT/Starbucks hot spot access
  6. cause ATT to discontinue distributing Apple revenue (due to #2, #3, #5 above)
  7. it would compete with Apple’s upcoming “iGPS”
  8. the SDK is really only for making games; Apple makes the real apps
  9. the device would be considered a weapon and be disallowed exportation
  10. iPhone can be used as a guidance control system for ballistics
Personally, I think if Apple were smart, they would realize how much running down a battery would cause folks to buy extra chargers for their car and work place. Oh well.
Top Ten – No Background iPhone Processes

OpenSolaris: Just call it “Open Source”

Genetic Open Source doesn’t sound too bad.

When it comes down to it, nobody knows what Sun is doing with OpenSolaris. No different than any other company which must reinvent itself every five years, Sun is changing the way they do things. What’s different is that open sourcing a product creates an irreversible social event in the lifecycle of the product being released.

What’s difficult is that we’re all so used to Apache, BSD, Mozilla, and MySQL – other open source systems which have been around for more than a decade. Not only do these products have maturity in their communities but the products themselves are mature. While Sun has a mature product with OpenSolaris, the product is a newborn to open source.

Let’s also not forget that Linux is still just a kernel. OpenSolaris should be considered with regard to suse and redhat rather than Linux. And while yes, kernel development is being done with OpenSolaris, that is not relevant to the inevitable result of a community developing an Operating System and not just the kernel.

Sun is putting their OS out there and saying “hey, we’re putting our code where our mouth is, now you can too”.

If it’s anything like Mozilla, let’s not forget Firefox was a rebel project (called Phoenix); as such, I doubt we can expect anything out of OpenSolaris from Sun, the company. The best we can expect will be from a side project which Sun may or may not take under it’s wings. Neither was possible before.

Regarding TCO report and Suncritters, let’s not forget that, Sun has to make money too. The only thing RedHat has that Sun doesn’t is experience with an open source operating system. One question worth asking in that context is, what type of support did RedHat provide when it first started? The answer is free and by mailing lists; then RedHat became commercial (<1yr) and of course has 24/7 support now. OpenSolaris is a new OS for Sun, relative of course – Solaris has been around awhile, but as an OS built through-and-through by a community, it’s new. In fact, as you’ve pointed out – OpenSolaris doesn’t have a large community yet other than Sun engineers – why are your expectations so high (link)?. Moreover, TCO analysis is all crap with regard to open source and ‘end users’ typically don’t understand any better. How many folks who download open source actually modify the code? Last, the linked survey is from 2005 and not to be a chump, but, Open Source has exploded and changed dramatically since that survey. Firefox wasn’t even big yet and MySQL 5 was still beta.

Organic or not, marketing or not, community or not, OpenSolaris is still an open source Unix operating system. Open sourcing code is great, no matter how it’s done.

Let’s just call OpenSolaris “Open Source”.

OpenSolaris: Just call it “Open Source”

Coding like it’s 1999

Here is my top ten list of “How to code like it’s 1999”:

1. using PHP < 5.3 (4 was beta in 1999)
2. making use of perl for *anything* (see #4)
3. template engines (scope and variable interpolation exist for a reason)
4. Perl6 (active 1999 mailing list)
5. Java Web Applets
6. SELECT * FROM (seriously, get ORM, select only what you need, or quit your day job.)
7. lisp (like a hero from a classic book, tragic)
8. non-functional redirect pages (hello js or location header; good-bye bad knocking off a lame phpbb feature)
9. ActiveX plug-ins (who developers sites with IE, anyways?)
10. SOAP (all your interoperability are belong to SOAP)

In short, if your core application for which your business and revenue suffers any of the above atrocities, step back for a minute and ask yourself if you really know any better? If you don’t, hire someone who does – FAST!

Coding like it’s 1999

Re: What Sun was trying to do with OpenSolaris

 

OpenSolaris vs Conceived Intentions

As from /., Ted at thunk.org has compiled a rant postessay” with regard to Sun’s OpenSolaris community.

About Ted:

I’m a systems programmer working at IBM. This allows me to get paid for what I used to do for fun, which is definitely neat hack. I’ve worked on the Linux kernel since 1991, and am probably the first Linux Kernel developer in North America. I am currently on the board of the Free Standards Group, as well as Usenix, where I organize the annual Linux Kernel Summit, which brings together the top 75 Linux Kernel Developers in the world every year. The Kernel Summit takes place in Ottawa, Canada, right before the annual Ottawa Linux Symposium.

Ted mentions Roy’s watching the ripples post, which is a great infomercial on day.com and it’s “open source” developers and their “closed source” CRM; criticizing Sun is all the rave and there are no substantial suggestions for what Sun should do with regard to Sun’s community. I won’t bother mentioning Ted is a Linux developer working for IBM and complaining about Sun. While entertaining, I would much rather see fights between the PostgreSQL and Sun’s MySQL folks just because I like to mis-pronounce PostgreSQL and MySQL is quirky.

I really don’t understand the blanket criticism. Somebody please let me know. Comments about trademarks = delete. It’s Sun’s toy, ok? If they want to share it, it’s up to them as to how and who they want to share it with. If Sun screwed you in some way, their execs are being open source media whores, or you’ve just gotten shit from Sun (and I don’t mean a 1996 newsgroup post), then please do tell your story. Complaining about Sun not liking your idea is about as entertaining as adopting a new Linux task scheduler or arguing over the transactional functionality of MySQL TRUNCATE command.

Open Source (Linux) vs. Open Source (Sun)

Let’s get back to the topic of “open source” – the synthetic kind. Since blog posts are essays now, and comments are syntactic qualifications which require research and justification, I’m going to throw a new term out there. Please use wikipedia, google, or anything else you would like to verify this newfound term, invented right here, and today – “Synthetic Open Source Community“.

Personally, I think non-organic is a little raw and vague – is it alien, poison, silicon-based? Synthetic works because while we’re not dealing with chemicals, we are dealing with “Computer Science” and we might as well qualify open source developer contributions in tandem with corporate oversight as flaming a chemical process.

So let’s not call Sun’s OpenSolaris community non-organic, we’ll call it synthetic. Right now Sun is trying to get bang for their buck and they’re going to use “open source” to do it. Linux is “open source” and OpenSolaris is “open source”; in that aspect, OpenSolaris is ‘just like’ Linux. Not really, but where do you see any Sun exec expressing and/or advertising Solaris this way anyways?

If you’ve run across some poo-poo posts on OpenSolaris, I recommend two posts (below) by Stephen at RedMonk. He concisely sums up presents both “sides” of the “just like Linux” adjunct. The other place to look are the opensolaris mailing list archives. I would recommend `-trademark -legal` when searching so you get posts about OpenSolaris and not the trademark whining.

Linux vs OpenSolaris…Again: The Q&A

An OpenSolaris by Any Other Name: The Q&A

Re: What Sun was trying to do with OpenSolaris