Skip to content

Instantly share code, notes, and snippets.

View johnyzed's full-sized avatar

Jonathann Zenou johnyzed

View GitHub Profile
@johnyzed
johnyzed / alter_global_param.groovy
Created June 9, 2015 05:14
alter jenkins global parameter
import jenkins.*
import jenkins.model.*
import hudson.*
import hudson.model.*
nodes = Jenkins.getInstance().getGlobalNodeProperties()
@johnyzed
johnyzed / incapsula.py
Created August 7, 2014 11:15
Python script that collect data from Incapsula API and returns it as JSON for Splunk integration
import pycurl
import cStringIO
import json
import base64
import sys
import re
from pprint import pprint
from datetime import datetime
from calendar import timegm
@johnyzed
johnyzed / data_export.py
Created August 7, 2014 11:08
Python script that collect data from Mixpanel API and return funnels data in JSON
import calendar, datetime,time
import hashlib
import pycurl
import cStringIO
import json
def get_sig(api_key,api_secret,expire_time,funnel_id,unit):
api_str='api_key=%s' % api_key
expire_str='expire=%s' % expire_time
@johnyzed
johnyzed / mem_size.rb
Created July 9, 2014 10:37
facter script that create custom facts on the memory of the node
require 'facter'
{ :MemorySizeRaw => "MemTotal",
:MemoryFreeRaw => "MemFree",
:SwapSizeRaw => "SwapTotal",
:SwapFreeRaw => "SwapFree"
}.each do |fact, name|
Facter.add(fact) do
confine :kernel => :linux
setcode do