January, 2012


31
Jan 12

What is We the People Good For?

Remember that Whitehouse.gov petition to investigate Chris Dodd and the MPAA for bribery? Well, the White House responded.

“…the White House declines to comment on this petition because it requests a specific law enforcement action.”

I have to ask then, what good is this petition system when the underlying system is fundamentally broken? Apparently asking for the current laws to be upheld exceeds the limits of the White House.


31
Jan 12

Off of Google Analytics and On to Mint

After my recent break-up with Google, I’ve had some adjusting to do. I’m taking it one service at a time.

Search

Calendar

Mail

Analytics

I don’t pay a lot of attention to the analytics for this site, but I do check about once a month out of curiosity and/or ego. I don’t know what to do with the information but it is interesting to see the ebb and flow of article popularity. As of last week, I’ve moved to Shaun Innman’s Mint analytics service. It’s a one time $30 fee and all of the data is maintained on my own site. I lost all of the historic data, but it’s virtually meaningless to me.

It was easy to configure for WordPress and provides more than enough information. I still have no idea what to make out of the information but it’s still interesting. And I get to cross off one more Google dependency.


31
Jan 12

Keyboard Maestro Time Tracker [Link]

A clever macro for time tracking by Rafael Bugajewski at Juicy Cocktail.


31
Jan 12

Makers and Takers

Two things I’ve linked to recently got me thinking. I really dislike most commentary on the web.

If you look through the kinds of things I link to, you’ll notice there’s a theme. I like people that make things and I disregard people that bitch about things others make. I love LeanCrew.com and BrettTerpstra.com because those are places that things get done. I’ve never read a complaint from them that was not followed by a solution.1 But there is something I see regularly through link-backs to this site that I find curious: People bitching about something being too difficult or complicated. But I rarely see those comments followed by a constructive suggestion for a solution.2 I know this isn’t a new trend. There’s always been a clear separation between Makers and Takers. There are almost supernaturally productive people like Shaun Inman, Dr.Drang and Brett Terpstra. Those guys are constantly cranking our great ideas and usually only ask for a pittance in return (if anything). Then there are the Takers. They are the vocal unchallenged masses. The bricks weighing down progress. The trolls.

The Takers are the people that make their way by complaining about other’s work. They seem to have imagined that they have an import roll to fill as world-critic. As if their critical eye is rare and their opinion is important. They are not. We have a wealth of critical opinions. I’m sure many of these same people think their witty repertoire is helping to make better products or solutions. I think that’s a delusion. What the world really needs is creators. People that toil away to make new and interesting things. Those are the people that make things better.

I’d like to make it clear. I love a good review or commentary. There are some very good sites that fill the roll of critical commentary outlets. Shawn Blanc and MacStories are two that come to mind. Shawn and Viticci run great sites that have good reviews. A good review is not a criticism. A good review offers pros and cons. It offers insights and thoughtful considerations. A good review is hard work and I always appreciate that. But I do not consider a litany of snarky commentary a review. Nor do I consider a list of complaints hard work.

I’m sure I’m guilty of similar conduct at times but I try hard not to criticize without creating something myself. If I do, feel free to call me on it.

And, perhaps for the first time ever, a quote by Ghandi and Nugent in the same context:

“You must be the change you want to see in the world” — Mahatma Ghandi
“Put up or shut up” — Ted Nugent


  1. Most of their complaints are self-critical anyway. 

  2. It doen’t take an engineer to suggest a solution. If a person can use TextExpander, then they have the skills to make technical solutions to interesting problems. 


30
Jan 12

Post to WordPress from Simplenote or Dropbox

Edit: See this updated post for enhancements

This is for all of you Markdown and plain text nerds out there. You’re my people.

I’ve been tinkering with a simplified mechanism for posting to this site. Most of my posts are started in Simplenote. If it’s a long post then I’ll work in BBEdit but the document still resides in my Simplenote/NVAlt/Dropbox folder1. When I’m done with a post, I’ll preview it in Marked and copy the html. I have a Keyboard Maestro macro that will post the html on the clipboard directly to Macdrifter.

However, if I’m away from home, I must post via the web on Windows or iOS. Neither is a great option. I have Brett’s MD Quicktags plugin installed, but it seemed like I could streamline the process a bit.

