Fnord

Random bits from a random nerd

PyCon 2012

Some notes and comments from my first time at PyCon, the Python software conference.

  • It was huge - 2,300 attending, even though it was “capped” at 1,500. More would have liked to attend.
  • The on-site network worked very well, reliable and stable. Capped at 512KB/sec per person, which is fine. I tried out my LTE tether but didn’t need it.
  • The conference hotel was good, and it was nice to be able to walk back to my room if needed. 149/night is a very reasonable rate, and the room was nice. Good chair to sit in.
  • I attended two tutorials, which ran the day before the main conference. At $150 each I’m not sure I’d do so again; decent but not wow. The quality of the main talks is so high that the tutorials are just icing.
  • I think next year I’ll go for a code sprint instead. I’d really like to contribute to Python or some of the libraries I use and appreciate.
  • Overall, the conference felt like coming home. It’s odd, as I’ve been to quite a few conferences but this felt the most like my personality. Big expensive ones like Supercomputing are more about PR and sales, and even Software Development was kind of sterile and blah. PyCon felt like peers, getting together to hang out and do amazing stuff. And make no mistake, a lot of the people there are doing amazing and inspiring work.
  • Jobs - I didn’t know this going in, but of the 134 exhibitors/sponsors, it seemed like all of them were looking for Python hackers. I’m not looking, but it’s reassuring to know the market is there for the skills.
  • Very decent food for a convention this large.
  • I will go again, even if I have to pay my own way. Strongly recommended.

And a few more specific notes and pointers:

  • The OpenStreetMap project has advanced a huge amount. Check it out as a Google maps equivalent/replacement.
  • My deep thanks to the Dropbox folks for giving out 5GB at their hiring booth. I needed that!
  • NewRelic looks awesome. Magic-level app analytics.
  • I’m already using Disqus here and on WatchOtaku, and stopped by to confirm with them that I had implemented it correctly there. Nice folks, they setup a board just for pycon.
  • Speaking of chat, once again IRC was helpful, I used Colloquy to hang out in the #pycon channel.
  • I tried to take the ‘Google at PyCon’ challenge but after passing the first level their email never made it to me. Weak.
  • I really need to try the Pyramid web framework. Talked a bit to the hackers and it sounds like a nice replacement for web.py for the code I’m doing.
  • The NAO robot demos were amazing, I wish I could afford one. Even at developer discount they’re 6k USD each.
  • The WebCube platform might be nice; I have a friend or two needing sites that’d be well suited for this.
  • The new iPython notebook looks astounding, but I wasted a few hours trying to get the stack of requirements installed to no avail. You have to install an entire Python distribution EPD to get it working.
  • I was impressed by Web2py but a lot of the Pythonistas were skeptical or dubious. Interesting.
  • Videos of all of the talks and posters are free to watch at PyVideo.org.
  • Almost forgot PiCloud, a nifty-looking way to run Python with 2 lines of code. Up to 20 CPU hours per month for free, very much worth a try.

For next year:

  • I spent some airport time hacking up a quick Bootstrap/web.py app for signing up for an Ultimate game. I think it’d be great to have during PyCon, will see if I can make it happen. A bit daunting, between the logistics and not knowing anyone, but who knows.

A Decent Boxed Wine

As a followup to my previous post, I found this at the local Costco yesterday:

wine box

2010 Bordeaux red, $25 for 3L. It’s actually pretty good, an everyday wine and quite drinkable. For four bottles’ worth the price is good, and if it keeps I’ll be happy. Unlike before, the spout isn’t leaking, either.

Comments Enabled on All Posts

Another item off the to-do list - all posts here should now have comments enabled. A bit of Perl:

1
perl -pi -e 's/layout: post/layout: post\ncomments: true/g' *.markdown

I think the exitwp script that I used didn’t add the comments: true field.

Migrating Away From Google

There’s an inherent tension when a company provides a free service: How do they make money? Are you the product? Is it a Freemium model? Do they even have a plan?

If it’s free, they can always go out of business, change the terms, or generally do anything they want. Those are your risks.

There has been, in the last couple of years, a recurring spate of news about Google that gives me pause. Censorship in China, the blending of Plus into search, etc, etc.

The thing that tipped me into action is their awful new ‘privacy’ policy (By the way, you should really clear your Google history before that takes effect on March 1st!). Me no like.

It’s their company. They have to make a profit, and it’s their choice how they do so. From the point of view of a random nerd, I strongly dislike the level of fine-grained data they will be gathering and selling. I am choosing to look for alternatives, and I’m happy to pay for them.

Let me share what I’ve found so far. For the most part, I’ll just mention the ones I chose and not try to enumerate all the alternatives.

Search

Still far and away the best product from Google, I must say. I’ve been using the oddly named DuckDuckGo which I found via John Gruber. It takes some getting used to, but has some new features I like too. Using ‘!so’ to search StackOverflow is handy, as are the Python and Android shortcuts. I’m warming up to it.

