This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cd () { | |
local -ri n=${#*}; | |
if [ $n -eq 0 -o -d "${!n}" -o "${!n}" == "-" ]; then | |
builtin cd "$@"; | |
else | |
local e="s:\.\.\.:../..:g"; | |
builtin cd "${@:1:$n-1}" $(sed -e$e -e$e -e$e <<< "${!n}"); | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from __future__ import print_function | |
import cProfile | |
from datetime import datetime | |
import os | |
import pstats | |
import resource | |
import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/ioctl.h> | |
#include <sys/stat.h> | |
#include <net/if.h> | |
#include <ctype.h> | |
#define ETHTOOL_GSET 0x1 | |
#define SIOCETHTOOL 0x8946 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(nova list |grep Running| awk '{ print $12 }' | cut -f2 -d=); do echo $i; ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null heat-admin@$i "sudo sosreport --batch; sudo chmod 644 /var/tmp/sos*xz"; scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null heat-admin@$i:/var/tmp/sos*xz .; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# by Damien Ciabrini & Michele Baldessari | |
# This function takes the resource name as a parameter and returns | |
# "clone", "master", "primitive" or exits with 1 | |
function get_resource_type() { | |
local clone_count | |
local master_count | |
local primitive_count | |
local bundle_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function apply_patch() { | |
local CHANGE=$1 | |
local REPO=$2 | |
local DIR=$3 | |
# patchset revision is 4th optional argument | |
if [[ -z ${4-} ]]; then | |
REF=$(curl -s "https://review.openstack.org/changes/?q=change:$CHANGE&o=CURRENT_REVISION" |tail -n+2|jq -r '.[] | .revisions[.current_revision] | .ref') | |
else | |
REF=$(curl -s "https://review.openstack.org/changes/?q=change:$CHANGE&o=ALL_REVISIONS" |tail -n+2| jq -r '.[] | .revisions | to_entries | map(select(.value._number=='$4')) | .[0]|.value.ref') | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ospgrep() { | |
echo "$*" | |
grep -E "\s\b(E[rR]{2}:?|alert|Traceback|TRACE|crit|fatal|HANDLER|TASK|PLAY|Unexpected|FAIL|[Ff]ail|denied|non-zero|[Tt]ime[d\s]?out|UNCAUGHT|EXCEPTION|Unknown|[Aa]ssertion|inuse)" $* | |
} | |
sprunge() { | |
if [ -n "$1" ]; then | |
curl -F 'sprunge=<-' "http://sprunge.us" <"$1" | |
else | |
curl -F 'sprunge=<-' "http://sprunge.us" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export OS_PROJECT_DOMAIN_NAME='Default' | |
export OS_USER_DOMAIN_NAME='Default' | |
export OS_PROJECT_NAME='admin' | |
export OS_USERNAME='admin' | |
export OS_AUTH_URL=http://192.168.24.2:5000/ | |
export OS_AUTH_TYPE='password' | |
export OS_IDENTITY_API_VERSION='3' | |
export OS_PASSWORD=$(sudo hiera -c /etc/puppet/hiera.yaml keystone::admin_password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
# This only works when ran from the undercloud on an infrared setup | |
SSH_OPT="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" | |
node0="controller-0" | |
node1="controller-1" | |
# Let's kill controller-0 and controller-1 leaving only controller-2 up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keystoneauth1 import session | |
from keystoneauth1.identity import v3 | |
from swiftclient.client import Connection | |
from tripleo_common.utils import swift as swiftutils | |
_authurl = 'http://192.168.24.1:5000/v3/' | |
_auth_version = '3' | |
_user = 'admin' | |
# (sudo hiera -c /etc/puppet/hiera.yaml keystone::admin_password) | |
_key = '6aMpWobr5ySX47vwJefUgMGAA' |
OlderNewer