Skip to content

Instantly share code, notes, and snippets.

View priteau's full-sized avatar

Pierre Riteau priteau

View GitHub Profile
#!/usr/bin/env python
from boto.ec2.connection import EC2Connection
from boto.regioninfo import RegionInfo
host = "svc.uc.futuregrid.org"
region = RegionInfo(name="Nimbus", endpoint=host)
conn = EC2Connection(region=region, port=8444, validate_certs=False)
@priteau
priteau / users_without_accounts.sh
Created March 12, 2013 19:47
A collection of FutureGrid scripts
#!/bin/sh
ALL_USERS=`nimbus-list-users % | awk '/display name/ { print $4; }'`
for user in $ALL_USERS; do
if ! id $user > /dev/null 2>&1; then
echo "$user"
fi
done
@priteau
priteau / Vagrantfile
Created June 21, 2012 09:09
A Vagrantfile for Nimbus Infrastructure development
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.provision :shell, :inline => "apt-get -y update"
config.vm.provision :shell, :inline => "apt-get -y install ack-grep ant build-essential default-jdk git junit4 python-dev python-pexpect sqlite3 vim"
config.vm.provision :shell, :inline => "su -l vagrant -c 'git clone git://github.com/nimbusproject/nimbus.git'"
#!/usr/bin/env python
import random
import sys
print random.expovariate(1.0/int(sys.argv[1]))
@priteau
priteau / g5k_nodes.rb
Created September 9, 2011 09:15
Compute the number of nodes on Grid'5000
#!/usr/bin/env ruby
require 'restfully'
grid = Restfully::Session.new(:base_uri => 'https://api.grid5000.fr/sid/grid5000').root
nnodes = grid.sites.inject(0) do |sum, s|
sum + s.clusters.inject(0) do |sum, c|
sum + c.nodes.length
end
@priteau
priteau / g5k_cores.rb
Created September 9, 2011 09:14
Compute the number of cores on Grid'5000
#!/usr/bin/env ruby
require 'restfully'
grid = Restfully::Session.new(:base_uri => 'https://api.grid5000.fr/sid/grid5000').root
ncores = grid.sites.inject(0) do |sum, s|
sum + s.clusters.inject(0) do |sum, c|
sum + (c.nodes.first['architecture']['smt_size'] * c.nodes.length)
end
@priteau
priteau / brews.txt
Created September 4, 2011 14:31
Homebrew formulas currently installed on my machine
ack
aspell --lang=en,fr
bash-completion
ctags
dos2unix
gist
git
gnuplot --pdf
hub
ipcalc
--- /home/priteau/hiredis/adapters/libev.h 2011-01-14 12:56:48.000000000 +0100
+++ /usr/local/include/hiredis/adapters/libev.h 2011-01-14 13:01:59.000000000 +0100
@@ -1,3 +1,6 @@
+#ifndef __HIREDIS_ADAPTERS_LIBEV_H
+#define __HIREDIS_ADAPTERS_LIBEV_H
+
#include <sys/types.h>
#include <ev.h>
#include "../hiredis.h"
@@ -10,7 +13,7 @@
@priteau
priteau / gist:551877
Created August 26, 2010 18:05
Patch to xen-3.0.3-105.el5_5.5 SPECS to fix QCOW images
diff --git a/xen.spec b/xen.spec
index 5222b70..30b9a69 100644
--- a/xen.spec
+++ b/xen.spec
@@ -3,7 +3,7 @@
Summary: Xen is a virtual machine monitor
Name: xen
Version: 3.0.3
-Release: 105%{?dist}.5
+Release: 105%{?dist}.6
@priteau
priteau / gist:551876
Created August 26, 2010 18:05
Patch to xen-3.0.3-105.el5_5.5 SOURCES to fix QCOW images
diff --git a/xen-blktap-qcow-empty.patch b/xen-blktap-qcow-empty.patch
new file mode 100644
index 0000000..adf2026
--- /dev/null
+++ b/xen-blktap-qcow-empty.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Keir Fraser <keir.fraser@citrix.com>
+# Date 1244023910 -3600
+# Node ID c5fb6374e79fba152e149cdd55a5744d43762667