I’ve come up with a solution that lets me write in MultiMarkdown on Simplenote or Dropbox and automatically post the article when it is tagged with “post”.

Hazel

Hazel is the next level of folder actions. Hazel watches items in a folder and performs actions based on a defined condition. For some context, take a look at Eddie’s post on Practically Efficient. He has a very good introduction to Hazel.

I setup two Hazel rules. NVAlt supports Simplenote tags through OpenMeta extended attributes. The first rule looks for a file in my Simplenote folder to get the OpenMeta tag of “post” and makes a copy of the file to another folder. Importantly, the Hazel rule will not overwrite a file if it already exists in the destination folder. This is critical and I’ll explain more later.


Copy Rule

The second Hazel rule does all of the work. Once a new .txt file appears that has never been processed, Hazel runs it through a Shell script. Well, it’s a Python script run by Hazel’s embedded shell script action. Note how Hazel passes in the file path.

Hazel Script

Here’s the full script (you will need to provide your own WordPress connection credentials):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
python
import markdown
import xmlrpclib
import os
import sys

filePath = sys.argv[1]

#Connection details for the WordPress xmlrpc connection
wpUrl = 'WORDPRESS_XMLRPC_ADDRESS_HERE'
wpUser = 'WORDPRESS_ACCOUNT'
wpPass = 'WORDPRESS_PASSWORD'
wpBlogid = ''
status_draft = 0
status_published = 1
categories = ''
title = ''

# Create server instance
wpServer = xmlrpclib.ServerProxy(wpUrl)
try:
    myFile = open(filePath, "r")
    rawText = myFile.read()
   
    # Process with MD Extras and meta data support
    md = markdown.Markdown(extensions = ['extra', 'meta'])
   
    # Get the html text
    html = md.convert(rawText)

    # extract the title from the meta dictionary
    title = md.Meta['title']
    # title is actually a list
    title = title[0]
    # extract the categories but keep them as a list
    categories = md.Meta['category']

    # Only post if there is a title in the meta data. I don't want to hassle with parsing the file name.
    if title != '' :
        data = {'title':title, 'description':html, 'categories':categories}
        post_id = wpServer.metaWeblog.newPost(wpBlogid, wpUser, wpPass, data, status_published)
       
        # Pass the result for a growl message
        print data
except (RuntimeError, TypeError, NameError):
    # Make the error message as elaborate as you like. It's all right there in the exception.
    pyStatus = "Error"
    print pyStatus

The Script

I’ve looked at several Python options for processing Markdown and posting to WordPress but I’ve never been happy with any of them. Python is generally my weapon of choice, when I have one. I generally like to use as few odd-ball modules as possible to reduce maintenance overhead when upgrading or porting to another system. In this instance, I’m using the most common Python Markdown module to process the text. There are a couple very cool things with this module. First, it supports Markdown Extras like the ones I use in MultiMarkdown. This includes footnotes, code blocks, tables and meta data. The second is how it supports meta data. It can pretty much extract anything. In this example, I’m extracting the “title” and “category” fields but I could use date, author or just about anything I want. For multiple categories, I put each category on a subsequent indented line and the module knows they are all categories.

Once I’ve extracted all of the content, I then take advantage of another common Python module, the xmlrpclib module. This is the bit for getting the content posted. The xmlrpclib module also supports the necessary meta data for WordPress posts. For a nice overview of the same process I went through in coming to this conclusion, see Sami Slkosuo’s post.

I considered using the Python WordPress XMLRPC module but it looked like over-kill for my needs. I may yet use it to avoid double posting and make updating published posts possible. It’s very tempting.

Start to Finish

The new workflow looks something like this. I write as much as I want in MultiMarkdown in Simplenote/NVAlt. If I want, I preview with Marked. When I’m ready to post, I just add a Simplenote/NVAlt tag of “post” to the entry. The article gets published by my server at home without any other effort from me. Additionally, the Markdown version of the article is saved my archive folder for permanent reference.

There is a small catch though. Because I’m lazy and a bit squeezed for time I didn’t come up with a satisfactory way to avoid duplicate posts. I needed to avoid multiple posts of the same article if I made a small edit in Simplenote. If I accidentally make a small edit to an entry already tagged, It could get posted multiple times. The easiest solution I came up with is to not overwrite the file if it exists in my “Posts” archive. That way the second Hazel rule will not run a again.

