Skip to content

Instantly share code, notes, and snippets.

View chamerling's full-sized avatar
🤡
Pouet

Christophe Hamerling chamerling

🤡
Pouet
View GitHub Profile
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@chamerling
chamerling / gist:1601535
Created January 12, 2012 16:45 — forked from nbarendt/gist:1249754
Brute force chef-solo install script
#!/bin/bash
set -x
set -e
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
wget -qO - http://apt.opscode.com/[email protected] | sudo apt-key add -
# set up debconf preseed so there's no prompt for the chef server URL
export PRESEED_FILE=/tmp/tmp_chef_preseed
@chamerling
chamerling / CEPModule.java
Created February 14, 2012 11:21
SeaCloud
package com.ebmwebsourcing.seacloud.model;
import javax.jws.WebParam;
import net.cloudbees.fifiant.soceda.services.esperengine.ListAllStatementsResponse;
import seacloud.petalslink.com.service.management.cloud._1_0.CloudManagementException;
public interface CEPModule {
public ListAllStatementsResponse listAllStatements(net.cloudbees.fifiant.soceda.services.esperengine.ListAllStatements parameters) throws CloudManagementException;
@sauthieg
sauthieg / clone-ow2-utilities.sh
Created July 25, 2012 14:43
Usage: clone-ow2-utilities.sh [--ssh]
#! /bin/sh
wget http://gitorious.ow2.org/ow2-utilities.xml
option=$1
for tag in clone_url; do
repositories=`grep $tag ow2-utilities.xml \
| tr -d [\ ] \
| sed 's/^<.*>\([^<].*\)<.*>$/\1/'`
@thomseddon
thomseddon / gist:3511330
Last active February 16, 2026 02:22
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@letmaik
letmaik / .travis.yml
Last active September 12, 2024 10:41
Deploy snapshots to Sonatype after Travis CI build
language: java
env:
global:
- SONATYPE_USERNAME=yourusername
- secure: "your encrypted SONATYPE_PASSWORD=pass"
after_success:
- python addServer.py
- mvn clean deploy --settings ~/.m2/mySettings.xml
@chamerling
chamerling / gist:4232276
Created December 7, 2012 10:08
Get all PLAY repositories
# Install JSON gem before: gem install json
curl -s https://api.github.com/orgs/play-project/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
#!/usr/bin/env node
var fs = require('fs');
function getTemperature (device) {
fs.readFile('/sys/bus/w1/devices/' + device + '/w1_slave', 'utf8', function (err, data) {
var output = data.match(/t=(\d+)/);
var calc = output[1] / 1000;
@obazoud
obazoud / Dockerfile
Last active December 22, 2015 04:58
Build Docker images - Jenkins - https://index.docker.io/u/obazoud/jenkins/
# Install Jenkins 1.529 on Ubuntu 12.10
# Build
# sudo docker run -p 8080:8080 -i -t obazoud/jenkins /bin/bash
# Install
# sudo docker pull obazoud/jenkins
# Use
# cd /opt && java -jar jenkins.war