Samuel Mullen What could possibly go wrong?

The Two Most Productivity Enhancing Scripts Ever Written in the History of UNIX

by Samuel Mullen

Posted on Oct 10, 2013

You’re not a slacker. In fact, you’re a pretty good developer who gets things done on time and done well. But sometimes you find yourself wasting time on that site again. You weren’t planning to go there, but the code takes a minute to compile and the tests take a bit longer to run and so you just flip over there while you wait.

Ten minutes later you’re still there, not thinking, just consuming.

And you berate yourself again for wasting time.

What you don’t need is some overlord application telling you you can’t access the internet for the next three hours. You just need a gentle reminder that you want to be productive.

Here it is. Two simple scripts. (go to the GitHub Gist)

One to block the sites you don’t want to visit:

function worktime {
  echo "# WORKTIME" | sudo tee -a /etc/hosts > /dev/null
  while read -r line; do
    echo " ${line}"
  done < $HOME/.blocked_sites | sudo tee -a /etc/hosts > /dev/null

And one to remove the block:

function slacktime {
  while read -r line; do
    [[ $line =~ "# WORKTIME" ]] && flag=1
    [[ $flag -eq 1 ]] && continue
    echo $line
  done < /etc/hosts > /tmp/hosts
  sudo cp /tmp/hosts /etc/hosts

List the sites you don’t want to be visiting in .blocked_sites in your $HOME directory. Like this: # you may need to include the www subdomain

When you want to be productive, run worktime. When you’re ready to slack off, run slacktime.

worktime adds those sites to your /etc/hosts file redirecting you back to localhost. If you’re feeling creative, make a landing page with a picture or text reminding you to keep been awesome. I use a picture of R. Lee Ermey to gently remind me what I’m supposed to be doing.

When you’re done being productive, run slacktime. slacktime just removes the entries which were added to the /etc/hosts file.

So are these really the two most productivity enhancing scripts ever written in the history of UNIX, or am I just using a bit of hyperbole to increase traffic? Probably the latter, but I still hope I help you become more productive.

Now quit slacking off and get back to work!

Read More

thirty minutes a day

by Samuel Mullen

Posted on Apr 14, 2012

Thirty minutes doesn’t seem like much time, especially for programmers. It takes that much time just to get into the “zone”. It takes at least that much time just to research some libraries or problems. You can read a chapter of a book in thirty minutes, but can you imagine working on a project for only thirty minutes a day?

But if thirty minutes a day is the only amount of time you have, the question changes from “can you?” to “do you want to?”.

I get around thirty minutes to myself in the mornings before my family wakes up and I have to get everyone ready for their day. For a long while I used that precious amount of time to read blog posts, twitter, email, or pitter it away in some other manner. I’ve not done that this year.

Since January, I’ve used those thirty minutes to write ten blog posts and read three books. It doesn’t sound like much, but if I were to keep up that pace, I would have forty blog posts written and 12 books read by the end of the year. That’s not too shabby…If I were to keep up the pace.

I’ve been wanting to learn Backbone.js for a while now, but the free time I have during the rest of my day involves my family. The only time I have is my thirty minute window. So I’ve decided to use that time to work on a project using backbone.

I won’t have time to write - although I have found time this Saturday morning - and I won’t have as much time to read, but I really want to learn backbone.js.

I get thirty minutes a day. It’s not much, but it’s mine, and it’s not wasted.

Read More

Obey the Tomato

by Samuel Mullen

Posted on Jul 27, 2010

In “Star Trek VII: Generations” - awful movie, in spite of Kirk getting killed (odd number, don’t you know?) - a freak accident ripped the big bad guy, Dr. Trolian Soran (Malcolm MacDowell), out from a dimension of tangible joy and happiness, called the Nexus. Dr. Soran is so consumed with getting back to the Nexus that he bends his entire will and life towards achieving that end, and is even willing to destroy a star and the surrounding habitable planets in order to do so. The movie revolves around keeping him from getting back to the Nexus, but that, really, is irrelevant for our discussion.

We’ve all experienced glimpses of the focus which Dr. Soran had. It’s an enjoyable state where code, text, art, music, and thought flow freely, and the outside world, with all of its distractions, is held at bay. It’s a sort of Zen state of creativity. And like Dr. Soran, we desire to get back to, and remain in, that “Nexus”. I know I’m not alone in this.

Over the past few months, I’ve found it more and more difficult to find my nexus. I’m not entirely sure why; I just know that my motivation has waned and my productivity has suffered. I knew I had to do something, and that’s when I ran across “The Pomodoro Technique.”

The Pomodoro Technique was created by Francesco Cirillo while he was a student in the 1980’s. He found himself in a period of low productivity and challenged himself to “study - really study - for 10 minutes.” Using a tomato-shaped kitchen timer as a sort of “Time Tutor,” he found his path back to productivity and eventually showed others how to do the same thing. The tomato-shaped timer is the locus around which the technique revolves: Pomodoro is Italian for tomato.

The basic flow the Pomodoro Technique is as follows:

  1. You focus on a task (not necessarily completing it) for 25 minutes.
  2. At the end of that 25 minutes you take a five minute break during which time you think of nothing substantial.
  3. Repeat steps 1 and 2 three more times
  4. Take a 15 - 30 minute free-time break

A pomodoro (the 25 + 5 minute period) cannot be paused, broken up, or subdivided; pomodoros are indivisible. Substantial interruptions during that time negate the pomodoro and it must be begun anew. Smaller interruptions (internal and external) are handled by writing down anything notable and making a mark on the task at hand. 

There is, of course, much more which can be said about the technique, but that is handled better in the links provided.

Here are some of the benefits I’ve noticed in the three weeks I’ve used the techniques:

  • Increased productivity: Just by not allowing myself to check twitter, email, news, etc. and only focusing on the task at hand for 25 minutes at a time has really helped me pound out my tasks.
  • Increased Organization: Every morning I start by listing the things I want to get done and I just check them off as I complete them.
  • I’m not missing the little things: In the past, I’ve allowed random thoughts to side-track me. Now I just note them as things to follow up on and I get back to the task at hand. Later, when I have more time or in a pomodoro of their own, I follow up on the little things.
  • Increased usable time: Since I am pretty much scheduling everything I have planned, I feel like I can schedule in a pomodoro for things such as experimenting with an idea, reading up on new tech, and so on.
  • More willing to embrace the suck: the monotonous things (data entry, legacy work, manual processes, etc.) still suck, but you just schedule it in and plow on through. I’m more willing, but it’s still no fun.
  • Record of my progress: I use Google’s tasks app to track everything and it’s real easy to add new tasks, make tick marks, and check them off. Other services (or paper) work just as well. Now I can actually see how productive I am based on the number of pomodoros I complete
  • Time flies: Seriously. There have been numerous times when I don’t even hear the bell ring for the end of a pomodoro, or think, “Didn’t I just start this one?

Here are some of the weird things I’ve noticed:

  • I hurry to get things done within a pomodoro: This isn’t really a good thing, but I’m easing out of it.
  • Slow to start: at the beginning of the day, after lunch, or after a set of four pomodoros, it can be a little hard to get into a new set.
  • Mentally wiped: When I have a day of numerous pomodoros, I feel mentally numb.
  • Interruptions are more noticeable: I’m normally grumpy when I get interrupted during a task, but I’ve found I’m even grumpier when I have to nix a pomodoro on top of it.
  • Filling in the dead time: Not every task ends at the 25 minute mark and filling in the “dead” time by going back over what you’ve just finished seems silly at times.
  • My wife is afraid to call me: Not because I get grumpy, but she just doesn’t want to interrupt the pomodoro and get me off my stride. No, this isn’t a good thing.

The technique isn’t for everyone and I’d hate to force anyone to use it who didn’t want to, but for those of you who do, here are a couple thoughts to start out: 1) start simple: Don’t worry about all the metrics and whatnot which are discussed in the book. Just start with the 25 and 5 minute block, the four pomodoro set, and the task list. 2) Don’t expect to be checking off 12 pomodoros on your first day.


Read More

Please, Stop Interrupting Me

by Samuel Mullen

Posted on Sep 22, 2009

You’re a nice person and I really like you, but please, stop interrupting me. I don’t want you to misunderstand me, I’m not mad at you, but I do need you to stop. Every time you ask me to check out twitter, to read a blog post, or to strike up a conversation, I lose time. Time I could better spend by being productive and achieving my goals.

It’s not just the amount of time the interruption costs - which is in itself noticeable - but it is also the time it takes to “context switch”. I lose time because I’ve lost my train of thought, because I’ve lost momentum, because I have to find my groove again. It’s never just a minute or two, it’s always 10 to 15 minutes or more (1). And the more frequently you interrupt me, the harder it is for me to recover (2). “…programming is the kind of task where you have to keep a lot of things in your head at once. The more things you remember at once, the more productive you are at programming.” (3) But the more you interrupt me, the less productive I can be as a programmer.

Time is the most valuable of resources, and once lost it can never be regained. Men dream of becoming wealthy, but ruin themselves financially as they squander their financial resources away a nickle at a time. I too dream of being successful, but I can’t do it if you insist on distracting me; if I continue to lose my time minute by minute.

No more interruptions and no more distractions.

Alternative title: A Letter to Myself

Read More