Skip to content

Instantly share code, notes, and snippets.

(1..params[:no_of_instances]).each do |index|
file_name = "#{params[:name]}#{index}"
execute "Stopping #{file_name}" do
command %Q{bash -c '/sbin/initctl stop #{file_name} ; true' }
action :run
end
template "/etc/event.d/#{file_name}" do
source "#{params[:name]}.erb"
mode 0644
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Sending HTTP Request via GET to /roles/runa-base
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Sending HTTP Request via GET to /roles/swarm-staging
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Loading Recipe profile
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Found recipe default in cookbook profile
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Loading Recipe java
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Found recipe default in cookbook java
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Loading Recipe capistrano
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Found recipe default in cookbook capistrano
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Loading Recipe emacs
[Sat, 05 Sep 2009 02:09:58 +0000] DEBUG: Found recipe default in cookbook emacs
root@domU-12-31-39-02-96-42:~# chef-client --server https://chef-server.runa.com -l debug
[Thu, 10 Sep 2009 21:59:10 +0000] INFO: Starting Chef Run
[Thu, 10 Sep 2009 21:59:10 +0000] DEBUG: Loading plugin os
[Thu, 10 Sep 2009 21:59:10 +0000] DEBUG: Loading plugin ruby
[Thu, 10 Sep 2009 21:59:10 +0000] DEBUG: Loading plugin languages
[Thu, 10 Sep 2009 21:59:11 +0000] DEBUG: Loading plugin kernel
[Thu, 10 Sep 2009 21:59:11 +0000] DEBUG: ---- Begin uname -s STDOUT ----
[Thu, 10 Sep 2009 21:59:11 +0000] DEBUG: Linux
[Thu, 10 Sep 2009 21:59:11 +0000] DEBUG: ---- End uname -s STDOUT ----
[Thu, 10 Sep 2009 21:59:11 +0000] DEBUG: ---- Begin uname -s STDERR ----
;; A Simple macro that enable to mark your test
;; to pending
(defmacro deftest-pending [name & body]
(let [message (str name " is pending !!")]
`(deftest ~name
(println ~message))))
;; To mark a test pending all you have to do is
;; Change deftest to deftest-pending
(deftest-pending list-of-account-should-return-empty-array
@sivajag
sivajag / gist:1046688
Created June 25, 2011 17:30
core.clj
(defproject address_book "1.0.0-SNAPSHOT"
:description "Address Book"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
[compojure "0.6.2"]
[ring/ring-core "0.3.7"]
[ring/ring-jetty-adapter "0.2.3"]]
:dev-dependencies [[swank-clojure "1.2.1"]]
:main address-book.core)
(deftest ^:integration test-friends-list
(in-facebook-lab FB-APP-ID FB-APP-SECRET
(let [jack (test-user/create "jack")
jill (test-user/create "jill")
mary (test-user/create "mary")]
(login-as jack)
(test-user/make-friend jill)
(test-user/make-friend mary)
(let [friends-of-jack (gateway/friends-list (test-user/access-token))]
@sivajag
sivajag / project.clj
Created September 21, 2013 22:49
Logging Related Deps for Clojure
;;Logging Related Stuff
[org.clojure/tools.logging "0.2.4"]
[ch.qos.logback/logback-classic "1.0.7"]
[ch.qos.logback/logback-core "1.0.6"]
[ch.qos.logback.contrib/logback-json-classic "0.1.2"]
[ch.qos.logback.contrib/logback-jackson "0.1.2"]
[org.codehaus.jackson/jackson-core-asl "1.9.12"]
[com.fasterxml.jackson.core/jackson-databind "2.2.2"]
[org.slf4j/slf4j-api "1.7.0"]
[clj-logging-config "1.9.10" :exclusions [log4j]]
@sivajag
sivajag / project.clj
Created September 21, 2013 22:56
Exclusions
:exclusions [org.clojure/clojure
org.slf4j/slf4j-log4j12
org.slf4j/slf4j-api
org.slf4j/slf4j-nop
log4j/log4j
log4j
commons-logging/commons-logging
org.clojure/tools.logging]
@sivajag
sivajag / logback.xml
Created September 21, 2013 22:56
logback,xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/development.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>logs/development.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
{
"timestamp": "2013-08-26T21:58:54.970Z",
"level": "DEBUG",
"thread": "304416706@qtp-1620812446-0",
"mdc": {
"ip-address": "192.0.0.1",
"guid": "51f051bf-32c2-4a06-a81e-806e80966787",
"request-method": "put",
"facility": "api",
"query-string": "",