Skip to content

Instantly share code, notes, and snippets.

View maurorappa's full-sized avatar

maurorappa maurorappa

  • zerolatency
  • Asso
View GitHub Profile
@maurorappa
maurorappa / jenkins-backup.sh
Created October 27, 2016 12:43
Jenkins Backup bash script with all latest job status
#!/bin/bash -xe
##################################################################################
function usage(){
echo "usage: $(basename $0) /path/to/jenkins_home archive.tar.gz"
}
##################################################################################
readonly JENKINS_HOME=$1
readonly DEST_FILE=$2
@maurorappa
maurorappa / s3upload.py
Created April 8, 2016 16:00
S3 upload via proxy (tested with Squid)
import boto
import sys,os.path
from boto.s3.key import Key
file_name=sys.argv[1]
if not os.path.isfile(file_name):
print file_name + " not found!"
sys.exit()
aws_access_key=''
@maurorappa
maurorappa / rpmqa.py
Last active July 14, 2017 08:50
Query RPM database in Python
#!/usr/bin/python
# Acts like rpm -qa and lists the names of all the installed packages.
# Usage:
# python rpmqa.py
# This toool was used to debug RedHat Bugzilla BZ#1253608 for RHEL6 (not public)
# the relative errata is: https://rhn.redhat.com/errata/RHBA-2015-1809.html
import rpm
import datetime
@maurorappa
maurorappa / Monitoring via JMX for long periods
Last active April 27, 2021 00:27
Monitoring via JMX for long periods
I had a problem which required a closed monitoring of AMQ resources.
All Enterprise Java program can be monitored by JMX and the standard interface to visualize instrumentation data is JConsole.
Jconsole is great for realtime monitoring, but our load tests were running for hours and we needed all raw data to be parsed offline, a Jconsole graph is an approximation for our purposes.
I wanted a Cli tool to save on file all raw numbers; first I needed a java utility to query java processes via JMX protocol.
I choose jmxterm ( http://wiki.cyclopsgroup.org/jmxterm/ ) which is simple and scriptable.