Archive for Software posts

Using (or not) Markdown

In response to my previous post about Markdown file extensions, a few people asked me what I use it for.

For the most part, I don’t use it for web authoring. I understand the argument that Markdown is not a replacement for HTML, but given it’s exporting to it I don’t find the distinction pragmatic or useful here. I use inline HTML attributes, styles, citations and such for accessibility, RSS portability and semantics, all of which are beyond the scope of Markdown.

Where I do use Markdown is in my notes files. I previously ran a local MediaWiki install for note taking and general life organisation; I adored the hassle-free structure it gave my notes, the way I was able to assign them to categories, and then link those notes together. Markdown and nvALT have since given me these same features with greatly reduced overhead. This will be a topic in a future post I’m drafting now.

I suppose it also comes down to inertia. I’m used to coding in HTML, and have developed quite a library of snippets and macros for dealing with it in an automated, easy fashion. My inner developer likes that the code I write is the exact code the browser sees. Conversely, my notes files didn’t take long to port to Markdown, and now I benefit from other programs being able to parse them.

TL;DR Markdown isn’t a HTML Panacea, but it’s crazy useful for text notes. You are using text notes, right?

AText as a basic TextExpander alternative

I’ve used and adored TextExpander since hearing Dan and Merlin discuss it on Back to Work.

By defining snippets, you can substitute whole blocks of text or forms with a keystroke shortcut. For example, ;me is replaced with my name, email address and phone number. ;i gets replaced with an img HTML tag complete with image dimensions and a field for alt text. It’s really nice.

For my student friends though, its been hard to recommend a $35 application. If this is a limiting factor, I’ve since found a promising alternative called aText. It appears to perform a subset of TextExpander’s tasks, for $5.

I adore TextExpander, but if you’re on a tight budget AText may be the way to go.

Jekyll timezones

Photo I took of Singapore in 2012

UPDATE: This date issue seems to be resolved as of Jekyll 1.5.1. As such, this post should be considered hysterical historical.

With almost four thousand posts written in different countries over the last nine years, I often feel as though my use case really tests the limits of Jekyll. To be fair, it has performed admirably.

One area where I've continued to struggle is with timezones. According to the Jekyll documentation, you declare timezones within the date YAML front matter for a post, such as this:

date: 2014-01-10 12:06:21 +1100

For posts written in Singapore and KL, I set the date with "+0800", with Adelaide as "+0930" and Sydney as "+1000" or "+1100" depending on daylight savings. Suddently, my times are even more accurate than they were when I exported them from WordPress last year, a nice feature!

There's just one catch. When Jekyll generates my site, these dates are converted to UTC. Under most circumstances this is fine; it's a more universally understood representation of the same time. Where this becomes a problem is human readable dates.

Say for example I posted this entry at 01:00 +1100. This means I'd expect my site to say Friday 10 January. Because it gets converted to UTC internally however, my blog says it was posted Thursday 09 January.

A temporary workaround

It's not very elegant, but for now I define a separate timezone variable in my post YAML front matter:

layout: post
title: "Jekyll timezones"
date: 2014-01-10 12:06:21 +1100
tz: "+1100"

Now, whenever I need to show the date in my Liquid markup, I substitute the default Jekyll date functions with these:

{{ | date: "%Y-%m-%dT%H:%M:%S" }}{{ }}
{{ | date: "%A %d %B %Y" }}

Which generates these:

Friday 10 January 2014

Now my posts are always shown in my local time on the site.

Something @Gruber dot Markdown

Generally speaking (for the pendants), the current way we identify files on desktop OSs is filename extensions. It didn't used to be this way Smithers, many OSs including Mac OS and *nix could identify files without them. Another unfortunate legacy of having to support Windows.

This morning our time, John Gruber elaborated on the lack of an official Markdown filename extension. He endorses ".markdown", agreeing with Hilton Lipschitz that "we should be using the most descriptive file extensions".

I can empathise, but I employ ".md" precisely because it's succinct. is more useful to me than Netsec…ort.markdown as viewed in the Finder's column view, or TextMate's file browser.

This does create a little more work for us developing software, but I see this flexibility as a strength of this plain text format, rather than a weakness.

OS X Mavericks 10.9.1

The first dot release update for OS X 10.9 Mavericks is now available for everyone, meaning I now consider the OS safe for production use in my book. If my iBook G3 could run Mavericks, that is.

