MrBlog

October, 2010 Archive

Oct 25

As mentioned in my previous post, I moved back to using Linux as my desktop operating system, coming from OSX. I have a couple of notes on the why and some observations about it which may be of interest.

My main machine has been a macbook pro 17 inch (or powerbook when they still had a ppc in them) for a couple of years now and I was pretty much a happy camper using OSX. OSX has represented an ideal mix for my long unix based experience and the need for screen candy and proper support of drivers which make usage of the hardware flawless.

In short, my hardware broke down. That is, it broke down a bit. Every once in a while I’d get coloured stripes on my screen or a yellowish glow or fonts of which the letter ‘m’ would not display correctly (go figure). Annoying, but fixable with a reboot and I could live with that, at least for a short period of time. When the machine started rebooting spontaneously and I started losing work because of it, replacement seemed the only option left.

As the problem was intermittent and seemed a bit related to how hard I was hitting the cpu with my compiler whip, I decided, before scrapping the machine, to install ubuntu linux on it, just to see how it would deal with the same hardware error and to have a look at the new ubuntu (at that time Lucid) release.

The hardware problem was still present under Linux, but I was able to control it. A major help was to be able to control the fanspeed and thus the temperature of the machine. This was something that I never succeeded in doing under OSX. Perhaps I didn’t look hard enough, or was not experienced enough in OSX details or whatever. Fact remains, I got to control the fans in Linux within the hour and with that a large portion of the problem.

By carefully configuring display settings and upgrading to newer customized kernels I am now in the situation that my machine is basically back to a state where “scrapping it” sounds ridiculous and it’s good to go for a while.

The above process took about 3 to 4 weeks. After that I realized that the level of control I had over my machine felt really good.

Having worked on a daily basis under Linux a notable observation was that I didn’t really miss anything from OSX, apart from a dedicated blogging application (MarsEdit) and possibly iTunes. Apart from those, most of the applications I used a lot are also available on Linux. Emacs and Claws mail actually run a lot better on Linux than they do on OSX. I do have a solution for the blogging (org2blog with emacs), but replacing iTunes is still a problem;

So, now I have apple hardware all over and not using OSX on any of it. At first, that does not sound like a smart thing to do. From a financial point of view for one, most people argue that apple hardware may be expensive, but a lot of quality software comes included. Throwing the sofware away, which is effectively what you do when you go running linux on that hardware, does not make much sense then, does it?

What I found however, is that it is quite a challenge to match the macbook pro specs, build quality and features like the magsafe connector for the same price. Add to that an ability to drive the 30″ screen and it’s pretty darn difficult to find a machine other than the macbook pro series from apple. (I was charmed by the Sony Vaio Z series, but it can’t drive the 30″-screen and it’s a bit more expensive than an MBP too) Viewed from this (admittedly biased) angle it makes sense, even if you don’t plan on running OSX to buy a macbook pro again.

On top of all what is above, there is another issue which has been bothering me, and apparently I’m not alone in this, is the general direction Apple is taking. While I love their attention to detail and precise execution of production of their hardware, I loathe the way they treat (iPhone) developers and their strategy of control and censorship. The latest preview of OSX Lion only confirmed my concerns. Notably the appstore developments and the limitation of freedom to run sofware is bothering me. I guess the balance was held in some way with their sort-of-open contributions to several pieces of sofware (darwin, calendarserver, launchd etc.) but lately the scale tipped over for me.

I fully realize this is all subjective and food for rants and all, but hey, it’s my blog. :-)

Oct 11

Since moving from OSX to Linux, for reasons I will elaborate on in another post, the only real thing which I missed was the MarsEdit blogging application. The immediate effect is that both this blog and my cobra blog have not seen any posts since the switch.

Initially I did make an effort to create a VirtualBox image for MacOSX so I could potentially run OSX applications in my Ubuntu install, but Apple made a pretty good effort to prevent me from running a virtualized OSX, even if you have ticked all their boxes (read: spent enough money on both their hardware and software). So, for the moment, no OSX applications on my main machine anymore.

The next step was to decide on a new blogging solution, or perhaps publishing solution, as a replacement for MarsEdit. My requirements were as follows:

  • emacs based solution, preferably integrated with org-mode;
  • based on an api that wordpress supports;
  • reasonably active project and responsive.

Finding a solution that satisfies all 3 of the above requirements basically left me with org2blog. I did look at a couple of other solutions but none of them met all 3 requirements, amazingly.

The use of org2blog is pretty simple, especially if you are already using orgmode to publish documents. The gist of it is to start an outline header and start writing the blog-post. Alternatively the command M-x org2blog-new-entry can be used to start a blog-entry in a new buffer (presumably to be saved to a file later on). Once finished writing a C-c d keyboard shortcut publishes a buffer as a draft, where C-c p publishes the buffer as a finalized post. (Posting as a page in wordpress is also possible).

I’m using the post-per-buffer variety for this post, so I can attach the source for this posting at the end more easily. I also found that working in a one-posting-per-file matter is easier. (For starters, the org2blog key shortcuts work properly).

The concept of org2blog is rather simple. It piggybacks on the excellent export options already present in org-mode and exports the relevant piece of text to html, takes that output and uses the wordpress xml-rpc api to publish it.

This post contains a small set of examples which should be enough to fullfill the vast majority of my blogging-needs. I need a way to chop up text into paragraphs, marking some of my words with some inline markup and I need a way to insert images in a variety of ways. Additionally I want to be able to attach/link to files, preferably automatically attached to the blog-posting.

So, let’s have a look at the basic ingredients.

Headers

Outline headers in org-mode (the lines that start with one or more stars) are translated into html header elements. Here is an example of the first 5 levels of org-mode outline header levels:

Header 1

Header 2

Header 3

  • Header 4
    • Header 5

Headers (cont’d)

The limitation/feature of org-mode that a paragraph belongs to the immediate header above it is equally valid for the texts produced with the help of org2blog. In this example, had I not put the Header (cont’d) header above this paragraph, the text would have belonged to the Header 5 header.

With these, basic structuring of text is achieved. Within normal text, inline markup like bold, emphasized, underlined, striked through, and monospace and ver ba tim should work as well. (not sure what verbatim should produce, but typically a multiple of spaces is the way to distinguish it from normal monospaced paragraphs)

These two mechanisms should be enough to create readable blobs of texts, but obviously I would like to have some means to make my posts a bit more attractive; by including images.

Images

Images in org-mode are basically references / links to image locations. If such an image is a file on the local disk of the machine I’m working on, I can insert a link to that file in the usual org-mode way.

file:filename.png

Which results in this:

http://mrblog.nl/files/2010/10/blue.png

Users of org-mode may recognize this image as an example of the usage of the ditaa system. Processing of begin_src sections in the org file will be done prior to publishing, so the image does not even need to be linked explicitly, but can be an implicit result of code evaluation like in the example below:

#+begin_src ditaa :file filename.png :cmdline -r
+---------+
| cBLU    |
|         |
|    +----+
|    |cPNK|
|    |    |
+----+----+
#+end_src

http://mrblog.nl/files/2010/10/blue2.png

In this example the ditaa code evaluated delivered a file http://mrblog.nl/files/2010/10/blue2.png which was subsequently uploaded to the blog. (the problem here is that mentioning the filename translates it into the url on the server, the basename of the file is the local filename).

Using images which are already somewhere else on the web (I tend to use flickr.com for these) inserting a link to their location should suffice to get the image in the web page.

Example:

external image example

This text is the image caption.

So, with this basic knowledge I should be able to start publishing again.