Martin Brook http://martinbrook.posterous.com @Martin posterous.com Wed, 03 Mar 2010 15:09:00 -0800 Checkvist users: send tasks to your todo list via e-mail http://martinbrook.posterous.com/checkvist-emai http://martinbrook.posterous.com/checkvist-emai

Media_httpwwwmartinbr_ghltq

Here's a little script I wrote this afternoon to allow you to add tasks to your Checkvist todo list by e-mailing them to yourself (or having them e-mailed to you!) The script is written in Python, so you need to have Python installed on your system for it to work. Download the script here.

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
49
50
51
#!/usr/bin/env python

emailusername=''
emailpassword=''
emailserver='imap.gmail.com'
emailfolder='INBOX'
checkvistlogin='Tasks'
checkvistapikey=''
checklistnumber=0


class Checkvist(object):
def connect(self,username,apikey):
self.token=self.post('/auth/login.json', {'username': username, 'remote_key': apikey})

def addTask(self,checklist,task):
self.post('/checklists/%s/tasks.json' % checklist, {'task[position]': 1, 'task[content]': task, 'token': self.token})

def post(self,url,values):
import urllib2,urllib
url = 'http://checkvist.com'+url
req=urllib2.Request(url,urllib.urlencode(values))
response = urllib2.urlopen(req)
data = response.read()
return data.strip('"')


def email_to_checkvist(username,password,server,mailbox,cvusername,apikey,checklist):
import imaplib,re
i=imaplib.IMAP4_SSL(server)
i.login(username,password)
i.select(mailbox)
counter=0

c=Checkvist()
c.connect(cvusername,apikey)

typ,data=i.search(None,'UNSEEN')
for num in data[0].split():
typ, data = i.fetch(num, '(BODY[TEXT])')
tasks = data[0][1].split('\n')
# Mark as read:
i.store(num, '+FLAGS', '\\Seen')
for t in tasks:
if t.startswith('--'): break
c.addTask(checklist,t.strip())
counter=counter+1
return counter

n=email_to_checkvist(emailusername,emailpassword,emailserver,emailfolder,checkvistlogin,checkvistapikey,checklistnumber)
if n>0: print "%d items added"%n

Here's how I use this:

  1. I set up a gmail filter which looks for any incoming mail sent to my gmail address with +checkvist on the end (a very useful feature of gmail) and archives it, labelling it with 'Tasks' in the process.
  2. I installed the script on my server at home, and set up a cron job to execute it every 20 minutes.

