Skip to content

Instantly share code, notes, and snippets.

View tbatchelli's full-sized avatar

Antoni Batchelli tbatchelli

View GitHub Profile
@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
@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">
(defpallet
:services {
:virtualbox{
:provider "node-list"
:node-list [["your-node1" "your-group" xx.xx.xx.xx :ubuntu]]}})
@tbatchelli
tbatchelli / gist:2474428
Created April 23, 2012 23:07
Installation of a new OS on Virtualbox
(use '[vmfest.manager :only [server]])
(def my-server (server "http://localhost:18083"))
(use '[visaje.core :only [install-os]])
(install-os my-server
{:name "debian-test-2"
:disk-location "/tmp/debian-test-2.vdi"
:disk-size (* 4 1024)
:os-iso-location
"/Users/tbatchelli/Desktop/ISOS/debian-6.0.2.1-amd64-netinst.iso"
@tbatchelli
tbatchelli / gist:2784314
Created May 24, 2012 21:23
basic setup of aws
(defpallet
:services
{:aws {:provider "aws-ec2"
:identity "<id>"
:credential "<cred>"}})
@tbatchelli
tbatchelli / gist:2917315
Created June 12, 2012 12:49
example node-list config
{:node-list
[["g1-node-1" "group-1" "10.0.0.1" :debian :os-version "6.0.1"]
["g1-node-2" "group-1" "10.0.0.2" :debian :os-version "6.0.1"]
["g2-node-1" "group-2" "192.168.0.1" :centos :os-version "5.3"]
["g2-node-2" "group-2" "192.168.0.2" :centos :os-version "5.3"]
["g2-node-3" "group-2" "192.168.0.3" :centos :os-version "5.3"]] ...}
@tbatchelli
tbatchelli / logback.xml
Created June 12, 2012 21:00
sample logback config for vmfest
<configuration scan="true" scanPeriod="1 seconds" debug="false">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level - %msg%n</pattern>
</encoder>
</appender>
Cmd echo "package-manager update ..."
{ aptitude update || true; } || { echo "package-manager update " failed; exit 1; } >&2
echo "...done"
echo "Packages..."
{ { debconf-set-selections <<EOF
debconf debconf/frontend select noninteractive
debconf debconf/frontend seen false
EOF
} && aptitude install -q -y sudo+ && aptitude search "?and(?installed, ?name(^sudo$))" | grep "sudo"; } || { echo "Packages" failed; exit 1; } >&2
echo "...done"
@tbatchelli
tbatchelli / logback.xml
Created July 24, 2012 22:59
logback.xml for better-logs branches of pallet and stevedore.
<configuration scan="true" scanPeriod="5 seconds" debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- 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 %logger{36} - %msg%n</pattern>
</encoder>
@tbatchelli
tbatchelli / gist:4080617
Created November 15, 2012 19:22
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