Skip to content

Instantly share code, notes, and snippets.

View jistr's full-sized avatar

Jiří Stránský jistr

View GitHub Profile
@jistr
jistr / nerd_tree_for_tabs.vim
Created March 10, 2011 20:40
Vim NERDTree always synchronized between tabs.
" Use this plugin instead: https://github.com/jistr/vim-nerdtree-tabs
source overcloudrc
neutron net-create default
neutron subnet-create --name default --gateway 172.20.0.1 default 172.20.0.0/24
neutron net-create nova --router:external --provider:network_type vlan --provider:physical_network datacentre --provider:segmentation_id 10
neutron subnet-create --name nova --enable_dhcp=False --allocation-pool=start=172.16.10.100,end=172.16.10.250 --gateway=172.16.10.251 nova 172.16.10.0/24
neutron subnet-update --dns-nameserver 10.34.32.1 nova
neutron security-group-rule-create default --ethertype IPv4 --direction ingress
# sudo ovs-vsctl add-port br-ctlplane vlan10 tag=10 -- set interface vlan10 type=internal
# sudo ip addr add 172.16.10.251/24 dev vlan10
# sudo ip link set vlan10 up
# sudo iptables -A BOOTSTACK_MASQ -s 172.16.10.0/24 ! -d 172.16.10.0/24 -j MASQUERADE -t nat
parameter_defaults:
ExternalNetCidr: '172.16.10.0/24'
ExternalAllocationPools: [{'start': '172.16.10.4', 'end': '172.16.10.99'}]
ExternalInterfaceDefaultRoute: '172.16.10.251'
ControlPlaneDefaultRoute: '192.0.2.1'
EC2MetadataIp: '192.0.2.1'
@jistr
jistr / get-role-ports.sh
Last active March 14, 2018 10:52
Fetch port information from a TripleO overcloud Heat stack
#!/bin/bash
# This script will fetch IP addresses assigned to ports on servers belonging
# to a particular role in the overcloud Heat stack. It's not optimized for everyday
# use and takes a while to complete, as it makes many Heat queries. This does not include
# e.g. VIPs.
# Run this script for each role you are interested in. Example usage:
# $ source stackrc
# $ bash get-role-ports.sh overcloud Controller
@jistr
jistr / couch_fixture.rb
Created January 22, 2011 00:13
Simple YAML -> CouchDB fixture loader for Rails
# YAML -> CouchDB fixture loader for Rails
# ========================================
# by Jiri Stransky (http://twitter.com/jistr)
# for use with testing database instances only ;)
#
# What it does:
# * Loads fixtures from "test/fixtures" directory.
# * Permits use of ERB in the fixtures.
# * Uses CouchRest.
#
@jistr
jistr / storage-environment-nfs.yaml
Last active February 28, 2017 14:09
NFS storage config for TripleO
parameters:
#### BACKEND SELECTION ####
## Whether to enable iscsi backend for Cinder.
CinderEnableIscsiBackend: false
## Whether to enable rbd (Ceph) backend for Cinder.
# CinderEnableRbdBackend: false
## Whether to enable NFS backend for Cinder.
CinderEnableNfsBackend: true
@jistr
jistr / beaker_uc_live_prep.sh
Last active December 26, 2015 20:49
Prepare a Beaker machine for Undercloud Live 2 node installation.
#!/bin/bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# install dependencies and wget
@jistr
jistr / tuskar_commands.md
Last active December 20, 2015 23:09
Tuskar CLI commands draft

Tuskar CLI commands draft

Racks

tuskar rack-list

tuskar rack-show <name or id>
@jistr
jistr / localrc
Created June 27, 2013 14:22
DevStack localrc for use with Fedora 18 (works as of 2013-06-27)
# http://fedoraproject.org/wiki/OpenStack_devstack
# http://devstack.org/localrc.html
# Check /etc/hosts and make sure that ::1 is bound to 'localhost6',
# not to 'localhost'.
DEST=$HOME/openstack
DATA_DIR=$DEST/data
LOGFILE=$DEST/logs/stack.log
@jistr
jistr / bigswitch-patch-image.sh
Last active August 29, 2015 14:28
TEMPORARY patching of tripleo environment with big switch extensions
#!/bin/bash
set -euxo pipefail
if [ $(id -un) != 'root' ]; then
echo "This needs to be run as root."
exit 1
fi
mkdir bigswitch-patch || true