The gnuplot graphing utility has always had excellent support for multiple terminal types. While the X11 terminal is a satisfactory GUI view for the graphs, I prefer to use the AquaTerm terminal on OSX as it is more ‘Mac-like’ and feels more natural.
Also, I do prefer to compile gnuplot by myself on OSX rather than downloading the pre-packaged binaries – as this gives me more control over the compilation (including getting around the stupid Apple readline bug – where Apple has essentially shipped a broken readline by using libedit to emulate the non-existent libreadline).
This local compile requires that AquaTerm be installed so that the library dependencies for aquaterm exists in:
and the corresponding headers are available at:
In addition, the AquaTerm.app itself resides in /Applications.
However, on OS X Snow Leopard, there is a catch – the version of AquaTerm is 32 bit, whereas the default compilation of gnuport results in a 64-bit version – which is not able to load the 32-bit libaquaterm dynamic libraries.
In such a case, the gnuplot compilation does succeed – however, the default terminal becomes the X11 version – which is back to square-one.
A darwinports port does exist for gnuplot – however, as mentioned in an earlier post, this port seems to depend on half of the port repository (i.e., a ton of stuff you do NOT want gets installed as well).
However, there is a easier way to get around this situation. Here’s how.
- First install the default binary for AquaTerm from SourceForge and install normally. This step is to basically setup the right folders and symlinks so that you do not have to muck with these later
- Now install AquaTerm again from Darwinports – this port has the correct patches needed – and more importantly – builds a 64 bit version by default. This will also install the application under /Applications/MacPorts/
- Now comes the fun part. We will replace two folders from the darwinports version to the previously installed AquaTerm.
- Step 1: Replace /Library/Frameworks/AquaTerm.framework with /opt/local/Library/Frameworks/AquaTerm.framework. This will ensure that the correct 64 bit AquaTerm libraries get referenced by the gnuplot compilation
- Step 2: Replace /Applications/AquaTerm.app with /Applications/MacPorts/AquaTerm.app. This will ensure that the correct 64-bit AquaTerm binary is in the correct location
- Step 3 (Optional): You can now uninstall the darwinports version by running sudo port uninstall aquaterm from a terminal window
- Download the source code for gnuplot and extract the same.
- Run ./configure (using a command line parameter to ignore the broken Apple readline) and then make and make install (install will happen in /usr/local)
That’s it! The compilation should now succeed and gnuplot will be linked with the correct 64-bit aquaterm dynamic library. Enjoy!
While setting up this site (which is based on WordPress), I was evaluating
a few offline blog editors, and came upon MarsEdit and Ecto – both of which seem to be well-accepted commercial blog editors in the Mac
world. Both allow easy setup of the blog configurations, have a hassle-free
configuration, and allow a mail-inbox like access to previous posts.
My needs for the offline blogging tool are:
- Support WordPress (obviously)
- Support formatting in Markdown (the default WordPress formatting is atrocious). Note that you will need to enable Markdown syntax on your blog by using any of the plugins available for WordPress.
- Provide easy access to prior posts
- Have a decent text editor built-in
- Provide at least a subset of my current editing muscle-memory
However, I happen to be a Emacs fanatic, and perform majority of my day-to-day computing tasks in that tool (another post on this later). So I googled around a bit for the current state of blogging using Emacs, and voila! EmacsWiki pointed to the weblogger mode, which supports WordPress, and also handles Markdown formatting easily with the markdown mode. And to top it off, the code is open-source, which means that I can tinker and change the functionality when needed.
The next section describes the Emacs configuration needed to setup offline blogging using Weblogger mode.
- Rename both files, as the downloaded files have the incorrect suffix/extension .doc, which should be removed
- Add the renamed .el files in your Emacs load-path directory (e.g., site-lisp)
- Load the adding the following lines to your .emacs (i.e., the user-init) file: (require ‘weblogger)
- Restart Emacs, and initialize the blog-setup by issuing the command: M-x weblogger-setup-weblog and follow the prompts. Note that for WordPress, your blog URL needs to be suffixed with /xmlrpc.php
- If the setup worked fine till this point, you can fetch all previous posts by using the M-x weblogger-fetch-entries command, and
- Then access each entry using the command: M-x weblogger-next-entry or M-x weblogger-previous-entry
You can create a new post by using the weblogger-start-entry command. This brings up a mail-like buffer, where the subject line denotes title of the post, and the body is the actual post content.
At this point, you can enter your post-entry (using Markdown syntax, if you have enabled the WordPress plugin, or else by using raw HTML). Once the content is completed, press C-x C-s to save the file, which will also post the entry to your blog.
Caveat: The current Emacs mode does not provide any categorization mechanism, which still needs to be done via the admin interface on your blog. Categorization is actually supported. While composing the post, use the Keywords: meta-header to provide names of existing categories, separated by comma.
This setup has been working pretty well for me, and lets me use all the other
Emacs functionalities as well. In summary, the pros and cons are:
- Enables me to blog from within Emacs, and use all the Emacs-goodness the platform brings
- Emacs is a multi-platform editor, and I can blog from any system I have access to (i.e., not tied to my Mac)
- I can tweak the behavior of the system by directly accessing the code, if needed
- This is a free and open-source solution
- No preview feature. This can be a problem for some.. You can use the <a href=”http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip”>markdown</a> along with markdown mode to perform easy previews using the system default browser. Use the markdown-preview command in Emacs to access this feature. Another alternate mechanism is using the Maruku tool, which requires Ruby to be installed. Ruby is installed by default in OS X
Note that Ecto and MarsEdit are both capable systems, and are more Mac-like. I do have the trial versions downloaded, and will be trying both out over the next couple of weeks as well.