Skip to content

Instantly share code, notes, and snippets.

@ericcitaire
ericcitaire / .gitignore
Last active June 10, 2019 17:03
D3 JezzBall
/.project
/.settings
LoadingCache<String, Future<String>> cache = CacheBuilder.newBuilder()
.build(
new CacheLoader<String, Future<String>>() {
private int counter = 0;
@Override
public Future<String> load(final String key) {
++counter;
if (counter == 1) {
System.out.println("premier load");
import sys
import boto
import boto.ec2
ec2 = boto.ec2.connect_to_region('eu-west-1')
reservations = ec2.get_all_instances()
def ow_stack(instance):
if 'opsworks:stack' in instance.tags:
return instance.tags['opsworks:stack']
@ericcitaire
ericcitaire / pom_version.py
Created December 21, 2015 13:28
Prints the pom version
#!/usr/bin/env python
import sys
import xml.etree.ElementTree as ET
for arg in sys.argv[1:]:
elements = ET.parse(arg).findall("./pom:version", {'pom': 'http://maven.apache.org/POM/4.0.0'})
if len(elements) == 1:
print elements[0].text
elif len(elements) == 0:
@ericcitaire
ericcitaire / demo.html
Created August 1, 2016 17:03
gwt-d3 #139
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
@ericcitaire
ericcitaire / Vagrantfile
Created November 16, 2016 10:04
OpenStack Vagrant VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@ericcitaire
ericcitaire / weblo-hash.py
Last active November 29, 2016 20:04
WebLogic hashed passwords
# https://atheek.wordpress.com/2012/05/29/weblogic-sql-authenticator-and-salted-hash-passwords/
from hashlib import sha1
from base64 import b64encode
def hash(password, salt):
sha_hashed = sha1(salt + password)
encoded = b64encode(sha_hashed.digest())
return "{SSHA}" + salt + encoded
@ericcitaire
ericcitaire / JenkinsBuildStatusHistory.md
Created April 12, 2017 14:20 — forked from kalenwatermeyer/JenkinsBuildStatusHistory.md
Jenkins - Build status history for multiple jobs

Jenkins Build Status History - screenshot

Description

The Jenkins Build Status History widget periodically fetches a snapshot of build status information for a specified list of jobs on a Jenkins CI server.

As time progresses, new build status samples are added to the right, while older samples are removed from the left. This view allows you to quickly see the health of your jobs as well as any time trends.

Calls are made to the Jenkins API to retrieve the name and color properties of listed jobs in a JSON form. The color of a given job represents its current build status (i.e. "blue" => successful build, "red" => failing build and so on).

#!/bin/bash
vimdiff <(xmllint --c14n "$1") <(xmllint --c14n "$2")
@ericcitaire
ericcitaire / debootstrap.md
Last active August 6, 2018 11:15 — forked from tr3buchet/debootstrap.md
debian usb debootstrap

configuration variables

usb_device=/dev/sdb
apt_mirror=http://ftp.debian.org/debian/

make sure any needed utilities are installed

sudo apt-get update
sudo apt-get install debootstrap coreutils util-linux e2fsprogs