I’m sure there’s a more complete solution that would save the post id returned from the initial post and keep track of it. Or maybe just check to see if I already have a post with that title and do an update if I do. I’ll get around to that feature when I get some more time. For now, I think this is pretty nice.

It’s not just the simplicity of the workflow that I like. I also like that I can twiddle a post for awhile in Simplenote without ever having to reload a draft from WordPress or log back in to the site. I can write and then when I am done (or tired of the subject), I can add the “post” tag.

TaDa!

This post made it to the site via this mechanism. If you’re reading this, then everything worked according to plan. 2 Ok, I’ve actually been using this method and tweaking it for awhile. If you’ve noticed odd unprocessed Markdown or other artifacts, then you’ve been part of this grand experiment. Thanks for your patience.


  1. I have my Dropbox notes folder syncing with Simplenote by way of NVAlt. NVAlt is always open on my computer at home and that computer is always awake. I’ve posted about that before. 
  2. There you have my secret. I don’t run a dev or test instance of this site. I’m making live changes like an idiot. 

29
Jan 12

Opinions [Link]

From James Altucher

Good article about opinions on the Internet.

My dad had a saying: Opinions are like ass-holes. Everyone has one and no one thinks theirs stink.


29
Jan 12

Archiving GMail

As I’ve said before, my goal is to get as far off of Google services as possible or reasonable. This past weekend, I migrated my primary mail off of Google. Here’s how I did it.

Mail Forwarding

Many people and services still use my GMail addresses. I have many. So I set each account to forward my to my new mail server. Google makes this easy. Just setup the forwarding account. My theory is that eventually any person or service I care about will catch up with the new address and in a year, I can abandon the GMail accounts all together.

Mail Archiving

This was less straight forward. I want access to the old mail but I don’t want to maintain the archive in Mail.app. I want to be able to search the archive when necessary, but I don’t want the messages showing up in my normal search results.

My solution was two fold. Have Mail.app download the complete Mail digest with attachments and then archive the messages and attachments with MailSteward.

Mail Steward will copy the messages and attachments into an archive file. More importantly, it will also index the messages for searching. That means when I want to find something in that old Google account, I can load up the Mail Steward database and perform a separate search. The majority of my searches will normally be through Mail.app but this Google archive is a nice backup.

Once Mail Steward is done indexing. I delete the Google mail box from Mail.app and move the Mail Steward archive off to my networked Drobo.

Searching a large Mail Steward archive off of a network drive is slow. That doesn’t bother me. I do not expect to need this option very often.

Address Book

Not a concern. I’ve never added contacts to GMail for fear of providing a spam index for Google. I don’t know if they currently do such things, but I have no idea where their business model is headed.


  1. Trust me, if you’re buying MailSteward then you want the $50 pro version. NOT the app store version. There are significant and important differences


28
Jan 12

Python Module for Growl [Link]

Pretty much what the title says. It’s a Python module for sending Growl messages.


28
Jan 12

Drang Decimals [Link]

I’m pretty sure DrDrang spends his free time exactly how I like to imagine. Like this.

That makes me happy.


28
Jan 12

MPAA Doesn’t Like the Internet [Link]

The MPAA mini-me boss by way of BoingBoing:

“This was a fight on a platform we’re not at this point comfortable with, and we were going up against an opponent that controls that platform.”


28
Jan 12

Just Archiving GMail

It’s not hard, but archiving a seven year old GMail account can be time consuming:


28
Jan 12

Useful Stuff [Link]

This is a great site for people that like to tinker with Python, Django, Web Services or just about anything.


28
Jan 12

MultiMarkdown 3.5 [Link]

I guess I missed this. Fletcher Penny posted MultiMarkdown 3.5 on Jan 7th. The interesting bit is that MD to XHTML has been replaced by MD to HTML5. I’m not sure why he didn’t just keep both option but you can’t stop progress.


28
Jan 12

Dropbox and Security, Again

Yes, the Dropbox security story is still lingering. Patrick Rhone posted an updated article about the FTC complaint recently filed against them for deceptive language in their privacy terms. Read it for yourself, but Patrick argues that all data is at risk so be cautious and accept it.

