Skip to content

Instantly share code, notes, and snippets.

View jjo's full-sized avatar
🏠
Working from home

JuanJo Ciarlante jjo

🏠
Working from home
View GitHub Profile
From 828996c831ee96947b785cfb8f376752ea02b69a Mon Sep 17 00:00:00 2001
From: JuanJo Ciarlante <[email protected]>
Date: Sun, 13 Sep 2009 13:43:04 +0200
Subject: [PATCH] * rebased openvpn-2.1_rc1b.jjo.20061206.d.patch
* passes {udp,tcp}x{v4,v6} loopback tests
* passes {udp,tcp}x{v6} remote tests
---
buffer.c | 13 ++
configure.ac | 16 ++
uvtool: support multiple bridges, eg: --bridge br0 --bridge br1
live patching: patch -p0 -d /usr/lib/python2.7/dist-packages < /path/to/uvtool-multi-bridge.diff
=== modified file 'uvtool/libvirt/kvm.py'
--- uvtool/libvirt/kvm.py 2014-04-01 11:27:14 +0000
+++ uvtool/libvirt/kvm.py 2014-09-19 18:06:20 +0000
@@ -257,7 +257,8 @@
@jjo
jjo / gist:682caad81d15597d1739
Created September 24, 2014 19:30
keybase.md
### Keybase proof
I hereby claim:
* I am jjo on github.
* I am jjo (https://keybase.io/jjo) on keybase.
* I have a public key whose fingerprint is 0EFF 8F64 566F 06EF 52DE 81F9 09D5 FB6E 8050 D21C
To claim this, I am signing this object:
#!/bin/bash
# Manually setup juju mongodb clustering when failed from unresolvable hostnames,
# eg when using MaaS + LXC provisioning, see lp#1274947
set -u
SERVICE=${1:-mongodb}
echo "*** $SERVICE: checking clustered units..."
replset=$(juju get $SERVICE| python -c 'import yaml, sys;print yaml.load(sys.stdin)["settings"]["replicaset"]["value"]')
units=$(juju status $SERVICE | \
python -c 'import yaml, sys;print " ".join(sorted(yaml.load(sys.stdin)["services"]["'$SERVICE'"]["units"].keys()))')
# set positional parameters to $units, for easier handling (shift, $1, $2, etc)
@jjo
jjo / vip-units.sh
Created October 1, 2014 19:03
vip-units.sh: show juju unit holding the vip for each passed service, or --all // keywords: juju, openstack, ha, vip
#!/bin/bash
# vip-units.sh: show juju unit holding the vip for each passed service, or --all
# it forks for each service, to lower result times
#
# Author: JuanJo Ciarlante <[email protected]>
# License: GPLv3
#
# Show unit holding the vip, unfortunately can't use "crm foo"
# as it shows hostnames, which are useless for LXC over MaaS
services=${*:?missing service(s), eg: keystone cinder}
## Workaround openstack nova+openvswitch mtu issues when no jumbo frames are available,
## by setting up udev at neutron-gateway to hook on routing interface creation to
## lower the MTU (thus trigger ICMPs for PMTU discovery)
## See: https://blueprints.launchpad.net/neutron/+spec/network-options-mtu
## keywords: openstack, nova, openvswitch, mtu, 1500, no jumbo frames
## Create these two files:
@jjo
jjo / juju-deployer-diff-fixes-for-services-without-units-and-single-valued-cfg-tags.diff
Last active August 29, 2015 14:08
juju-deployer/diff-fixes-for-services-without-units-and-single-valued-cfg-tags
=== modified file 'deployer/action/diff.py'
--- deployer/action/diff.py 2013-11-29 21:55:56 +0000
+++ deployer/action/diff.py 2014-10-22 16:51:05 +0000
@@ -30,7 +30,7 @@
'constraints'] = self.env.get_constraints(svc_name)
self.env_state['services'][svc_name][
'unit_count'] = len(self.env_status[
- 'services'][svc_name]['units'])
+ 'services'][svc_name].get('units',{}))
rels.update(self._load_rels(svc_name))
@jjo
jjo / heat-neutron-net.yaml
Last active August 29, 2015 14:09
HOT template to create a new neutron network plus a router to the public network
heat_template_version: 2013-05-23
description: >
HOT template to create a new neutron network plus a router to the public
network
parameters:
key_name:
type: string
description: Name of keypair to assign to servers
public_net:
@jjo
jjo / red.py
Last active August 29, 2015 14:17
#!/usr/bin/python
"RED (random early drop) simple implementation"
import random
import unittest
# pylint: disable=C0103,C0111,R0904
def request_ok(current, th_min, th_max):
"""return OK with a probability proportional to
'low' current, between th_min and th_max"""
Allows eg:
CLASSPATH=/path/to/hadoop-common-x.y.z.jar ant compile-native
diff --git a/build.xml b/build.xml
index cc9bfd0..b9da3e9 100644
--- a/build.xml
+++ b/build.xml
@@ -226,7 +226,8 @@
<mkdir dir="${build.native}/lib"/>