Details
January 29, 2013
Thought of the week:
I don’t like this “top ten” business. It’s the bottom ten that I like. I think you’ve got to go for the little things, the stones that make up the wall.
– Donald Knuth
January 29, 2013
Thought of the week:
I don’t like this “top ten” business. It’s the bottom ten that I like. I think you’ve got to go for the little things, the stones that make up the wall.
– Donald Knuth
January 28, 2013
No server, desktop, or laptop install is complete without Vim, and yet, there are times when I still see questions pop up on IRC about how to do basic editing of config files with vi. I remember, years ago, asking some of the same questions of an older Unix guru, and asking why I should bother learning such an eccentric and “outdated” text editor. His answer has stuck with me, he said “Because it is the only text editor guaranteed to be on every server, and some day you will need it, and have no other alternatives.” Vim, short for “vi improved” is ubiquitous, but it is also so much more, and the time you spend learning it will be repaid to you tenfold in productivity.
Vim is designed to be run from the command line, without a mouse. To get around in a file, Vim uses three different “modes”, where the same keys might do very different things, depending on which mode you are in. From my experience, this is the biggest obstacle of learning Vim, wrapping your head around what mode you are in, and how to navigate the text.
When you first launch Vim, you are in normal mode. Normal mode does not allow you to edit the text directly, but allows you to move the cursor around the text using the keyboard. The basics of what you need to know are:
Once you have the cursor where you want it, you can press “i” to enter the next mode, “insert”. Insert mode behaves more like other text editors, where the keys you press show up as text characters in the file. When you are done editing, you return to normal mode by pressing “Esc”. This is a good start for getting used to how Vim works, and over time, those keys will become ingrained as muscle memory, you might find yourself inadvertently reaching for the escape key after typing in a web form.
Moving around one line or one character at a time is fine, but time consuming. What if you would like to move the cursor down five lines? In that case, you would enter “5j” in normal mode. What if you know exactly what line number you would like to jump to, say line 42? Enter “42G” in normal mode, and you will jump down to that line. Or, if you would like to jump straight to the end of the document, you could just enter “G” by itself. I do this quite a bit, jumping between “1G”, the first line of the document, and “G”, the last. If you would like to move 10 characters forward, you would enter “10l” in normal mode. Same to move back, “10h”
What if you just moved down ten lines, and would like to move down another ten lines? You could enter “10j” again, but it would be faster to use another Vim shortcut, the humble period. Hitting “.” in normal mode repeats the previous command. So, whatever you did last, hitting “.” will tell Vim to do it again.
Hitting “i” in insert mode will allow you to start inserting text, however, there are a few other options as well.
Once you have the basics of when and how to insert text, moving around the text becomes more important. Luckily, Vim knows text well, and has a few tricks here as well.
What about copy and paste? Vim has that covered as well, but instead of “copying” text, you “yank” text with the “y” command. To yank the current line, which means to copy the current line, you press “yy”. To paste the line, move the cursor to where you would like it and press “p” in normal mode.
So, now that you can fly around your text with ease, and insert new text at will, what are you going to do about the plethora of typos? A few more normal mode commands to commit to memory are:
To use the delete command, you can either place the cursor over the text you would like to delete and press “d”, or you position the cursor at the beginning of a string of characters you would like to delete, for example, to delete one word, you press “dw”. To delete five words, you press “5dw”. To delete a sentence , you press “d)”. To delete the entire file, you could jump to the beginning of the file: “1G”, and delete to the end: “dG”.
And if you make a mistake? No problem, Vim keeps a detailed record so you can undo the last command with “u” in normal mode.
So, you can jump around the file, insert text, and delete text. How do you save the text? To do this, we need to enter a third mode, command mode. To enter command mode, you must first be in normal mode, and then press “:”. You should see the cursor move to the very bottom of the window next to a colon, waiting for you. To save the file in the current working directory, you would enter:
:w FileName.txt
If your file already has a name, then simply entering “:w” will work.
That’s most of what you need to know to become proficient with Vim, but of course, there is so much more. I’ve barely scratched the surface of what Vim can do on its own, not to mention Vim’s vibrant community of users and developers who have extended Vim through plugins. It is through the plugins that some real magic can start happening. However, to avoid asking on IRC how to edit a text file, this should have you covered. Finally, when you are finished editing, jump into command mode and enter “wq!”.
January 26, 2013
You get good at something by doing it repeatedly. I’ve been writing on this site for six years now, but with little direction or topic. I’ve gotten good at not making anything of the site, which is not where I wanted to be when I wrote about why I kept this site in 2011. I’ve not kept to a regular schedule, or a common theme, so I am not surprised to see that the only traffic I have going to the site is my own, and a few that found the site from Google. The preceding statement will make the next seem a bit ridiculous, but bear with me.
I’m starting a weekly sponsorship program for the site. When you sponsor a week of posts on jb, your product post will appear in the main feed three times, Monday, Wednesday, and Friday. Your product or service will also be mentioned in the site header for the week. Sponsoring jb will expose your product to a small, but growing, audience of creative and technical professionals. Consider this your opportunity to “get in on the ground floor”.
I have, for the past six years, been practicing finding my voice, my interests, and honing my writing style. I have also been deciding on the topics that interest me, that I’m passionate enough to write about, and that I care enough to share with the world. This is a site about quality, quality in our things, how we choose them, what we decide to accept into our lives, and what we spend our time on. I want to shine a light on the goods and services that I find exceptional.
I am also putting up some barriers to what I will write about here. I will not write about systems administration topics, or anything dealing with the general topic of open source software. I already have a venue for those topics, so they are out of scope here. If an open source application that I use is outstanding in some way or another, I might cover it here, but not on the merits of it being open source. Personal and family subjects have been mostly taboo since I started, and will remain so now. I will also not talk about politics or religion. These barriers are mostly to keep myself on track.
This is also a site about the pursuit of excellence in all that we do. This site is about using things that are worth having, and spending our time building things that are worth selling. The previous years were a warm up, the main game starts now, this is a great place to start reading.
January 21, 2013
After reading the MacSparky piece on craftsmanship, I’m reminded of how I like to look at my career as a systems administrator. I find that there are times when things that are not quite right just bother me. Like when there are inconsistencies or one-offs scattered throughout the environment I am responsible for. There may well be perfectly logical reasons why some systems are monitored and some are not, why some are registered with configuration management and others are not, but in my mind it is these little inconsistencies that add up and make your work look sloppy.
A craftsman is not sloppy. They are careful, competent, precise, and thorough. It is knowing that the little details matter, if to no one else but you, the accumulation of details is what defines the quality of your craft. It is knowing what the right tool for the job is, it is knowing when to use the power tools, and when to do it by hand. It is knowing that every corner you cut will come back to you in the end.
Cutting corners is unacceptable for a professional sysadmin. It doesn’t matter if you consider yourself “devops” or an old school neckbeard, you must decide to do the right thing and make sure that all of your bases are covered. I like to think of the environment like the internal workings of a clock. There are lots of tiny little gears, but when they all work together, you can feel the system ticking happily along.
Your profession matters less than how you approach your work. Do you do it sloppily, haphazardly, or as a craftsman?
January 19, 2013
So, while I was debugging the first post using Scout, I found an oddity in NSString. I was building the links between the posts using stringByAppendingPathComponent, to join the site’s base URL with the path component of the individual post. Unfortunately, that method seems to be stripping one of the forward slashes off of the http:// string, which screws up building links.
To test it, I created a blank Xcode project, and added this method to the App Delegate:
-(void)awakeFromNib
{
NSString *first = @"http://first";
NSString *second = @"second/part.html";
NSLog(@"first + second = %@", [first stringByAppendingPathComponent:second]);
}
And, sure enough, here is the output from that method:
2013-01-03 19:26:02.388 NSStringTester[39861:303] first + second = http:/first/second/part.html
A quick search through Scout’s source files shows that I’m using stringByAppendingPathComponent 53 times. Looks like I’ve got some work to do.
Also, this is a good time to point out that when you are doing web development, it is very important to test with multiple browsers. Safari hid the problem, Firefox did not.
Finally, it turns out that this is not actually a bug in NSString, but a bug in my understanding of this method. My thanks to Matt Yohe who was kind enough to point out my mistake on Twitter.
@ibuys @eridius also: “Note that this method only works with file paths (not, for example, string representations of URLs).”
— Matt Yohe (@mattyohe) Thu Jan 3 2013 7:34 PM CST
I’m still considering filing this as a bug, but I can see where they are coming from. Double slashes would not work for a file URL, but if they are already parsing the string for something like that, why not just check for “http” as well?
January 19, 2013
Building a desktop application that manages creating your site is great, but only publishing to a local folder is for the birds. After only a few posts using Scout, I can say that the process of publishing to a folder, switching to Terminal, and running rsync will not fly for any potential customers I may have. It’s a pain.
However, the choices for publishing online like Scout is meant to are not great. The point of Scout is that you can publish to any bare-bones, $3-per-month web host in the world, and not have to worry about the site going down because of high PHP or database processing overhead. There is no database, and there is no active code being executed. The only thing you need for Scout to work is a web server to serve up the site, and an ftp server to get your site to the server. But, that means that I need to write the code for dealing with FTP, and probably SFTP.
This is going to be hard for a couple of reasons. There could be a thousand different implementations of FTP, and a virtually unlimited number of “edge” cases that I might run into. For example, just testing some FTP code with my current web host caused all of my FTP connections to the host to be denied for a few minutes, too many connections at once. I clearly still have a lot to learn about stream programming, but if there were ever anything I would like to use a library for, this is it.
Speaking of libraries, I’ve kind of got a thing about using external code, and I’m a bit conflicted about it. On one hand, I don’t want to continuously reinvent the wheel, but on the other hand, I don’t want to mindlessly drop someone’s half-baked framework into my project. Choosing someone else’s code to use must be done very carefully. Right now, I’m considering two things for networking, writing everything myself using CFNetwork, or building in support for libcurl. The libcurl library might be a better choice, since I could also use it for SFTP file transfers, but, it might also complicate my code, and add an external dependency. Tough call, still need to think it through.
In the mean time, another thing I’ve noticed Scout needs is a decent full screen mode. The current full screen mode just makes the window bigger, which is not really a lot of help. Full screen should vertically center the current text being edited, make the font bigger, and possibly make the text view a bit narrower than the full width of the screen.
Also, themes are coming along nicely. Scout will support a fairly simple development of themes for your site, in a little theme.stemplate package file. Double-click on the theme and Scout will import it, and it will show up as an available choice in the theme chooser.
Scout is by far my most ambitious project. Still tons to talk about, and lots of possibilities. Who knows, what about live statistics in the app? Beautiful PDF report generation? A Farmdog hosted option available with in-app subscription and zero configuration? It’s all possible, all it takes is time.
Development continues.
January 18, 2013
I’ve searched high and low for an alternative to iTunes, but I’ve yet to find a suitable replacement. I use iTunes for playing music, mainly over AirPlay in my home office, and it works great. I’ve got smart playlists, star ratings, and an iTunes Match account to keep everything in sync between home, work, and mobile. Given my investment of time and money over the years, it’s possible that I may be suffering from some type of sunk cost fallacy, but honestly I really enjoy iTunes.
I’ve read several arguments against iTunes, and most of them make perfect sense. The application does try to do too much in a way very unlike most Apple designs, but I find it easy to ignore what I don’t use. Most of what I’ve read centers around how bloated iTunes has become, but the performance counters I see tell me that it is not much, if any, heavier than comparable applications. I recently compared iTunes 11 to Sonora and Tomahawk monitoring CPU utilization per process using Activity Monitor while the window was closed.
So, from what I can see, iTunes does use more RAM, but not by much. But it also uses less, or at least comparable CPU than the other two. I’ve done the same checks previously with different music players, and normally find similar results. With the feature set that iTunes has, I don’t see a reason to go through the hassle of using anything else.
A few other people I follow on the web have stopped using iTunes in favor of web based streaming services like Spotify or Rdio. I haven’t checked the resource use of the web players or the native clients of these services. I prefer to manage my music collection myself, and living out in the boondocks in the midwest, I don’t like having to depend on my Internet connection when I want to listen to something. Also, I still haven’t figured out where my bootlegged collection of Greatful Dead shows fits into a service like Rdio.
I still believe that Apple should split iTunes into separate apps, and I know that there are other people who’s use of the app differs from mine significantly enough that they see problems with it. It just doesn’t happen to me.
January 17, 2013
I inadvertently started a bit of a conversation today when I complained about the state of NetNewsWire on Twitter. I’ve been a NetNewsWire user for years, and I was very surprised when it was sold to Black Pixel. My surprise turned to disappointment when the application was not updated, and now NetNewsWire has stopped working for me completely.
I have a group of feeds in a folder called “Read”, which I keep as my must-read list. It just so happens that this list is the one that has stopped syncing with Google Reader. I recall there being conversation online about moving away from Google Reader, and how it being the only RSS syncing service was Not A Good Thing. From what I can gather, the new version of NetNewsWire was going to sync it’s feeds using iCloud instead of Google Reader, a move that I would have welcomed. I keep a separate account used only for syncing my Google Reader feeds, so being able to get rid of that account would be great. Unfortunately, NetNewsWire uses core data as it’s data storage back end, and development has hit enough significant problems with this setup that Black Pixel decided to work on something else instead.
Reminds me of another story, another once favorite app, Yojimbo. Bare Bones has been documenting their efforts with Yojimbo publicly, and have had to push back releasing a new version that supports iCloud syncing several months. They had once promised that syncing would be implemented by the time MobileMe syncing was unavailable, but were unable to meet that promise.
Black Pixel and Bare Bones have some of the sharpest, and most experienced developers in the business working on these problems, and have not been able to come up with a shippable solution. In that light, I’m actually a bit glad that I didn’t try to tackle iCloud syncing with Go2, and that I’ve settled on using plain text for storage in Scout. The plain text setup should allow me to build Dropbox (or any other comparable technology) syncing into Scout, although I’m not sure that it will be available in version 1.0.
The programming, it is hard.
January 16, 2013
I’d like a really simple way to insert footnotes in the text. However, I’m not sure how much of that I can do with the Markdown parser that I have now, which means inserting ugly HTML, which I’d really rather not have. I could do something in the generation of the site, inserting my own marker in the text and parsing through that later, but that seems like reinventing the wheel. Surely there are better ways to go about this.
I’ve also been thinking about other scripts or “plugins” for Scout. An early idea I had was to build in analytics, so you could download hit counts and other statistics from your host and Scout would build a nice report for you. Or, maybe even do some type of live updating, but I think that might be taking it a bit too far.
MathJax would be a nice addition, but I don’t think it would be appropriate for everyone. Maybe a preference pane with optional plugins you could check and uncheck and have them included in your site. That way, if you want MathJax or Google Analytics or jQuery you’d just select them and hit publish. Still so far to go to get there.
Which leads me to the next thought, when is it enough for 1.0? I need to balance two weights; on one hand, I need to actually ship the app, but on the other hand, I want Scout to be great from day one. What is it going to take for it to be great? What is the bare minimum that I need in 1.0 before I can ship it? These are the questions I’m asking myself.
One feature that I keep coming back to is the ability to have zero configuration publishing. For example, what if you don’t have a web site or a domain name, but you’d just like to write and publish online in the easiest way possible? Scout should be able to grab your iCloud user name, have you click an in-app subscription, and let you publish to a Farmdog hosted server. That way, you can just download Scout and start writing, and Scout and Farmdog take care of all the little details. That’s the dream anyway, but is that a 1.0 feature? Tough call.
Syncing is another thing that’s going to be a tough call. I’m using plain text as the data storage, so I should be able to monitor changes in the filesystem and merge them into the application. Hopefully, building on plain text and integrating with Dropbox will allow me to (eventually) build an iOS companion to Scout. Scout on the iPad with Dropbox on the backend could be fantastic for writers.
If I only had 30 hours per day to work on this.
January 15, 2013
I would like to introduce you to Scout, my desktop, baked blogging engine. I’d like to, but Scout is not quite ready yet, so I’m keeping him under wraps till I’m sure. There is only one way to be really sure, and that’s to use Scout to publish my own blog, every day.
So, a little about Scout. I first got the idea a few years ago when I noticed Jekyll. I built the previous version of this site on Jekyll, and used Github as my host. Jekyll works great, but it is very much a power users’ tool. Anything that requires the user to pop open the terminal is not going to pass muster with the average Joe. However, I like the idea of a static blogging engine, and luckily, I’m not alone. So, I set about trying to bring the power and control of Jekyll to a nice user interface.

