Skip to content

Instantly share code, notes, and snippets.

Mathieu Poussin kedare

Block or report user

Report or block kedare

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:32b6a7b4730af89c21efa2f78f1657f2
# Standard packages
{% for package in pillar["ci"]["packages"]["standards"] %}
Package {{ package }} should have the revision {{ pillar["ci"]["revision"] }} active for the {{ pillar['application_environment'] }} environment:
svn.latest:
- name: http://xxxx/{{ pillar['application_environment'] }}/{{ package }}/trunk
- target: C:\inetpub\wwwroot\{{ pillar['application_environment'] }}\{{ package }}
- rev: {{ pillar["ci"]["revision"] }}
- username: {{ pillar["ci"]["svn"]["username"] }}
- password: {{ pillar["ci"]["svn"]["password"] }}
View sum.go
package main
import (
"crypto/sha256"
"encoding/hex"
"io/ioutil"
"os"
"sync"
"github.com/fatih/color"
@kedare
kedare / disk.py
Created Jan 18, 2016
Powerline disk space widget
View disk.py
import os
import humanfriendly
def disk(pl, monitor="/", threshold_gig=10):
partition = os.statvfs(monitor)
available = partition.f_bsize * partition.f_bavail
available_gig = available / 1024 ** 2
threshold_crit_gig = threshold_gig*0.5
ret = []
View tmux_pre_attach.pl
#!/usr/bin/perl -w
use v5.14;
use Curses::UI;
my $cui = new Curses::UI( -color_support => 1, -clear_on_exit => 1);
for my $second (reverse(1..2)) {
$cui->status("Attaching to TMUX in $second second(s)\n Press CTRL-C to avoid TMUX");
sleep 1;
}
View gist:d4ac3c15f9d8424a84aa
xml2json = require "xml2json"
fs = require "fs"
util = require "util"
request = require "request"
#sleep = require "sleep"
tumblr_name = process.argv[2]
api_endpoint = util.format "http://%s.tumblr.com/api/read", tumblr_name
start = 0
num = 50
View gist:8db2a727c7c3504bec8d
<?php
function secondsToTime($seconds) {
$dtF = new DateTime("@0");
$dtT = new DateTime("@$seconds");
return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
// HIGHEST UPTIMES
View gist:11369097
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @author Adam Armstrong <adama@memetic.org>
@kedare
kedare / purge.py
Last active Jul 6, 2017
A purge script for Observium
View purge.py
#! /usr/bin/env python
"""
purge.py A small tool that allows you to easily purge old entries in the eventlog and syslog table
Author: Mathieu Poussin <mathieu.poussin@sodexo.com>
Date: Mar 2014
Usage: This program accepts many arguments :
--syslog : Enable the syslog table purge
--eventlog : Enable the eventlog table purge
@kedare
kedare / graph.py
Last active Aug 29, 2015
A graphviz map generator that gets data from Observium database
View graph.py
#! /usr/bin/env python
"""
graph.py A small tool that allows you to generate a visual representation of your devices and links using discovery
protocols from the links table of Observium
Author: Mathieu Poussin <mathieu.poussin@oxalide.com>
Date: 01/2015
Usage: This program accepts many arguments :
--debug : Debug mode, write one image per step
You can’t perform that action at this time.