Skip to content

Instantly share code, notes, and snippets.

View tbatchelli's full-sized avatar

Antoni Batchelli tbatchelli

View GitHub Profile
@tbatchelli
tbatchelli / logback.xml
Created April 4, 2012 23:08
logback.xml for pallet (basic)
<configuration scan="true" scanPeriod="1 seconds" debug="false">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="COMPUTEFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/jclouds-compute.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@tbatchelli
tbatchelli / gist:1995239
Created March 7, 2012 19:13 — forked from hugoduncan/gist:1994274
new pallet first steps

Zero to running in five minutes with lein.

Install leiningen

The first thing we need is leiningen, a build tool for clojure. You can downlaod this with your web browser, curl or wget or your favourite download tool. Here we show using curl.

bash$ curl -O http://github.com/technomancy/leiningen/raw/stable/bin/lein
(use 'pallet.crate.automated-admin-user)
(def my-group
(pallet.core/group-spec "my-group"
:phases {:bootstrap (phase-fn (automated-admin-user))}))
(pallet.core/converge
{my-group 1}
:compute (pallet.configure/compute-service :gogrid))
@tbatchelli
tbatchelli / gist:1540925
Created December 30, 2011 18:29
bridged interface configuration for pallet 0.6.x and vmfest 2.3
:virtualbox
{:provider "virtualbox"
:environment
{:image
{:bridged-network "Airport 2" ;; The name of the network interface to use for bridging
}}
@tbatchelli
tbatchelli / log4j.xml
Created December 29, 2011 22:00
log4j.xml file for vmfest
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="Threshold" value="ERROR" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %p %c{1}:%L - %m%n"/>
</layout>
@tbatchelli
tbatchelli / logback.xml
Created December 22, 2011 23:46
logback config for pallet
<configuration scan="true" scanPeriod="1 seconds" debug="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<ImmediateFlush>true</ImmediateFlush>
<!-- deny all events with a level below INFO, that is TRACE and DEBUG -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level - %msg%n</pattern>
</encoder>
@tbatchelli
tbatchelli / spec.clj
Created December 21, 2011 21:59
VMFest Machine specs
(def machine-config
{:cpu-count 2
:memory-size 555
:network [{:attachment-type :bridged
:host-interface "en1: Airport 2"}
nil
{:attachment-type :bridged
:host-interface "nothing"}]
:storage [{:name "IDE Controller"
:bus :ide
@tbatchelli
tbatchelli / spec.clj
Created December 21, 2011 21:59
VMFest Machine specs
(def machine-config
{:cpu-count 2
:memory-size 555
:network [{:attachment-type :bridged
:host-interface "en1: Airport 2"}
nil
{:attachment-type :bridged
:host-interface "nothing"}]
:storage [{:name "IDE Controller"
:bus :ide
@tbatchelli
tbatchelli / settings.clj
Created October 20, 2011 20:02
Getting settings for all nodes for all groups
(defn get-group-settings [session group]
(let [nodes (session/nodes-in-group session group)]
(zipmap (map #(compute/primary-ip %) nodes)
(map (fn [node]
(parameter/get-node-settings session node group nil))
nodes))))
(defn get-all-settings [session]
(let [groups (map :group-name (:groups session))]
(zipmap
@tbatchelli
tbatchelli / squid.conf
Created September 1, 2011 18:02
squid config for vmfest.
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed