Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
#!/bin/bash
set -x
set -e
# SET THIS
SERVICE_HOST=
SERVICE_PROTOCOL=
ADMIN_PASSWORD=
SWIFT_SERVICE_PASSWORD=
for i in $(grep memcache_servers /etc/swift/proxy-server.conf|tail -1|sed 's/.*= //;s/,//g');do echo ${i%%:*}; echo stats|nc ${i%%:*} ${i##*:}|grep --color=none bytes;echo;done

PKI token overview.

PKI tokens has been implemented in keystone by Adam Young and others and was shipped for the OpenStack grizlly release. It is available in the v2.0 API of keystone.

PKI is a beautiful acronym to Public-key infrastructure which according to wikipedia defines it like this :

Public-key cryptography is a cryptographic technique that enables

#!/bin/bash
set -e
SWIFT_OPERATOR_ROLE=${SWIFT_OPERATOR_ROLE:-Member}
PASSWORD=ADMIN
function get_id () {
echo `"$@" | awk '/ id / { print $4 }'`
}
@chmouel
chmouel / swift-df.py
Last active December 17, 2015 12:49
Get the stats about account with swift and keystone.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 eNovance SAS <[email protected]>
#
# 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
#
#!/usr/bin/env bash
function readlinkf() {
python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $1
}
SHA=
if [[ $1 == "-m" ]];then
SHA=master
shift
# Swift Tools
set -e
function get_id () {
echo `"$@" | awk '/ id / { print $4 }'`
}
#Roles
ADMIN_ROLE=$(keystone role-list|awk '/admin/ {print $2}')
ANOTHER_ROLE=$(keystone role-list|awk '/anotherrole/ {print $2}')
@chmouel
chmouel / git-branch-cleanup.sh
Last active September 14, 2022 15:56
Delete merged gerrit git branch using Change-ID
#!/bin/zsh
declare -a unmerged
git rev-parse --show-toplevel 2>/dev/null >/dev/null || { echo "Not a git dir"; exit 1 ;}
git fetch origin;
git branch --merged|grep -v 'master'|xargs git branch -d
for branch in $( git branch --no-merged );do
@chmouel
chmouel / test_bulk_delete.sh
Created August 9, 2013 21:23
Random swift tests I am using when reviewing stuff.
#!/bin/bash
echo $RANDOM > /tmp/a.txt
echo $RANDOM > /tmp/b.txt
eval $(ks -s localhost demo:demo ADMIN)
swift post testbulk >/dev/null
swift upload testbulk /tmp/{a,b}.txt >/dev/null
@chmouel
chmouel / ldapsearch-devstack.sh
Created September 6, 2013 07:28
ldapsearch with devstack+ldap
source ~/devstack/localrc
ldapsearch -x -b 'dc=openstack,dc=org' -D 'dc=Manager,dc=openstack,dc=org' -w ${LDAP_PASSWORD}