My .emacs file

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)

Granting acces using rsa-key pairs.

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

    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 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.

Jane Goodall talks good sense

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.

How to grow your own fresh air

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.

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

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

Some thoughts about Zen-Cart

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.

Setting up Fedora as a local webserver

I’ve recently had to set up a couple of fedora installations as a web server, for the purpose of testing some PHP scripts (for example a Zen Cart install). It’s pretty trivial, but each time I wasted time remembering what it was I had to do.  Now that I’ve written this,  I doubt I’ll forget again.  Oh well.

So here’s what you have to do:

  1. Install PHP if it’s not there yet (yum install php)
  2. Start (or restart) httpd (service httpd restart).
  3. Put yer content into your systems html directory.  On Fedora that’s var/www/html
  4. You can now view the web content in your browser at http://localhost/

Peter Schiff is the man


Wow, this is just fantastic. I’m so glad someone cobbled this together. It’s a perfect little piece. Notice how the weaker Schiff’s antagonists positions are, the more they take a ridiculing antagonistic stance. At one point, when Schiff is predicting perfectly what’s going to happen, the commentator says “Okay Peter, I know you want to continue with your expose of Santa Claus”…

Keep this in mind whenever you see an empty suit ridiculing someone’s ideas. Sarcasm and ad hominem attacks are common weapons that they reach for when they don’t have any facts or evidence to back them up.

My Analysis of the CNBC debate on Marijuana legalization (or Untruths the Prohibitionists Tell).

In a fantastic demonstration of how much our national attitude to marijuana prohibition has changed in the short time since president Obama was elected, there was a serious discussion regardling the legalization of marijuana on CNBC.

Rob Kampia does a fantastic job in his media appearances.  He always comes across as calm, rational, and well informed.  Unfortunately these debate forums are atrocious when it comes to doing any kind of real analysis of an issue, as the participants simply don’t get enough time to challenge conveniently accepted falsehoods.

So I thought I’d point out the misinformation and disingenuity on the part of Asa Hutchinson which Rob didn’t have the opportunity to specifically address:

“Legalizing will expand use”.  Quoth mister Hutchinson:

The question is whether it should be expanded or legalized, absolutely not.  If you look at harmful drugs, whether it’s tobacco or other hard drugs such as marijuana, cocaine, methamphetamine, the objective of society is to reduce the use of harmful drugs.  If you legalize another harmful drug the question is will it expand use and avaiability?  The answer is absolutely yes!  Why would you want to do that?

In this statement, Mr. Hutchinson lumps marijuana, cocain and methamphetamine together. This is a common ploy trying to create the mental association of harm with marijuana, despite the fact that marijuana, cocaine, and methamphetamine are vastly different from one another with respect to their levels of harm. But mr. Kampia is right to simply ignore this, as it is a red herring.

The real lie is the statement that legalizing a drug will lead to an increase in the use of a drug. Mr Kampia makes a valid comparison to Alcohol prohibition, which the announcer fails to fathom. What Mr. Kampia is saying is prohibition does not reduce cannabis use. Since prohibtion has been put in place, marijuana use in America has increased, not decreased. 30 years of a draconian war on drugs have not helped either. On the other hand, Holland, where marijuana can be legally bought, sold and smoked, has lower cannabis consumption than its neighboring countries, where Marijuana is illegal. Oh, and  Decriminalization has also had a positive influence on Portugal’s drug problem.. In other words, prohibition does no good, only harm.

“The population resists the the legalisation of marijuana”

Thus far in the last 8 years they have not been successful in changing the law. In fact Alaska decriminalized Marijuana, when they saw it became a huge problem they adjusted the law and recriminalized it. And so the population still resists the legalization of marijuana. But it’s a public decision, but whenever you talk about the cost benefit, first of all the figures on enforcement thats applies across the board whether it’s all illegal drugs. If you legalize one drug you’ve still got enforcement coss on the whole vast range of methamphetamine, other uh, illegal drugs.

I think the strategy here is “if you can’t blind them with your brilliance, baffle them with your bullshit”. Put more cynically, in order to defend an indefensible policy, a common tactic is to lie so many times ina given statement, that its challenging for your debate opponent to respond intelligently — they just don’t know where to start.
The anouncer penetrates his bullshit on the cost front. I’d just like to point out: look there’s that anaology to the methamphetamine boogyman. Who cares that legalizing marijuana would free up resources for methamphetmine combat? Who cares that evidence suggests that treatment and counceling would probably do more good at combating methamphetamine use than criminal processes?

His citation of the status of Marijuana in Alaska is equally fascinating. There is no part of what he said that is truthful. As near as I can tell he was referring to this, but do your own research on the subject.
And of course his argument boils down to”look, pot’s illegal, it wouldn’t be illegal in a democracy if people didn’t want it to be illegal! So stop trying to make it legal!”. Baffle with bullshit. It’s such a fucking stupid argument it’s impossible to argue against it. It also completely ignores the fact that many states have decriminalized marijuana, but are suffering under federal policies.

“Prohibition saves lives”

If your motivation is to bring revenue to the government: legalize, regulate. But if your motivation is to reduce the usage, to save teenage lives, to reduce dependence, to strengthen our culture, then the cost is worth it and the revenue should not be a motivation.

Baldface lie, as I’ve pointed out above. I like that Rob Kampia points out the lie in his following line of bullshit about the health consquences of marijuana.

I love it that one of their commentators call marijuana a natural resource.