Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
@chmouel
chmouel / php-opencloud-enocloud.php
Created September 16, 2013 13:38
Connecting to eNocloud with php-opencloud
$endpoint = "http://os.enocloud.com:5000/v2.0";
$credentials = array(
'username' => 'chmouel',
'tenantName' => 'chmouel',
'password' => 'password',
);
$connection = new \OpenCloud\OpenStack($endpoint, $credentials);
$conn = $connection->ObjectStore($name = 'swift', $region = 'RegionOne');
@chmouel
chmouel / git-browse-review
Last active December 23, 2015 19:19
Browse current review in browser
#!/bin/bash
# Browse current review in browser
# Chmouel Boudjnah <[email protected]>
set -e
function readlinkf() {
python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $1
}
function get-gitreview () {
@chmouel
chmouel / git-os-show-job-output
Last active December 23, 2015 20:09
show openstack job output.
#!/bin/bash
# Get console.html for some job
# without arguments list the jobs.
# Chmouel Boudjnah <[email protected]>
set -e
GATE=$1
function readlinkf() {
python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $1
}

Python SwiftClient Rewrite

Introduction

While talking with Leah and Darryl it was becoming apparent that the current swiftclient had some limitations impossible to fix/workaround and a complete new approach to swiftclient to cleanup the old interfaces was needed.

A lot of the spaghetti code we have right now is historical due of

@chmouel
chmouel / git-jenkins-error.py
Last active January 1, 2016 20:09
Script that will get the failed jobs and save the console.html (to /tmp) This probably will work only on OpenStack Gerrit/Jenkins infra.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Simple launch gerrit-jenkins-error inside a git repo would get the failed
# job for the current commit (using the changeId) or you can add an
# argument be it the change-id the review number or even something
# like https://review.openstack.org/#/c/101010/ and it would do the
# right thing™
#
# Use the -t option to specify the output to something than /tmp
@chmouel
chmouel / rax-export-domain.py
Last active January 2, 2016 04:49
Export RAX domain
#!/usr/bin/env python
"""Simple script to export rackspace cloud dns
Usage: python export-domain.py domain
You need to have the python-clouddns package install from github :
https://github.com/rackerlabs/python-clouddns
You need to have the env varibale defined with :
@chmouel
chmouel / upgit
Created January 16, 2014 08:32
git pull my git repo fetching only if it's inside a local change.
#!/bin/zsh
set -e
if [[ $1 == "-c" ]];then
clean=yes
shift
fi
if [[ -z $@ ]];then
DIRS=( /opt/stack /opt/stack/GIT )
else
DIRS=$@
@chmouel
chmouel / pckeyboardhack-change-capslock-to-80.png
Last active January 3, 2016 19:49
Keyremap4macbook: change Caps-Lock to CMD-Tab. Assuming you remapped your CAPSLOCK in PCKeyboardHack to 80 (which is F19) then just add that to your private.xml
pckeyboardhack-change-capslock-to-80.png
'''
Created on Aug 28, 2013
@author: cgrimm
'''
import cPickle as pickle
import time
import hashlib
import sys
from datetime import datetime, tzinfo, timedelta
@chmouel
chmouel / rebase-chained-patch.sh
Last active September 30, 2021 07:43
If you have a gerrit review that follow-up another review and if the review A had rebased you end up in a outdated branch, this script takes an argument the parent branch and rebase the current patch against it.
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: Chmouel Boudjnah <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#