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 / create_cs_server.py
Created April 20, 2011 17:14
Create Cloud Server using novaclient library
# -*- encoding: utf-8 -*-
import novaclient
import sys
import time
# User Configuration
USERNAME=""
API_KEY=""
AUTH_URL="https://lon.auth.api.rackspacecloud.com/v1.0"
@chmouel
chmouel / cloud.py
Created April 21, 2011 15:18
Cloud iPython
import os
import cloudfiles
import novaclient
# File to be placed in ~/.ipython/cloud.py
# In your shell env file (ie: ~/.bashrc)
#
# alias icloud='ipython -p cloud'
# export UK_RCLOUD_USER=""
@chmouel
chmouel / clouddns-test.py
Created May 11, 2011 16:19
Cloud DNS testing
import httplib
import urlparse
import json
import os
def get_auth(username, key, auth_url):
u = urlparse.urlparse(auth_url)
cls = u.scheme == 'https' and httplib.HTTPSConnection or \
httplib.HTTPConnection
import os
US_RCLOUD_USER = os.environ.get("US_RCLOUD_USER")
US_RCLOUD_KEY = os.environ.get("US_RCLOUD_KEY")
US_RCLOUD_AURL = os.environ.get("US_RCLOUD_AURL")
UK_RCLOUD_USER = os.environ.get("UK_RCLOUD_USER")
UK_RCLOUD_KEY = os.environ.get("UK_RCLOUD_KEY")
UK_RCLOUD_AURL = os.environ.get("UK_RCLOUD_AURL")
@chmouel
chmouel / noclientdebug.py
Created September 2, 2011 02:54
debugging novaclient
import novaclient
from novaclient.v1_1 import client
import logging
ch = logging.StreamHandler()
novaclient.client._logger.setLevel(logging.DEBUG)
novaclient.client._logger.addHandler(ch)
@chmouel
chmouel / i.py
Created September 28, 2011 10:10
Ipython 0.11 embedding shell
from IPython.frontend.terminal.embed import InteractiveShellEmbed
shell = InteractiveShellEmbed(); shell()
@chmouel
chmouel / keystone-initial-data.sh
Created October 4, 2011 15:20
Add Keystone for Swift
#!/bin/bash
set -e
set -x
# Add tenant
keystone-manage tenant add admin
# Add user admin with password secrete to tenant admin
keystone-manage user add admin secrete admin
@chmouel
chmouel / keystone-initial-data.sh
Created October 4, 2011 15:20
Add Keystone for Swift
#!/bin/bash
set -e
set -x
# Add tenant
keystone-manage tenant add admin
# Add user admin with password secrete to tenant admin
keystone-manage user add admin secrete admin
@chmouel
chmouel / get-account-stats.bash
Created October 27, 2011 14:46
Get account stats
#!/bin/bash
set -e
#CONFIGURE THIS
AUTH_URL=
SUPER_ADMIN_KEY=
[[ -z ${AUTH_URL} || -z ${SUPER_ADMIN_KEY} ]] && { echo "Configure this script by vim $0 and adjust the variable at the top"; exit 1 ;}
account="$1"
@chmouel
chmouel / update-rax-cdns.py
Created January 27, 2012 00:27
Add records to rackspace clouddns via scripts
#!/usr/bin/env python
"""Simple script to update DNS record with Rackspace CLoud DNS
Usage: python updatedomain.py fqdn newip
- The domain of the fqdn need to be already registered with Rackspace Cloud.
You need to have the python-clouddns package install from github :
http://github.com/rackspace/python-clouddns