Skip to content

Instantly share code, notes, and snippets.

;;; org-babel-clojure.el --- org-babel functions for clojure evaluation
;; Copyright (C) 2009 Joel Boehland
;; Author: Joel Boehland
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; Version: 0.01
;;; License:
(autoload 'whitespace-mode "whitespace" "Toggle whitespace visualization." t)
(autoload 'whitespace-toggle-options "whitespace"
"Toggle local `whitespace-mode' options." t)
(setq whitespace-line-column 80
whitespace-style '(trailing
lines
empty
tabs
(pallet.core/defnode my-node {})
(pallet.core/lift
{my-node (pallet.compute/make-unmanaged-node "tag" "184.106.227.79")}
:phase (pallet.resource/phase
(pallet.resource.exec-script/exec-script
(ls /))))
cat yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
@hugoduncan
hugoduncan / gist:628802
Created October 15, 2010 19:40
A ComputeService with fixed list of nodes
(ns pallet.compute.node-list-compute-service
"A jclouds compute service using a node list"
(:import org.jclouds.compute.ComputeService))
(defrecord NodeListComputeService
[node-list]
org.jclouds.compute.ComputeService
(listNodes [_] node-list)
(getNodeMetadata
[_ id]
@hugoduncan
hugoduncan / gist:630534
Created October 17, 2010 04:24
vmfest provider
(ns pallet.compute.vmfest
"A vmfest provider"
(:require
[pallet.compute :as compute]
[pallet.compute.jvm :as jvm]
[pallet.compute.implementation :as implementation]
[clojure.contrib.condition :as condition]
[clojure.string :as string]
[vmfest.core :as vmfest]))
@hugoduncan
hugoduncan / gist:631309
Created October 17, 2010 21:24
A somewhat cleaner version
(ns pallet.compute.jclouds-ssh-test
(:require
[clojure.contrib.logging :as logging])
(:import
[org.jclouds.ssh SshClient ExecResponse]
org.jclouds.io.Payload
org.jclouds.net.IPSocket))
(defn instantiate [impl-class & args]
@hugoduncan
hugoduncan / gist:639845
Created October 22, 2010 03:02
current state of pallet.compute.vmfest
(ns pallet.compute.vmfest
"A vmfest provider"
(:require
[pallet.compute :as compute]
[pallet.compute.jvm :as jvm]
[pallet.compute.implementation :as implementation]
[clojure.contrib.condition :as condition]
[clojure.string :as string]
[vmfest.virtualbox.vbox :as vbox]
[vmfest.machine :as machine])
@hugoduncan
hugoduncan / gist:644258
Created October 25, 2010 01:36
Version of vbox.clj that matches vmfest branch in pallet
(ns vmfest.virtualbox.vbox
(:use vmfest.machine
clojure.contrib.logging
[vmfest.util :as util])
(:import [com.sun.xml.ws.commons.virtualbox_3_2
IWebsessionManager
IVirtualBox
ISession
IWebsessionManager
IMachine]))
@hugoduncan
hugoduncan / gist:652256
Created October 28, 2010 20:22
Local resource definition for mounting an ebs volume in ec2
(pallet.resource/deflocal attach-volume
(attach-volume*
[request]
(jclouds-compute/with-compute-service [(:compute request)]
(volume/attach-volume :us-east-1 "INSTANCE" VOLUME_ID "/dev/sdh"))
request))