As an alternative to the App Store, Apple provides redistributables (is that a word?) for the update:

I still think its a good idea to download updates like this manually, particularly if you have multiple machines in the same house and are burdened with Australian ADSL instead of your Singaporean internet connection from back home. I call it technical homesickness, or tomesickness for short. It can also help bring a new machine up to speed quickly if you have to reinstall the base OS at some point.

SaaS cloud encrypting customer data

Earlier this week, I wrote about FreeBSD ZFS and how deduping can take considerable amounts of memory. A commenter who wishes to remain anonymous took issue with this line:

As an aside, it makes you appreciate why so many cloud vendors don’t wish to encrypt data; such processing would render even the most sophisticated deduper utterly useless.

This line was phrased in the context of a cloud vendor wishing to save costs, not the wishes of their customers. If storage was constrained, it would make sense to dedupe if possible.

Encryption “breaks” deduplication (and by extension, compression). The mark of a high quality algorithm is pseudo-random noise, such that there are as few repeating patterns as possible.

Of course, encrypting the same individual files will result in the same ciphertext, right? I suppose it comes down to implementation.

How nvALT changed my life

If you’ve been a regular reader of my ravenous Rubénerd ramblings for the last eight years or so, you know I don’t use the phrase “changed my life” often. A quick regex search for variations of that phrase in my Jekyll archive returned less than four examples. Three, specifically.

For a couple of years now, I’ve been an avid fan of Dan Benjamin and Merlin Mann’s Back To Work programme on the mighty 5by5 podcast network. As far as I know, Merlin hasn’t ever specifically talked about nvALT, though he name dropped it enough times to know he must find it valuable. So I decided to check it out.

Brett Terpstra is systematic in win

A continuation of Notational Velocity by the lovely Brett Terpstra, nvALT can be thought of as an interface for your own text file repository, whatever that means to you. I know plenty of people who are happy using word processors or other tools to take notes; for me nothing has ever beat text files since I stared as fresh-faced kid at the Windows 3.1 Notepad.

The misleadingly simple interface features a text window with a list of note files attached. Above these, a search box allows for searching across all these notes. Behind the scenes, nvALT can store your notes in an encrypted database, or as plain text files you can sync.

Why was this enough for me to move away from Vim/NERDTree and a locally running Wiki for my notes? It wasn’t, who gave you that idea? It was a combination of these three things:

Three little s/words/reasons/

First, that search box doubles as a new note generator. Type a note that doesn’t exist and hit Return, and you start a new one with that name. Add a keyboard shortcut on OS X and you have a way to capture any idea as it comes to you. Huge.

Second, it supports Markdown. Why should you care? Because it lets you add a little consistent structure to your notes without much effort at all. Other software will recognise and parse it. I didn’t see point of Markdown until I started using nvALT.

(Markdown also lets you export HTML, but I see less utility in that).

Third, and perhaps the most critical for me, you can link between notes with double square brackets. I had been running a local Lightty web server to run a personal wiki precicely for this purpose. Overnight, I was able to reduce my note taking system overhead by a few quadrillion percentage points.

And here’s the crazymaking part

I’ll come clean, I wrote this post in February 2012 and let it languish in my drafts folder. Since that time, it’s gone from a nice to have curiosity to an integral part of my existence. I’ve taken two semesters of university notes in it. I’ve even begun importing other notes from various systems into it.

Fedora gem can’t find header files

Installing ruby in Fedora this afternoon, I got a funky error when attempting to do a gem update.

# yum install -y ruby
# gem update

Building native extensions. This could take a while...
ERROR:  Error installing shimabowl:
        ERROR: Failed to build native gem extension.
    /usr/bin/ruby extconf.rb
shimabowl.rb can't find header files for ruby at /usr/share/include/ruby.h

For a split second, I thought maybe my username was in conflict with a ruby directory. My name is Ruben, and some of my usernames are… well, yeah.

Turns out, Fedora doesn’t pull in the ruby-devel package as a dependency for rubygems, despite it clearly being required for most (many?) gems. So it’s just a matter of getting those as well:

# yum install -y ruby-devel
# gem update
Updating installed gems
Updating shimabowl
Fetching shimabowl-1.0.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed shimabowl-1.0.0
Parsing documentation for simapan-1.0.0
Installing ri documentation for shimabowl-1.0.0
Done installing documentation for shimabowl after 2 seconds