I don’t like the tone of the piece[1] but his advice is sound. Whenever I store sensitive data on Dropbox, I encrypt it myself before it is uploaded. I create encrypted sparse images that hold the files. They can be easily opened on a mac and used as any other volume. I tend to use Knox because it makes the whole process easy. Knox keeps a list of sparse images in a menu bar drop down and provides direct access to the disk compression utility. However, the images can be created, used and resized using the built-in Apple Disk Utility application.

These files are not accessible through iOS though which makes Dropbox less useful to me. Unfortunately Spideroak, which does provide real encryption, is not ready for primetime. It’s awkward and not well supported by third party developers. I’m watching it though, because I like their model better.

 

UPDATE: I guess Patrick decided to delete his post. Maybe because the referenced page is the original 2011 article from Wired. I’m not sure, but this post still tells the story I wanted it to. Encrypt your own data and do not rely on anyone else to do it for you; If you care about that sort of thing.


  1. I think the attitude that there is no expectation of privacy once someone agrees to use a service is a little patronizing. What Dropbox did was wrong and misleading. They admitted to it and now I don’t trust them. I still pay them money every month, but I also go out of my way to secure a lot more stuff on Dropbox and I use Dropbox less than I did before.  ↩

27
Jan 12

Power Search Without Google

Search on the web is more than just knowing the right words to search. It’s knowing how to use the engine behind the text box. Here are a few quick tips for getting better results, many of which are not possible with Google.

DuckDuckGo

As any respectable search engine should, DuckDuckGo (DDG from here on) provides site specific search. Adding the “s:d” flag to the query provides search results ordered by date. To narrow search results to only hits where the page title has the specified word, throw in the “intitle:” flag. Unlike Google which now promotes Google services to the top of results, DDG promotes hits that are more valuable to the user. For example, searching for an emoticon provides the actual definition through what DDG calls “Zero-Click Sources”.

Searching for Python datetime functions produces a familiar list of sites with relevance but at the very top, a StackEchange result is actually loaded as a preview because DDG already knows that StackExchange is an authoritative site and the the first result might be the most relevant. Equally impressive, searching for an Cocoa Touch function provides a zero-click result with the method definition.

python search

Putting in an acronym also provides very quick access to definitions. There’s no need to click and look any further if it’s a common definition I’m looking for. Looking for a drug by name also provides the chemical structure and a brief description. If I just need a quick sample of Lorem Ipsum, that’s easy too.

The list of zero-click sites is pretty broad. There are song lyrics, map results and Yelp to name a few. Try the Punchfork recipe search for a quick way to find food recipes. These are invaluable research tools.

DDG also provides some very robust decision making tools.

Gates

Bangs

DDG also provides what seems like a site specific search on the surface but is actually a more convenient search than Google would ever offer. Bang prefixes tell DDG to offload the search to a specific site. Rather than producing crawled pages, the results are loaded into the site’s own search engine. For example, searching “!python os.path.lexists” loads the Python documentation search results. Searching “!stackexchange python os.path.lexists” loads the results for stack exchange. No intermediate landing page with ads. No social network turds floating to the top. Just the search results on the site I wanted. A ridiculous number of site searches are available that makes DDG a great landing page. It’s as if Quix became a search engine.

Goodies

DDG also has a number of other little goodies like reversing the lettters of a sentence.

Finally, DDG has direct integration with Wolfram Alpha for factual data results.

Wolfram Alpha

Most people know Wolfram Alpha can be used to get a company profile that includes stock performance. But it’s much more than that. Wolfram is a factual search engine. Or as their tag-line says, it’s a computational engine. While it can solve complex math problems, it can be equally useful for playing Hangman. Wolfram can also chart flat data or provide a curve fit.

Wolfram can also eat away hours exploring trivial data like a list of exo-planets

Wolfram can provide very complex analysis from a simple query, like the odds of landing black in roulette.

Black

 

Wolfram is one of the best basic resources for doing development or design. Need a character code for “em dash” or the hex code for a color. How about generating a captcha from a specific phrase or testing the strength of a password.

Interested in information about a specific domain? Here’s the profile of this site. Compare that to a real news site like TUAW, which also shows a map of their HTML hierarchy.

Interested in moving to a new area? Check out the crime rates first.

There are less academic uses. Wolfram has access to cultural reference data as well. For example a detailed profile of Luke’s father or the Beatles.

To anyone with a new iPhone 4S, this is nothing new. Siri does most of its magic with Wolfram Alpha. What I find funny is that so few people use the same magic on their desktop.