Search in Safari or other browsers

If, as I recommend strongly, you are running GlimmerBlocker, then adding DDG to Safari is pretty easy - see this page for instructions.

Chrome or Firefox are also tweakable; see the same page

Search on iPhone / iPad

No easy way to replace Google with DDG here. DDG does have mobile search apps for iOS and Android, but it’s not integrated into Safari.

Search on your blog

If you use the search bar here on Fnord, as of today it’ll go via DDG. Kudos to them for having Octopress instructions - major nerd plus! They also support other platforms, of course.

RSS/Atom (Google Reader)

There are several alternatives here. I found and recommend NewsBlur, which is Freemium, open source and has an iPhone app. I simply exported my OPML from Google Reader, imported it into NewsBlur and have never looked back. I paid for the Premium account, which is as I recall ~20/year; you set the donation amount.

Minuses:

  • iPhone app is a bit crashy
  • No iPad app yet

Overall - strongly recommended. I use the main site on the desktop and the iPhone app. Works great.

Email

I run an Exim-based mailserver here, though a few years ago I conceded the spam battle. My personal email is now forwarded to SpamCop for filtering. $30/year, fantastic. Never a single outage or problem in three years now. I have a hybrid setup, where I archive messages to my IMAP server, but the inbox is on SpamCop.

Blogs

Depending on your level of techie interest, you can self-host as I do, use Github and Octopress, or one of the other free platforms such as Tumblr, Posterous, WordPress.com and so on. I prefer to self-host, as that way I have my data locally and complete control. Plus, it’s fun to do this stuff yourself!

If you do run WordPress, there are commercial services that’ll handle all the sysadmin work for you. It’s a pain if your site gets popular.

Analytics

I paid for and like Mint. You can see my stats on this page. The price is reasonable, the install painless and the results decent. For my WatchOtaku site, I’ve been using Clicky, as it’s a bit nicer but really Mint would work there too. There are others; for my level of traffic and casual observation these both suffice.

Code and project hosting

Go Github. Don’t even consider anything else. It’s that good.

Also works for static pages like this one

If you need an in-house-hosted or FOSS solution, Gitlab is pretty darn near a complete workalike.

Maps and directions

OpenStreetMaps is excellent. Good for GIS work too.

Google Docs

I used to use this more at UCSD, these days it’s a combination of IM, Email and the rare DOCX file. No suggestions, other than to suggest using HTML for doc formatting; makes posting it easier anyway.

Maybe Dropbox?

Google apps for your domain

I use this a bit; Google is still doing the mail for WatchOtaku. I can live with this for now and will migrate off if the account starts getting a lot of email; right now its about 1 per month and I can accept that. Since that’s a domain-specific hobby/account/site, the analytics from it are gonna be bizarre.

Conclusions

Google has some excellent products and replacing them takes time and money. It’s worth it to me. I’d rather spend a few bucks then be monetized, but of course YMMV.

Simple Image Uploads for Octopress

One of the features from Wordpress I’ve been missing is easy support for uploading and including images. WP has a fancy GUI for this, and handles the uploads well.

So today did a hack while inspired. Shared as a gist on Github, this code:

  • Makes the path YYYY/MM/DD, e.g. ‘2012/02/24’
  • Verifies that the directory created is writeable
  • Does an upload via the filesystem
  • Fetches the uploaded file via HTTP for an end-to-end check
  • Computes MD5 hashes of both to make sure it made it intact
  • Print out the full URL of the image, for easy use in your editor
  • Copies said URL into the copy & paste buffer via pbcopy

Usage is pretty basic:

1
2
code/Image_uploader/upload.py Desktop/sorry.png
http://fnord.phfactor.net/wp-content/uploads/2012/02/24/sorry.png

In one step, you’ve uploaded the file and can go paste the URL into the editor!

I wanted to use scp, but was unable to find a way to create directories easily. It’s do-able, but since I paid for ExpanDrive I’m not averse to using it. Here’s the code in case you want it:

Gotta love Python. And Github. And Octopress.

Aetna #fail

Yesterday I got an email from Aetna:

aetna snap

It suggests I complete thier HRA (Health risk assessment). This is something I found useful while at UCSD, so I click the link, sign in to my account, and promptly get this:

fail

…which has to be one of the least useful dialog boxes I’ve ever seen. At a guess, the email was form-generated, and my current employer lacks the HRA feature. But WTF, Aetna? Shouldn’t you, you know, check first?

Yeesh.

The Diminished Value of IEEE and ACM Subscriptions

I’ve been a member of IEEE and ACM since 1997, back when I was an undergrad. For a while I did some volunteer work for IEEE (for their GOLD program) though I quit in frustration after a short time.

