Skip to content

Instantly share code, notes, and snippets.

View cloudnull's full-sized avatar
👨‍🚒
Yup

Kevin Carter cloudnull

👨‍🚒
Yup
View GitHub Profile
@cloudnull
cloudnull / grub-setup.sh
Created February 26, 2014 16:36
make grub boot faster.
# Setup the box for AIO use
function setup_grub() {
if [ -f "/etc/default/grub" ];then
cat > /etc/default/grub <<EOF
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR="Rackspace Private Cloud"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
@cloudnull
cloudnull / openstack-Fixerator.py
Last active August 29, 2015 13:57
This is a tool, you should use it.
#!/usr/bin/env python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# Reset nova endpoints
function reset_nova_endpoint() {
set +e
echo "Resetting Nova Endpoints"
# Load the Openstack Credentials
MYSQLCRD="/root/.my.cnf"
USERNAME="$(awk -F'=' '/user/ {print $2}' ${MYSQLCRD})"
PASSWORD="$(awk -F'=' '/password/ {print $2}' ${MYSQLCRD})"
NUKECMD="delete from endpoint where region=\"RegionOne\";"
mysql -u "${USERNAME}" -p"${PASSWORD}" -o keystone -e "${NUKECMD}"
@cloudnull
cloudnull / list_sorting.py
Created March 13, 2014 20:42
sort a list of integers
def linear_search(collection, low, high):
"""Returns a list of integers.
Search through a collection for all integers in a range.
>>> # sorted was add as the search should be a sorted list.
>>> Input = sorted([21, 23, 25, 28, 35, 45])
>>> linear_search(collection=Input, low=24, high=36)
:param collection: ``list``
@cloudnull
cloudnull / cindertest.sh
Last active August 29, 2015 13:57
Test Cinder, This will create an instance, create a cinder volume, and then attach the cinder volume to the instance. If successful the script will detach the cinder volume, delete the volume, delete the volume type and then delete the instance.
#!/usr/bin/env bash
set -e
set -u
set -v
source $HOME/openrc
# Max time to wait for volume operations (specifically create and delete)
@cloudnull
cloudnull / rpcs_vips_change.rst
Last active August 29, 2015 13:57
Changing and or re-creating the VIPS on your Rackspace Private Openstack Cloud

Change VIPS in a Rackspace Private Cloud

date

2014-04-01

tags

rackspace, openstack, dev, rpc, private cloud

category

*nix

Description:

Changing and or re-creating the VIPS on your Rackspace Private Openstack Cloud

If you come accross the need to change / modify the VIPS which control your Openstack

@cloudnull
cloudnull / neutron_qc.sh
Created April 2, 2014 22:19
Make sure that all created networks built for neutron are working. This script assumes that you have already created your neutron networks and that you have built the appropriate subnet for the network. This script also assumes that you have at least 1 image to build with.
#!/usr/bin/env bash
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@cloudnull
cloudnull / keystone_qc.sh
Last active August 29, 2015 13:58
Create a tenant | role | user for use with keystone. This script assumes that you have an openrc file in the current working directory.
#!/usr/bin/env bash
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@cloudnull
cloudnull / bash_retry.sh
Last active August 29, 2015 13:58
BASH Successerator. when running a process that has a high probability of failure use this function as a means to ensure the operation is run multiple times.
# BASH Successerator. when running a process that has a high
# probability of failure use this function as a means to
# ensure the operation is run multiple times.
# Usage:
# successerator knife bootstrap -e ENV -r 'role[one],recipie[two]'
# Used to retry process that may fail due to random issues.
function successerator() {
MAX_RETRIES=${MAX_RETRIES:-5}
@cloudnull
cloudnull / asd.py
Created April 21, 2014 23:34
Advanced search and discovery tool. This tool was built to allow you to query the worlds largest database. The query strings will be rendered in your local web browser as standard HTML content. At this time this tool is not compatible with most Server Operating Systems as they are generally headless and the tool does require access to a local we…
#!/usr/bin/env python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,