Done and done.

FreeBSD 9.2 with vesa in Parallels Desktop 9

FreeBSD 9.2 running in Parallels Desktop 9

In 2006, I started running FreeBSD 6.2 in a beta release of Parallels Desktop. It was quite the learning experience, and further cemented my love of this OS. Half a decade later, I find myself trying to run FreeBSD 9.2 in Parallels Desktop 9.

A lot has changed in FreeBSD; the workstation teams have done a terrific job. For one, we have the stunningly beautiful pkgng system which negates another reason why I stuck with Linux in several different settings. On the Xorg front, we no longer need to configure xorg.conf manually, and we don't need messy modelines to manually enable widescreen resolutions. It takes reading a post I wrote in 2007 to really appreciate this!

Enter xrandr

From an end-user perpective, we also now have xrandr. A simple front end to randr, it allows us to specifiy our screen resolution on the fly without rebooting X, and without root permissions. Install:

# pkg install xrandr

Now we can specify our desired initial screen resolution in our .xinitrc along with our window manager and other such goodies. Below, we've specified we want a resolution of 1024×768 and the Xfce desktop when we start our graphical X server:

xrandr -s 1024x768 &&
exec startxfce4

I remember reading somewhere that .xinitrc was depracated, but I can’t remember where. For now at least, it still works.

Why is this important for Parallels?

With the latest release of Parallels, this is very important. The vesa driver detects my humble MacBook Air is capable of driving a 1920×1200 display, so it starts X at that resolution. On my internal 1366×768 display, this means a lot of squishing and impossible to read text. Setting 1024×768 as above offers native resolution, albeit with black letterboxing.

This is where we hit a snag. Using the -q option, we can query which screen sizes are available and supported for our use. After changing on-the-fly to 1280×800 to test widescreen operation, this was the output:

% xrandr -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640x480, current 1280 x 800, maximum 1920x1200
default connected 1280x800+0+0 0mm x 0mm
1920x1200          0.0
1600x1200          0.0
1680x1050          0.0
1400x1050          0.0
1280x1024          0.0
1440x900           0.0
1280x960           0.0
1280x800           0.0*
1024x768           0.0
800x600            0.0
640x480            0.0

Alas, the native 1366×768 resolution of this MacBook Air is not among those listed. From what I've been able to find, this is a limitation of the xf86-video-vesa driver.

This was mostly an excercise in curiousity; I run FreeBSD on my ThinkPad hardware natively. Still, it would be nice to re-creaate what I had on my original MacBook Pro all those years ago. The next step will be to see if the Parallels tools have been maintained for FreeBSD, and if there's a driver offering.

Linux doesn’t have to lose for BSD to win

Earlier today, I made the mistake of reading a FreeBSD news story, and then reading the attached comments. I know, I know, rookie mistake. Still, I couldn’t help but fill out my FreeBSD blog comment card:

I laugh derisively at your use of FreeBSD, because:
[x] FreeBSD is dying
[ ] Nobody uses FreeBSD
[ ] Penguins are a better mascot
[ ] gcc is superior to clang/llvm
[x] Linux is always technically better
[x] GPL BSD licence debate
[ ] I don't know how to use ports

The only people who use FreeBSD:
[x] Are those who like FreeBSD (shocking!)
[ ] Are those who hate Linux
[x] Only do so to mix it with proprietary stuff
[ ] Use it because that's all the know
[x] Do it just to be different (my personal favourite)

Guys and girls, can we talk for a minute?

I understand that the use of IT equipment is predicated on seeing the world in black and white. We’re supposed to choose Vim or Emacs, Wayland or Mir, Qt or GTK, OpenOffice or LibreOffice, RPM or deb, gcc or clang, KDE or Gnome, Cinnamon or Gnome, Mate or Gnome, Xfce or Gnome. As Linux users, I know these knee jerk responses against FreeBSD are a part of this (for want of a better word) nerdy tradition.

I might blow your mind with this piece of logical reasoning though: Linux doesn’t have to lose for FreeBSD to win. There are uses for both OSs, and in situations where they’re otherwise equally suited, they benefit each other. Before you compulsively post a troll comment on a FreeBSD story, give a quick thought to that.

Now if you’ll excuse me, I’m off to build Firefox on my FreeBSD workstation. You know, that browser that’s one ./configure command away from being the same one you girls and guys use.

You are on page 10 of 81. Where to now?