Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / gist:66402712bb5fa1a8b3e4
Created November 27, 2015 11:37 — forked from chiquitinxx/gist:e0c561547e0e1b690767
My trait approach to an angular.js controller
//Grooscript Angular.js TODO example from https://angularjs.org/
//You need next release of grooscript to run it (1.0.1)
class TodoController implements AngularController {
def todos = [
[text:'learn angular', done: true],
[text:'build an angular app', done: false]
]
def addTodo() {
scope.todos << [text: scope.todoText, done: false]
scope.todoText = ''
@pmauduit
pmauduit / keybase.md
Created November 15, 2015 15:12
keybase verification

Keybase proof

I hereby claim:

  • I am pmauduit on github.
  • I am pmauduit (https://keybase.io/pmauduit) on keybase.
  • I have a public key whose fingerprint is 9193 DA20 F60A 9801 13DF 21A8 6F11 9B4E 77C8 965E

To claim this, I am signing this object:

@pmauduit
pmauduit / default.pp
Last active January 7, 2016 09:49
geOrchestra VM - manifest/default.pp provisionner
include ::apt
include ::sudo
include ::collectd
collectd::plugin { ['cpu', 'memory', 'disk']: } ->
# see below why this ...
exec { 'ensures jmx_memory is defined in collectd conf files':
command => "echo 'jmx_memory value:GAUGE:0:U' >> /etc/collectd/custom-types.db",
unless => "test $(grep jmx_memory /etc/collectd/custom-types.db | wc -l) -gt 0",
provider => "shell",
@pmauduit
pmauduit / gist:cdd819a85d566dd11df9
Last active September 24, 2015 13:27
JPS / Jstat - JVM heap memory monitoring pour les pauvres
watch -n1 "jstat -gc <PID> | awk '{if (NR !=1) {print \$7 - \$8}}'"
@pmauduit
pmauduit / mfapp.patch
Created September 21, 2015 14:03
patch mfapp - logging issue when uploading
diff --git a/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/upload/UpLoadFileManagement.java b/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/upload/UpLoadFileManagement.java
index 4f011b7..1cacf7f 100644
--- a/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/upload/UpLoadFileManagement.java
+++ b/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/upload/UpLoadFileManagement.java
@@ -374,18 +374,10 @@ public class UpLoadFileManagement {
fjson.setEncodeFeatureCollectionCRS(true);
fjson.writeFeatureCollection(featureCollection, writer);
-
- } catch (ProjectionException e) {
@pmauduit
pmauduit / collectd.conf
Last active May 21, 2019 13:13
[tomcat monitoring] JMX + collectd + logstash configuration
# add the following block:
<Plugin network>
Server "127.0.0.1"
</Plugin>
@pmauduit
pmauduit / main.c
Last active September 12, 2015 10:05
func pointer
#include <stdio.h>
#include <stdlib.h>
void sample() {
int i = 0;
char * test = malloc(10 * sizeof(char));
for (i = 0 ; i < 10 ; i++) {
test[i] = 'a';
}
test[9] = '\0';
@pmauduit
pmauduit / sample_raphink.pp
Created April 22, 2015 14:55
puppet augeas sample (tweaking tomcat config)
define tomcat::property (
$ensure = 'present',
$key = $name,
$target,
$value,
) {
case $ensure {
'present': {
$changes = "set ${key} '${value}'"
}
@pmauduit
pmauduit / Main.java
Last active August 29, 2015 14:13
Fiddling with java.lang.reflect.Proxy
import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.lang.Object;
public class Main {
interface IA {};
@pmauduit
pmauduit / context.xml
Created December 15, 2014 21:24
context.xml for tomcat, to load a specific classloader
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0