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 / change-time.sh
Created February 1, 2012 11:30
change time
#!/bin/bash
set -e
set -x
LOCALTZMD5=$(md5sum /etc/localtime|sed 's/ .*//')
TIMEZONE="Europe/London Europe/Paris America/Chicago America/Los_Angeles"
for tz in ${TIMEZONE};do
[[ -e /usr/share/zoneinfo/${tz} ]] || exit 1
md5=$(md5sum /usr/share/zoneinfo/${tz}|sed 's/ .*//')
[[ ${LOCALTZMD5} == ${md5} ]] && { echo "Current: ${tz}, $(date)" ; break ;}
@chmouel
chmouel / reuse-swift-memcache.diff
Created October 26, 2012 19:23
reuse swift memcache instead of spawning one
diff --git i/keystone/middleware/auth_token.py w/keystone/middleware/auth_token.py
index 5c198e8..8f0ceb3 100644
--- i/keystone/middleware/auth_token.py
+++ w/keystone/middleware/auth_token.py
@@ -237,23 +237,13 @@ class AuthProtocol(object):
# Token caching via memcache
self._cache = None
self._iso8601 = None
- memcache_servers = self._conf_get('memcache_servers')
# By default the token will be cached for 5 minutes
; Anything with Magit
(defvar anything-c-source-magit-repos
'((name . "Magit Repos")
(init . (lambda ()
(require 'magit)))
(candidates . (lambda () (magit-list-repos magit-repo-dirs)))
(filtered-candidate-transformer . anything-c-adaptive-sort)
(action
("Open Dir" . dired)
("Magit" . magit-status))
@chmouel
chmouel / which-one-not-on-master.zsh
Created February 14, 2013 15:35
Take bunch of git repos and show which one is not on master
#!/bin/zsh
for i in $PWD/*/.git(:h);do
pushd >/dev/null $i;
branch=${${"$(<.git/HEAD)"#ref: }#refs/heads/};
[[ ${branch} != master ]] && echo ${i}(:t) : ${branch}
popd >/dev/null
done
@chmouel
chmouel / update-git-repository.zsh
Last active December 13, 2015 18:09
On current directory if they are git update them if on master or fecth them on other branch and print the one who didn't get merged with origin.
#!/bin/zsh
set -e
PROCESS_DIR=${1}
[[ -n ${GIT_DIRS} && -z ${PROCESS_DIR} ]] && PROCESS_DIR=${GIT_DIRS}
typeset -A notprocessed
autoload -U colors
for gitdir in ${PROCESS_DIR};do
for i in $gitdir/*/.git(:h);do
diff --git i/keystone/common/wsgi.py w/keystone/common/wsgi.py
index 5abbc46..816f062 100644
--- i/keystone/common/wsgi.py
+++ w/keystone/common/wsgi.py
@@ -345,11 +345,21 @@ class Middleware(Application):
@webob.dec.wsgify(RequestClass=Request)
def __call__(self, request):
- response = self.process_request(request)
- if response:
#!/bin/bash
set -e
SUPERADMIN=$1
USER=$2
URL=$3
EXTRAS=$4
if [[ -z ${SUPERADMIN} || -z ${USER} || -z ${URL} ]];then
cat <<EOF
diff --git a/test/functionalnosetests/test_object.py b/test/functionalnosetests/test_object.py
index a0981d2..f86ab65 100755
--- a/test/functionalnosetests/test_object.py
+++ b/test/functionalnosetests/test_object.py
@@ -22,7 +22,8 @@ from uuid import uuid4
from swift.common.constraints import MAX_META_COUNT, MAX_META_NAME_LENGTH, \
MAX_META_OVERALL_SIZE, MAX_META_VALUE_LENGTH
-from swift_testing import check_response, retry, skip, skip3, swift_test_user
+from swift_testing import check_response, retry, skip, skip3, \
@chmouel
chmouel / ks.sh
Last active December 14, 2015 00:49
Get storage url from keystone
#!/bin/bash
set -e
[[ $1 == "-s" ]] && {
SHORT=yes
shift
}
#!/bin/bash
REVIEW=$1
GERRIT_USER=$(git config --get gitreview.username)
WHEREAMI=$(git rev-parse --abbrev-ref HEAD)
[[ -z ${WHEREAMI} ]] && {
echo "Cannot detect the current branch"
exit 1
}