Skip to content

Instantly share code, notes, and snippets.

View tbatchelli's full-sized avatar

Antoni Batchelli tbatchelli

View GitHub Profile
Pause for ldap startup...
...done
Directory /home/tbatchelli/ldifs...
...done
remote-file /home/tbatchelli/ldifs/countries.ldif...
MD5 sum is d7f02d0fd511cf23aaec47f39d935f9b /home/tbatchelli/ldifs/countries.ldif
...done
Conditionally load LDIF into LDAP server...
...done
remote-file /home/tbatchelli/ldifs/base-structure.ldif...
Error executing script :
:cmd echo "Check LDAP server is configured for monitoring..."
{ ldapsearch -w fred -D "cn=Manager,dc=gogrid,dc=com" -x -l 10 -s base -b cn=Monitor "(objectClass=*)" "@monitorServer"; } || { echo "Check LDAP server is configured for monitoring" failed; exit 1; } >&2
echo "...done"
echo "Load LDIF into LDAP server..."
{ {
ldapadd -h localhost -p 389 -w fred -D "cn=Manager,dc=gogrid,dc=com" -x <<'EOF'
dn: [email protected],ou=people,dc=external,dc=gogrid,dc=com
objectClass: top
objectClass: gogridObject
remote-file /var/lib/ldap/DB_CONFIG...
MD5 sum is 379919de537cf1efc5c1cc54fea605da /var/lib/ldap/DB_CONFIG
ls: /var/lib/ldap/DB_CONFIG.~[0-9]*~: No such file or directory
...done
remote-file /etc/sysconfig/ldap...
--- /etc/sysconfig/ldap 2010-11-29 00:50:22.000000000 -0800
+++ /etc/sysconfig/ldap.new 2011-01-13 13:18:29.000000000 -0800
@@ -1,15 +1,3 @@
-# Parameters to ulimit called right before starting slapd
-# - use this to change system limits for slapd
[laptop:tbatchelli:~/dev/gogrid/simple-test]$ lein pallet -P gogrid-public nodes
Exception in thread "main" java.lang.ClassCastException (NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5415)
at clojure.lang.Compiler.eval(Compiler.java:5415)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$null_opt.invoke(main.clj:279)
@tbatchelli
tbatchelli / test-google.clj
Created November 29, 2010 01:19
How to get the content of all the links in google's home page.
(use 'clj-coffeescript.shell)
(with-new-scope
(load-library "jquery")
;; load apache.org and collect the text of all the links in that page
(js "window.location='http://google.com'; $('a').text();"))
@tbatchelli
tbatchelli / test_shell.clj
Created November 28, 2010 03:50
test_shell.clj
(deftest test-set-scope
(let [original-ns *ns*]
(try (in-ns 'outer-test-scope)
(use 'clj-coffeescript.shell)
(is (nil? *runtime*)
"Verify that *runtime* is nil before the test")
(let [outer-ns *ns*
new-scope (new-scope)]
(try
(in-ns 'test-new-scope-ns)
[laptop:tbatchelli:~/dev/clojur...rates/wordpress]$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.cloudhoist:wordpress:jar:0.4.0-SNAPSHOT
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [enforcer:enforce {execution: enforce-maven}]
[INFO] [enforcer:enforce {execution: enforce-banned-dependencies}]
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources {execution: default-resources}]
(defn start
"Starts the virtual machine represented by 'machine'.
Optional parameters are:
:session-type 'gui', 'vrdp' or 'sdl'. Default is 'gui'
:env environment as String to be passed to the machine at startup. See IVirtualbox::openRemoteSession for more details"
[^Machine machine & opt-kv]
(session/with-vbox (:server machine) [mgr vbox]
(let [opts (apply hash-map opt-kv)
machine-id (:id machine)
(comment
(use 'vmfest.virtualbox.virtualbox)
(use 'vmfest.virtualbox.machine)
(use 'vmfest.virtualbox.guest-os-type)
;; find by name or UUID
(def my-machine (find-machine "http://localhost:18083" "" "" "CentOS Minimal"))
;; -> #:vmfest.virtualbox.model.machine{
;; :id "197c694b-fb56-43ed-88f5-f62769134442",
;; :server #:vmfest.virtualbox.model.server{
(ns bacug
(:use org.jclouds.compute
org.jclouds.aws.ebs
clojure.pprint))
;; define a connection to the cloud provider
(def compute (compute-service "ec2"
"<identity>"
"<credentials>" :ssh))