zzamboni.org
Ideally Blue

zzamboni.org
Ideally Blue

Archive for

September 2010

Sep 28 / 9:39am

Making cygwin, Windows and emacs understand the same symlinks

Today I ran into the problem that symlinks created under cygwin using "ln -s" are not understood by Windows, and of course Windows shortcuts are seen by cygwin as regular files. Happily, this is a (semi-)solved problem. For reference, this is what needs to be done:

  1. Add "winsymlinks" to your CYGWIN environment variable. For example, in my .bashrc I have the following:

    export CYGWIN="nodosfilewarning winsymlinks"

    This makes cygwin create symlinks differently, in a form that is understood both by it and by Windows.
    This is the main step, and the only one if you just need access from the shell and from the Windows explorer. However, emacs still sees those symlinks as regular .lnk files. To fix this, follow the next step.

  2. Install the w32-symlinks.el package, and add the following to your .emacs file:

    (require 'w32-symlinks)

  3. Run M-x customize-option and enter w32-symlinks-handle-shortcuts as the variable to customize. Turn it on, save it for future sessions, and you are all set. The new symlinks should be properly understood by the cygwin shell, Windows explorer, and emacs. Of course, you will have to re-create any symlinks or shortcuts that you created prior to setting the winsymlinks option, for them to be created in the new format.

    Update: so this doesn't quite work on my system. I am using Emacs 23.1, and apparently w32-symlinks does not work properly in this version. If you have an older version (I hear Emacs 21 works well), then this might work for you. 

Filed under  //  annoyances   cygwin   howto   symlink   tips   windows  
Sep 28 / 2:22am

Website redesign and unification

There are still some rough edges, but by far the redesign and unification of zzamboni.org is done. With the same design you can now find my blogs (hosted by posterous.com), my project pages (hosted in github.com project repositories) and some static pages (hosted in my personal github.com pages repository, this includes the root, About and Code pages, as well as the static copy of my old blog BrT, which is the only one that retains its original design). The theme is a variation of Posterous' "Paramaibo".

I'm still playing with the design, and finishing some pages here and there. But overall things should be good, please let me know if you find anything broken.

Kudos to the Posterous and GitHub teams for building such useful, powerful and friendly tools and services.

Filed under  //  github   posterous   sitenews   web  
Sep 8 / 9:16pm

Cfengine3 lexer for Pygments

I have written a Cfengine3 lexer for Pygments, the open source syntax-highlighter used by Gist and many other sites. It seems to work fine on all the cfengine policy files I have tested, but if you find anything that doesn't quite work as expected, please let me know. This is my first-ever Pygments lexer, so if you are an expert and can advise me on better ways of doing things, I'd very much appreciate the feedback too.

Here's how to install it (again, I don't know if this is the better or easier way):

  1. Obtain the Pygments source code.
  2. Put the pygments_cfengine_lexer.py file into the pygments/lexers/ directory
  3. run (cd pygments/lexers; python _mapping.py)
  4. run ./setup.py install

If you already have Pygments installed, you should follow these instructions:

  1. Put the pygments_cfengine_lexer.py file in the installed pygments/lexers/ directory (on my Mac, this is /Library/Python/2.6/site-packages/Pygments-1.4-py2.6.egg/pygments/lexers, under Linux it should be something like /usr/lib/python2.6/site-packages/Pygments..../pygments/lexers)
  2. cd into that directory
  3. run "python _mapping.py"

Then run pygmentize on any .cf file, and it should output properly highlighted code. You can view a sample here.

Filed under  //  cfengine   pygments   python  
Sep 7 / 5:21pm

Google Scribe-generated prose (aka "Google Scribe channels Kanye West")

Google has launched a new labs project called Google Scribe, which essentially provides an auto-completion service. You type, it autocompletes. The following text was generated by typing a single space, and from then on simply accepting the default suggestions (pressing "Enter" every time the suggestion popup appeared). I had to stop at some point, but it seems like a good source of mindless entertainment. Also, the result varies depending on the initial seed word you provide, and also on whether you just accept blindly (Enter) or type spaces at certain places. These results also provide some insight into the training texts that were used ("I'ma let you finish...")

 There are no comments for this user yet and can not believe that there is anything you would not believe how much I loved them all and I'ma let you finish but Beyonce had one of these days I'll bet your life on the road today and they are nothing but another form of therapy for these patients.
Filed under  //  autocompletion   fun   google   scribe  
Sep 7 / 2:17pm

Storing CFEngine configuration in CVS

Media_httpsialorghowt_daqnn

Useful article about storing both development and production configurations of cfengine using a version control mechanism. I am in the process of developing a similar setup using git, I will share it here when I get it to work properly.

Filed under  //  #yam   cfengine   cvs   howto   subversion  
Sep 5 / 5:15pm

GTD Tip: one-key opening of INBOX notebook in OneNote

One of the most useful applications I have discovered since I had to switch to Windows as my main OS is OneNote, a really great note-taking application which I use for pretty much every data-storing and note-taking need. I use a OneNote notebook as part of my GTD inbox. Today's very simple tip is how to assign a keystroke for opening my Inbox notebook from anywhere in the system. Here are the steps:
  1. Download and install AutoHotKey, if you don't have it already (it's a really useful free application, well worth exploring).
  2. Add the following line to your default AutoHotKey.ahk file (normally in ~/Documents/AutoHotKey.ahk):

  3. Re-run AutoHotKey so it re-reads the config file.
Make sure you change the path of the file you want to open, and also the key to which you bind it, if don't like Win-i.

Of course, this is useful for one-key opening of any file you want.

Filed under  //  autohotkey   gtd   onenote   windows