Skip to content

Instantly share code, notes, and snippets.

View pires's full-sized avatar
🇵🇹

Pires pires

🇵🇹
View GitHub Profile
@pires
pires / SetupTestSuite.java
Created June 4, 2012 11:12
Glassfish Embedded TestNG Bootstrap (EJB + WAR)
/**
* Testing environment configuration.
*/
public final class SetupTestSuite {
public final static String PU_NAME = "qos-test";
public final static int SERVER_PORT = 8181;
private final String JDBC_POOL = "MyPool";
private final String JDBC_RESOURCE = "jdbc/memory/qos";
@pires
pires / load_config.dart
Last active December 15, 2015 12:19
Prepare a PostgreSQL URI by reading test/config.yaml. Optional parameters will take precedence, if any.
library postgresql_test;
import 'dart:async';
import 'package:unittest/unittest.dart';
import 'package:dart_config/default_server.dart' as cfg;
// load from file
Future<String> load({String user, String pwd, String host, int port, String db}){
var completer = new Completer<String>();
cfg.loadConfig('test/config.yaml').then((Map config) {
public class KunderaExport {
public static void main(String... args) {
generateDdl();
}
private void generateDdl() throws Exception {
getLog().info("Processing persistence unit: " + persistenceUnitName);
// instantiate app metadata
@pires
pires / GenericObdCommand.java
Last active December 16, 2015 09:39
Generic ObdCommand that accepts a message in byte notation.
public class GenericObdCommand extends ObdCommand {
/**
* Default ctor.
*/
public GenericObdCommand(String bytes) {
super(bytes);
}
/**
# Mongo DB options, configure these if you are using the "mongo" option for one of your stores
mongoDbHost=127.0.0.1
mongoDbPort=27018
mongoDbDatabase=db_test
package utils;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
/**
* UTF-8 friendly ResourceBundle support
*
#!/bin/bash
# Nice reference: https://developers.google.com/compute/docs/images#buildingimage
# Would be even nicer if Google would use it in their own debian images.
echo "Running provisioner"
# Update APT cache, upgrade packages
apt-get update && apt-get -yq dist-upgrade
#cloud-config
---
write_files:
- path: /opt/bin/waiter.sh
owner: root
content: |
#! /usr/bin/bash
until curl http://127.0.0.1:4001/v2/machines; do sleep 2; done
coreos:
@pires
pires / node.yaml
Last active August 29, 2015 14:13
#cloud-config
coreos:
units:
- name: etcd.service
mask: true
- name: fleet.service
command: start
content: |
[Unit]
@pires
pires / kube-apiserver
Created April 15, 2015 21:08
kubernetes flags 0.15.0
kube-apiserver \
--allow_privileged=true \
--insecure_bind_address=0.0.0.0 \
--insecure_port=8080 \
--kubelet_https=true \
--secure_port=6443 \
--portal_net=10.100.0.0/16 \
--etcd_servers=http://127.0.0.1:4001 \
--public_address_override=172.17.8.101 \
--cloud_provider=__CLOUDPROVIDER__