Anyway, yesterday I got an email from the IEEE reminding me that my email alias, phubbard@computer.org, was going to expire unless I renewed my membership here soon. Which lead me to think a bit and ask a simple question:

What am I getting from professional memberships and is it worth the cost?

After all, IEEE is about $200 per year and ACM is ~$100; are they worth it?

It used to be that professional societies provided human networking, training, insurance plans, and publications. These days, with LinkedIn, various websites and such, the only service I actually use is the email alias, and it’s not like that’s of great value to me.

A couple of bullet points on the resume, meh. “Member of IEEE and ACM” has never gotten a comment.

Let’s not even mention the free magazines you get. They’re worthless, full stop.

I suspect that a lot of societies, both fraternal and professional, are going to have to reinvent their utility in the age of the Internet. The old value propositions no longer hold, and they need to find new ways to be useful. For me, as a working developer, IEEE and ACM no longer make the cut. Here’s hoping I have reason to reconsider some day.

Added Email Subscriptions to the Site

If you look in the upper right next to the search area, there’s a new icon that looks like this:

email icon

Click it and you can subscribe to daily updates via email, implemented via Feedburner. I know that some folks used to read the site that way, so I’m pleased to have it working on Octopress.

If you want to set it up on your Octopress site, there’s two steps. You have to setup Feedburner with your RSS or Atom feed, then go to the ‘Publicize’ tab and activate email. Then take the HTTP URL they give you and enter it into the _config.yml:

1
subscribe_email: http://feedburner.google.com/fb/a/mailverify?uri=phfactor/rzbg&loc=en_US

Leave a comment if you have any problems, or email me - the feed now includes my email address.

Adding Disqus to Confluence

I’m trying to get non-spammy commenting working on my Confluence site and it’s a pain in the ass. The native solution is CAPTCHA-based, and that’s been defeated by spammers.

I have a semi-solution using (as with Fnord) Disqus. Some notes for other folks attempting this:

  1. You have to use the raw Javascript functions of Disqus
  2. On Confluence, go into Site admin / Theme / Layout editor / Page footnotes
  3. Change Options to ‘Velocity then raw HTML’
  4. Change the shortname to that of your site

Here’s mine so far, with the short name munged:

1
2
3
4
5
6
7
8
9
10
11
12
<div id="disqus_thread"></div>
<script type="text/javascript">
    var disqus_shortname = 'CHANGEME'; // required: replace example with your forum short name

    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>

This seems to almost work, but the variables that tell Disqus what page it is seem to be unreachable. Normally, you set

1
2
disqus_url
disqus_identifier

but I can’t tell how to read those. I’ve tried (from these docs)

1
2
$req
$req.contextPath

but those are not found.

Syntax was

1
var disqus_identifier = $req.contextPath;

which produces an error visible in the Safari error console about req not being found.

I also tried (from these docs)

1
2
$content
$content.getEntity().getRequestUrl()

but even content is not found. Perhaps some syntax error with the Velocity engine stuff, but the mixture of Velocity and Javascript is very poorly documented. I was unable to find anyone else using Disqus with Confluence, so if you have any tips do say so here!

At present, it’s almost working. The page portion loads, the Disqus portal seems happy, but due to the lack of URL is causing comments to not load on the page they should be attached to.

Update 3/10/12: I talked to one of the Disqus hackers at the PyCon convention, and he confirms that this approach works fine. If no URL or ID is set, Disqus sniffs the URL and comments will follow it as long as the URL is constant. Excellent.

New CSL Arduino Posting

A couple of quick notes - at the suggestion of a friend, I’ve written some posts for the Citizen Scientists League on the Arduino weather station. Code, setup, circuitry, Pachube interface and such. I’m curious to see how the response is there, as they probably get more readers than I do here.

Secondly, a quick tweak to Octopress - when you create a new post using rake, I added calls to add the post to git and fire up the editor, as those are what I’d do next anyway. Here’s the snippet from the Rakefile:

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
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
desc "Begin a new post in #{source_dir}/#{posts_dir}"
task :new_post, :title do |t, args|
  raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
  mkdir_p "#{source_dir}/#{posts_dir}"
  args.with_defaults(:title => 'new-post')
  title = args.title
  filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
  if File.exist?(filename)
    abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
  end
  puts "Creating new post: #{filename}"
  open(filename, 'w') do |post|
    post.puts "---"
    post.puts "layout: post
comments: true"
    post.puts "title: \"#{title.gsub(/&/,'&')}\""
    post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
    post.puts "comments: true"
    post.puts "categories: "
    post.puts "---"
  end
  # pfh 2/10/12
  system "git add #{filename}"
  system "edit #{filename}"
end

One more note - if you use zsh, you have to escape the square brackets. Here’s the syntax when I created this post:

1
rake new_post\["New CSL Arduino posting"\]

Mildly annoying.