When the script runs, it checks my gmail (via IMAP), finds any unread messages in the Tasks label, and converts each line of the messages to a task, which is then added to the top of my checklist. (If a line begins with a double-dash (--), it and any following lines are ignored, so as to avoid including my e-mail signature in my todo list). The message(s) are then marked as read in gmail. Nice and simple. Once you download the script, you will need to fill in the settings in the first few lines, to include:

  • Your email address and password
  • Your mail server (Gmail's server is filled in already)
  • The name of the folder (or Gmail label) in which new tasks can be found
  • The username and api key of your Checkvist account
  • The number (find it in the URL) of the checklist you want to add the tasks to.

If you include a due date on the end of the e-mail line, it will be converted as usual by Checkvist. If you find this useful, please let me know!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Sun, 21 Jun 2009 21:16:00 -0700 Thoughts on Unsheffield http://martinbrook.posterous.com/unsheffield-thoughts http://martinbrook.posterous.com/unsheffield-thoughts

Had my first experience of an unconference this weekend. An interesting event, although not as different to a traditional conference as I was expecting.

Media_httpfarm4static_puuel

Session at Unsheffield (Creative Commons photo by James Urquhart)

For those unfamiliar with the concept of an unconference, I refer you to Wikipedia's excellent definition. Unsheffield was based around the theme of 'Future users of cool technology' - focusing on the users, rather than the technology. Pretty cool. Plus, it was free to attend - really cool.

Format of the event

On Friday the event was kicked off with a selection of 'stimulus' talks which were intended to get people thinking about the theme of the conference. These used a '20:20' format - twenty slides, displayed for twenty seconds each (on a timer). Some of the speakers coped with this format better than others, but on the whole it was very good - it forced the speakers to be direct and 'to the point'. The only downside of this format was that there was no opportunity for discussion or questions after the talks, which felt a little odd.

The rest of the conference consisted of participant-generated sessions. Anyone could suggest and run a session on any subject they wanted to. This led to a wide variety of interesting topics - from some really cool stuff on Arduino, to a discussion on 'turning voyeurs into participants' (give them free cookies), to astronomy for geeks. The real strength of the unconference format, however, is that sessions can be generated on the spur of the moment, as a result of random conversations and ideas.

I wasn't able to attend on Saturday, which was a real shame - as it seemed like many of the most interesting sessions took place on that day. I'm particularly disappointed that I didn't get to Michael Heap's JQuery presentation. The Sunday sessions definitely had a slightly more hung-over feel to them. But they were also a lot of fun, and I found myself able to get involved in several discussions throughout the day. The people there were genuinely very warm and friendly, and definitely Geeks with a capital 'G'.

Media_httpfarm4static_eadle

Enjoying a session (Creative Commons photo by Neil Crosby)

Some thoughts...

The conference website was really an integral part of the whole event - it was great that volunteers were there to blog everything that happened at the sessions, but it would be even more awesome if the site was more of a wiki than a blog - after all, the whole point of an unconference is getting everyone involved. It would be great if everyone could get involved in creating online content too. (A forum isn't a flexible enough structure for that, in my opinion).

It was a little bit intimidating for first-time unconference attendees. I got the feeling that everyone else there knew other people at the conference, and this made it feel a little difficult to get involved at the beginning.

Would I go back again?

Absolutely yes! I got lots out of the sessions, and I met some very interesting people. I'm sure I will be much better prepared to get even more out of the event next time. I noticed that a number of people at Unsheffield seem to be serial barcamp/unconference participants, and I can certainly see why!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 17 Jun 2009 10:49:00 -0700 The speed of misinformation http://martinbrook.posterous.com/the-speed-of-misinformation http://martinbrook.posterous.com/the-speed-of-misinformation

I've been following the recent events in Iran on Twitter over the past few days, and have learned the following:

  1. Twitter is a great way to spread information to large numbers of people, very quickly.
  2. Twitter is a great way to spread misinformation to large numbers of people, very quickly.

A couple of examples? Ok.

Exhibit one: #iranelection hash tag is blocked

Media_httpwwwmartinbr_gcual

Early on Tuesday morning, tweets started appearing stating that the #iranelection hash tag was being 'blocked' by the Iranian government. Then, around 7am, this was retweeted by high profile twitterer @stephenfry (among others) and all kinds of craziness broke loose. It was three hours before he made a retraction, but by that time the damage was done - hundreds of Fry's 50,000 followers had retweeted him. It was still being retweeted 24 hours later. Of course, basic fact checking was not done here. From a technical point of view, there is almost no way that anyone could 'block' a hashtag, and logically, why would they bother? They're already blocking Twitter. The only way people in Iran can use Twitter is through a proxy, and that would get around any other blocking anyway.

Exhibit two: BBC website goes green

Media_httpwwwmartinbr_swfdc

This one is even more unbelievable. Later on in the morning, @victee tweeted:

The BBC homepage is green in support of Iran!

I guess she'd been to the BBC homepage (which randomly cycles through a range of different colours), happened to catch it on green, and was so excited about it that she just had to tell everyone straight away. This 'exciting news' was retweeted wildly, with everyone heaping praise on the BBC for their solidarity with the people of Iran.

Media_httpwwwmartinbr_doihx

Of course, it's unbelievable that the BBC would do this. One of their great strengths is the fact that they always try to remain scrupulously impartial when it comes to news. It's unimaginable that they would make such a major political statement on their homepage. But hundreds of tweeters didn't think that hard - and presumably, in most cases, didn't even bother to look for themselves - and this too was tweeted hundreds of times over several hours.

The moral of the story?

Unfortunately, people seem to put more value in 'being first with the scoop' than they do in being right. The problem is that once information is out there, it's very difficult (read: impossible) to take it back. So it all comes down to basic journalistic integrity. Do you use twitter? If you do, you're now a journalist. Congratulations. As a journalist, you have a responsibility to think before you publish. Always check your facts before you retweet. Especially if you have 50,000 followers.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Fri, 13 Mar 2009 15:47:00 -0700 Python snippet: check status of your Gmail inbox http://martinbrook.posterous.com/python-snippet-check-status-of-your-gmail-inbox http://martinbrook.posterous.com/python-snippet-check-status-of-your-gmail-inbox

Here's a tiny Python script to check the number of messages (total and unread) in your Gmail inbox.

(You need to enable IMAP on your Gmail account for this to work).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
def gmail_checker(username,password):
        import imaplib,re
        i=imaplib.IMAP4_SSL('imap.gmail.com')
        try:
                i.login(username,password)
                x,y=i.status('INBOX','(MESSAGES UNSEEN)')
                messages=int(re.search('MESSAGES\s+(\d+)',y[0]).group(1))
                unseen=int(re.search('UNSEEN\s+(\d+)',y[0]).group(1))
                return (messages,unseen)
        except:
                return False,0

# Use in your scripts as follows:

messages,unseen = gmail_checker('username@gmail.com','password')
print "%i messages, %i unseen" % (messages,unseen)

[Updated: fixed bug in the script, thanks to Josh]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 11 Mar 2009 14:58:00 -0700 Destroy the Earth in 6 easy steps http://martinbrook.posterous.com/destroy-the-earth http://martinbrook.posterous.com/destroy-the-earth

Nanobot

Nanotechnology can be scary. And entertaining! This amusing (and really well-made) video (via Boing Boing) tells you how to turn the planet into grey goo in 6 easy steps.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 21 Jan 2009 14:47:54 -0800 Checkvist in your browser sidebar http://martinbrook.posterous.com/sidebar-checkvist http://martinbrook.posterous.com/sidebar-checkvist
Media_httpwwwmartinbr_zgndh
Checkvist (http://checkvist.com) is an awesome todo list site. Actually, to suggest that the only thing it's useful for is todo lists would be doing it an injustice. You can use it for outline documents and lists of all kinds. I wanted to be able to see my todo list at all times - it keeps me focused. So when the creators of Checkvist announced the new mobile version of the site, I decided to load it into my Firefox sidebar. However, I then had a better idea - could I load the fully-functional, AJAXy Checkvist in the sidebar instead? All it needed was a few CSS tweaks to allow it to be resized to fit. Fortunately, the handy Stylish Firefox addon allows easy CSS tweaking. So I now have a fully-functional Checkvist todo list in my sidebar, and you can too. Here's how:
  1. Install the Stylish addon for Firefox
  2. Download my user style from userstyles.org
  3. Create a bookmark for your Checkvist list in Firefox
  4. Edit the bookmark's properties and check Load this bookmark in the sidebar.
And that's it. The only downside at present is that there's no way to cause the user style to only be applied in the sidebar - by installing it, you will also modify the appearance of the Checkvist site when loaded in your main browser window. Unfortunately this seems to be a limitation of user styles in Firefox. Let me know in the comments if you have a way round this.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Thu, 04 Sep 2008 15:45:09 -0700 Having trouble with Delicious bookmarks in Firefox? http://martinbrook.posterous.com/having-trouble-with-delicious-bookmarks-in-firefox http://martinbrook.posterous.com/having-trouble-with-delicious-bookmarks-in-firefox
Media_httpwwwmartinbr_tvneg
It turns out there's a bug in the latest version (2.0.95) of the Delicious bookmarks extension in firefox. I've been going crazy all week because my favourite tags haven't been available in the bookmarks toolbar. Well, fortunately it's fixed in the upcoming 2.0.99 release, but if you want to get bookmarking again right now you can download the updated version from the delicious-firefox-extension yahoo group. Just follow the instructions in this post at the delicious support forum. At last, I can be productive again! Update 16/09/2008: The newest version, 2.0.104, is now fully available and fixes this problem.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Mon, 28 Jul 2008 16:36:00 -0700 Sending email from a script with sendEmail http://martinbrook.posterous.com/sending-email-from-a-script-with-sendemail http://martinbrook.posterous.com/sending-email-from-a-script-with-sendemail

This is one of those rare gems - an open source program which is unbelievably simple, elegant and useful. It only does one thing, and it does it well. sendEmail is an email program for sending SMTP mail from the command line. It's written in Perl and doesn't use any external modules, making it perfect for a situation where you want something that 'just works'.

Getting it working

As an Ubuntu user, installing it was as simple as:

sudo apt-get install sendemail

There are also RPM and Windows EXE versions available at the site, as well as the source code. Once installed, just type sendEmail ... to see a breakdown of the command line options.

I wrote the following one-liner to allow me to quickly send a copy of something I'm working on to my gmail - perfect for keeping on-the-fly backups of scripts.

sendEmail -f example@gmail.com -t example@gmail.com -u "[send2gmail] $1" -m "File $1 attached" -a "$1" -s smtp.example.com:25

(Just replace smtp.example.com with your ISP's smtp server and pop your gmail address in place of example@gmail.com). I also use it to backup all of my subversion repos and mysql databases - encrypted of course - to my gmail account each night via a cron job.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Thu, 17 Jul 2008 13:42:49 -0700 Get control of your headers and footers in Firefox 3 on Linux http://martinbrook.posterous.com/get-control-of-your-headers-and-footers-in-firefox-3-on-linux http://martinbrook.posterous.com/get-control-of-your-headers-and-footers-in-firefox-3-on-linux I've just solved something that's been annoying me since I upgraded to the most recent version of Ubuntu. I had found that I couldn't (permanently) disable the printing of headers and footers when I printed web pages from Firefox 3. When printing, you are able to modify the headers and footers in the 'options' tab of the print dialog (below), but these settings don't seem to persist from one print job to the next.
Media_httpwwwmartinbr_cedms

 

The solution

After a bit of googling turned up nothing helpful, I had a poke around in about:config and found the following solution.
  1. Enter about:config in the address bar
  2. In the 'filter' box, type print_header
  3. You should see a list of matching config entries, including three generic entries: print_headercenter, print_headerleft and print_headerright and further sets of these three entries for each of your printers. Double click on each entry and delete the assigned value (see example below).
  4. Now enter print_footer in the 'filter' box and repeat the same procedure.
Media_httpwwwmartinbr_ggids

This should permanently disable the printing of headers and footers on all of your printouts. Of course, you can always selectively enable them when you want to. If it works for you, or if you have any other tips, please let me know in the comments!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Thu, 08 May 2008 14:24:00 -0700 Crazy scary volcano photograph http://martinbrook.posterous.com/crazy-scary-volcano-photograph http://martinbrook.posterous.com/crazy-scary-volcano-photograph

Media_httpwwwmartinbr_gmsfd

Now that is just scary. This volcano erupted in Chile a few days ago. The photo above shows rock, ash and ice particles colliding to create massive electrical charges in the atmosphere, and hence lightning. Looking at this picture reminds me of the smoke monster in Lost, only MUCH BIGGER and ACTUALLY REAL. Read more: National Geographic (via io9.com) .

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Fri, 11 Jan 2008 23:06:36 -0800 Oh noes! (27 points, triple word score) http://martinbrook.posterous.com/oh-noes-27-points-triple-word-score http://martinbrook.posterous.com/oh-noes-27-points-triple-word-score Hasbro is trying to shut down Scrabulous.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 19 Dec 2007 14:01:00 -0800 mythmusic2m3u - Download your MythMusic playlists as m3u files http://martinbrook.posterous.com/mythmusic2m3u http://martinbrook.posterous.com/mythmusic2m3u

I'm a big fan of MythTV, having used it for a few months now, but I do find the web interface to be somewhat lacking. One feature I would like to see is the ability to download my MythMusic playlists as .m3u files that I could use to listen to my playlists at work (where I have an identical copy of my music library, thanks to rsync).

However, as this feature is not available at present, I wrote a little php script to do it. To use it, download the script, modify the hostname and database credentials at the beginning of the file (if necessary), and save it on your web server (which doesn't have to be the same system as your MythTV box).

If you want to do the reverse (upload your m3u playlists to MythMusic) check out m3u2mythmusic (and see this discussion on the mythtv-users list also).

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Fri, 24 Nov 2006 17:47:21 -0800 Making Google Reader even better http://martinbrook.posterous.com/making-google-reader-even-better http://martinbrook.posterous.com/making-google-reader-even-better I switched to Google Reader a few weeks ago and I'm totally hooked. But here are 7 tips to make it even better (via Lifehacker).

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 15 Nov 2006 14:14:51 -0800 Step-By-Step Configuration of NAT with iptables http://martinbrook.posterous.com/step-by-step-configuration-of-nat-with-iptables http://martinbrook.posterous.com/step-by-step-configuration-of-nat-with-iptables Just noting this useful posting at Howtoforge

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Tue, 14 Mar 2006 19:16:00 -0800 Mod_rewrite and how to make it work http://martinbrook.posterous.com/mod_rewrite-and-how-to-make-it-work http://martinbrook.posterous.com/mod_rewrite-and-how-to-make-it-work

I've just spent an hour trying to get mod_rewrite to work in Apache. I can't find many good tutorials out there. Here's the best one I could find...

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 03 Aug 2005 13:41:44 -0700 Motorbiker in-laws http://martinbrook.posterous.com/motorbiker-in-laws http://martinbrook.posterous.com/motorbiker-in-laws Inge's Anagram Generator was one of this week's Links of the day at UserFriendly.org. It's quite addictive. By the way, Motorbiker in-laws is an anagram of Martin Lewis Brook.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Fri, 22 Jul 2005 16:14:11 -0700 Useful resource for IMAP server http://martinbrook.posterous.com/useful-resource-for-imap-server http://martinbrook.posterous.com/useful-resource-for-imap-server Installing an IMAP-server

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 20 Jul 2005 18:35:33 -0700 Tracker http://martinbrook.posterous.com/tracker http://martinbrook.posterous.com/tracker Well, I've been working on a nice little tracker script for my site. It's like a (very) lightweight diary script, in PHP with a very primitive (but functional) interface. Took about 35 minutes. See it working over there on the right (hopefully). When I've tidied it up I'll put it on here.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook
Wed, 20 Jul 2005 14:01:02 -0700 Bigger and bigger infinities http://martinbrook.posterous.com/bigger-and-bigger-infinities http://martinbrook.posterous.com/bigger-and-bigger-infinities The infinite improbability drive feature of h2g2 is great for when you're bored. But what's even better is that you can now access it via WAP. This entry made today's lunchtime seminar go quicker for me.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/446922/profile09.jpg http://posterous.com/users/5egTKmIblYlj Martin Brook Martin Martin Brook