Archive for May, 2009

My .emacs file

 | May 19, 2009 4:36 am

Since I often need a copy of my emacs file somewhere where it’s not worth pulling my whole sysadmin git repository, I’m a gonna put my .emacs file here.  Maybe someone else will find it useful.  It basically does the following:

  • makes my background color a little less harsh.
  • enables syntax highlighting by default.
  • makes the selected region highlighted (this behavior will be default in the next version of emacs, but I’m using 22.x at the moment).
  • modify the tab width to 3.
  • enable org mode
  • make line numbering available (this is sometimes useful).

I’ll be keeping this up to date as my make changes…

;;-------------------------------------
;; Some preferences:
(set-background-color "antique white")
;; I want syntax highlighting by default.
(global-font-lock-mode 1)
;; I want to see the selected region (this will be default in v23).
(transient-mark-mode 1)
;; I like small indents.
(setq standard-indent 3);
(setq default-tab-width 3);
;; I don't want to see the splash screen.
(setq inhibit-startup-message t);

;;-----------------------------------------------
;; org mode setup
;;------------------------------------------------
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

;;(global-set-key "\C-o" ctl-x-map)
(global-set-key [?\C-c ?l] 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

;;---------------------------------------------------
;; For special packages:
;;---------------------------------------------------
;; Add local lisp folder to load-path
;;(setq load-path (append load-path (list "~/.emacs.d/elisp")))
;; sometimes line numbering is useful.
(require 'linum)
Share on Facebook

Granting acces using rsa-key pairs.

 | May 18, 2009 8:32 am

This is another thing I have to do rarely enough that I forget the commands, but often enough it’s worth keeping a note of it. I use git, ssh, scp, etc. all the damn time between various computers, and it’s stupid to keep entering passwords every time. You can get around this using ssh-agent.  The process is pretty short:

  1. Generate a public key.  Logon to the host want to connect from:
     #ssh-keygen -t dsa

    This generates a key pair (of type dsa), both of which are located in the .ssh directory.  The files will be id_dsa and id_dsa.pub.  The latter file is the public key, and the former the private key.  By copying the public key to the .ssh/, we provide ssh with an alternate means of confirming our access rights.  Rather than prompt for a password, it checks that the private key (client side) matches that of the server (public key).

  2. Append the generated key to the servers .ssh/authorized_keys file.  The simplest way is:
    ssh-copy-id -i ~/.ssh/id_dsa user_name@remote_host.org

That’s it.  Now you should be able to scp, ssh, or git (via ssh) to that machine without entering a password. You may have to enter the private key (the passphrase you provided when generating your key pairs) the first time you use ssh from the pc (this is the default behaviour on Fedora).
If you run into problems, this is discussed in more detail here.

Share on Facebook

Jane Goodall talks good sense

 | May 9, 2009 4:56 am

So, another fantastic video over at TED. The talk title is “What separates us from the apes?”. It turns out it is our highly developed language. The talk goes over so much more though: environmental catastrophy, destruction of diversity, and of course our mad cruelty to animals. She’s a fantastically wise and observant person. A pretty attractive woman too.

Share on Facebook

How to grow your own fresh air

 | May 7, 2009 4:34 am

I’ve been sharing some of my favourite videos over at TED with some of my friends, and I decided I should start advertising them over here. Below is an awesome one which I plan to apply to my own apartment. Particularly the mother in law plant. I’ll be putting 8 of those in the bedroom.

Share on Facebook

Emacs over terminal to dreamhost, 5C and 5D instead of forward-word and backward-word

 | May 4, 2009 5:05 am

I’ve been unable to use the C-rightarrow and C-leftarrow to get forwad word and backward word behavior when using emacs within a ssh to my dreamhost host.  I finally figured out how to fix the problem.  In my .emacs file:

(global-set-key "\M-[1;5C" 'forward-word) ; Ctrl+right->forward word
(global-set-key "\M-[1;5D" 'backward-word); Ctrl+left-> backward word

You might be interested in my entire .emacs file, which adds a few niceties:

(set-background-color "light grey")
(global-font-lock-mode 1)
(transient-mark-mode 1)
(setq default-tab-width 3);
(setq standard-indent 3);
(setq inhibit-startup-message t);
(global-set-key "\M-[1;5C" 'forward-word)     ; Ctrl+right->forward word
(global-set-key "\M-[1;5D" 'backward-word) ; Ctrl+left ->backward word
Share on Facebook

Some thoughts about Zen-Cart

 | May 1, 2009 7:14 am

For my current position at Gecko-Research, I have to set up an online shop for their fledgling software retailing business.  Since they want to keep initial costs low, and since I prefer to use free software whenever reasonable, I started looking around for something gpl’d.  I decided on Zen-Cart since it seemed to have the most active community.  It’s apparently a branch of another project called osCommerce.  Both are gpl’d project, but neither are paritcularly open.  I suspect everything I’m about to say about Zen-Cart is true about osCommerce, but it’s conjecture, as I haven’t spent too much time investigating the issue.

I think I can say some things  specifically about Zen-Cart however.  The Zen Cart project seems to be suffering from a kind of schizophrenia.  I think the people currenlty running the project, and owning the trademark, really want to be selling proprietary, copyright software, but since they started with GPL’d code, they can’t.  Whether or not this the case, they certainly seem to be pretty frustrated.  It’s been years since they’ve had a release.  They keep promising more and more whenevery they finally do release again, but they keep pushing the release date forward, and the proposed release number up.  That’s always a bad sign.  It’s especially wierd in a free software project, because it’s just a cheesy marketing ploy: oh yeah it’s been years since we released anything, but that’s becuase we’re totally making huge changes.

The problem is they suffer from a lack of income, since their software is gpl’d you can download it for free.  That’s okay, but they refuse to accept the advantages that the gpl grants: namely you gain an active an helpful user body.  They seem to chase off anyone who tries to contribute.  For example, if you want to contribute to their documentation wiki, you have to send a PM to one of the adminstrators to ask for a wiki account.   There’s nowhere on the wiki that tells you this either (well there is now, i added it).  I had to post a message to a forum, and then follow a link someone sent in reply.  I had to tell them what I was interested in working on, and  had to respond to several antagonistic emails from one of the site admin when I tried to fix up a few other pages which were particularly rotten.  No wonder many of the pages haven’t been touched since 2005, and why the wiki is stagnating and largely useless.

Anyway, it’s a usefull enough codebase that I’m going to use it and not start from scratch.  But for the sake of my work colleagues, I think it’s important I document some of the issues I had to deal with to get our shop up and running properly.  I would prefer to do this in the zen cart wiki or forums, but my impression is I have to be fairly careful what I say over there, or I’ll just get banned.    Thus I’ll be posting a bunch of aritcles on the subject here, whenever there’s something I, or my colleagues might need access to in the future, particularly when I think that information might be more generally useful. I’ve also had some thoughts regarding the nature of working on a distributed, and particularly a free project, and how to keep it from staggering like the Zen Cart project seems to be doing.  In other words, I’ll be doing a little venting here as well.  So I”ve made a category for the subject.

Share on Facebook