Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / collectd.conf
Last active July 30, 2018 09:09 — forked from ajayverghese/collectd.conf
Sample collectd configuration to fetch jetty and jvm metrics for monitoring (and send to graphite)
LoadPlugin java
<Plugin "java">
JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
<Plugin "GenericJMX">
# Garbage collector information
<MBean "garbage_collector">
ObjectName "java.lang:type=GarbageCollector,*"
@pmauduit
pmauduit / postgres_table_row_count.sql
Created June 14, 2016 09:36
Row counts for all tables in a postgres db.
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
@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 / print_stacktrace.rb
Created May 11, 2012 14:37 — forked from alainravet/print_stacktrace.rb
How to print the stacktrace in Ruby
# How to print the stacktrace from anywhere :
# 1°
#------------------------------------------------------------------------------
module Kernel
def print_stacktrace
raise
rescue
puts $!.backtrace[1..-1].join("\n")
end