I’d like to say that I started working on it, worked on it steadily and consistently for a few years, and now it’s almost done. Unfortunatly, I had a lapse of judgement where I was not properly backing up my laptop, and was also two months behind on my offsite version control, and wound up loosing months of work on the first version. I still haven’t recovered completely from that, I wrote a Wordpress importer that I still need to recreate. After loosing so much work, I got discouraged and moved on to other things.
This Fall I decided to pick it back up again, and I’ve been working on it in every spare second that I have. I very excited about Scout, and can’t wait till it’s ready, but like they say, the devil is in the details, and I have to make sure this is done right.
Scout is heavily centered on the writing experience. The main interface is a plain text, markdown syntax highlighting editor, with built in preview, easy to build and customize themes, and a minimalist media manager.

Scout builds and publishes the entire site every time the site is exported. Once the site is uploaded to the web server, the server itself needs very little resources to serve up the site. There is no dynamic code to execute, which makes it very unlikely that the site will slow down or crash because of a high influx of traffic.
I’m using a single window for Scout, and the views fade in and out as needed. The list of previous posts is available on the left hand side of the window, but normally stays closed to concentrate on new writing. I’m also experimenting with the preferences view, trying to keep it very simple, beautiful, and functional.

I’d like to give a time table for Scout’s availability, but it would probably be a bad idea. Even writing this brief post I’ve noticed a few things that either need fixing or need to be enhanced. So, I’ll keep polishing, and polishing, and polishing, till Scout shines as much as I can make it. Then I’ll call it 1.0, release it to the world, and start fixing everything that the world finds.
I will be writing more about Scout in the coming weeks, and would love to hear your thoughts on the concept. Feel free to drop me a line.