Skip to content

Instantly share code, notes, and snippets.

View lordofthejars's full-sized avatar
🏠
Working from home

Alex Soto lordofthejars

🏠
Working from home
View GitHub Profile
# update the (outdated) package list
exec { "update-package-list":
command => "/usr/bin/sudo /usr/bin/apt-get update",
}
class java_6 {
package { "openjdk-6-jdk":
ensure => installed,
require => Exec["update-package-list"],
}
}
class tomee {
file {"/opt/tomee-1.5.1":
ensure => directory,
recurse => true,
} ->
exec { "download-tomee" :
command => "/usr/bin/wget http://apache.rediris.es/openejb/openejb-4.5.1/apache-tomee-1.5.1-webprofile.tar.gz -O
service { "tomee" :
provider => "init",
ensure => running,
start => "/opt/tomee-1.5.1/bin/startup.sh",
stop => "/opt/tomee-1.5.1/bin/shutdown.sh",
status => "",
restart => "",
hasstatus => false,
hasrestart => false,
require => [ Exec["unpack-tomee"], Package["openjdk-6-jdk"] ],
@lordofthejars
lordofthejars / init.pp
Created March 29, 2013 20:49
TomEE with Puppet
# update the (outdated) package list
exec { "update-package-list":
command => "/usr/bin/sudo /usr/bin/apt-get update",
}
class java_6 {
package { "openjdk-6-jdk":
ensure => installed,
require => Exec["update-package-list"],
import javax.annotation.Resource;
@Resource(name = "myDataSource")
private DataSource movieDatabase;
import java.net.UnknownHostException;
import com.mongodb.MongoClient;
public class MongoProvider {
private String address;
private int port;
public MongoClient mongoClient() throws UnknownHostException {
@Resource(name = "mongo")
private MongoProvider mongo;
public void createBookInMongo(Book book) throws Exception {
MongoClient mongoClient = mongo.mongoClient();
}
package com.lordofthejars.asciidoctorfy;
/**
*
* My name is *Alex*.
* I am 33 years _old_.
*
* Jump Jump +!!+.
*
* include::src/test/java/com/lordofthejars/asciidoctorfy/MyInterface.java[]
My name is *Alex*.
I am 33 years _old_.
Jump Jump +!!+.
[source, java]
----
public interface MyInterface {
void loginSuccess(Object hash);