Skip to content

Instantly share code, notes, and snippets.

View breu's full-sized avatar

Joe Breu breu

  • PlanetLabs
  • San Antonio, TX
View GitHub Profile
@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 / 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,
@Apsu
Apsu / chef-uninstall.sh
Last active December 25, 2015 11:49
Chef environment reconfiguration wrapper and helpers. This setup assumes you have GNU parallel installed. The list of nodes and their names are at the top of the "reconfigure" script. There's also an example environment file "grizzly.json". Modify both to suit your needs.
#!/usr/bin/env bash
chef-server-ctl uninstall
dpkg -P chef-server
apt-get autoremove -y
apt-get purge -y
rm -rf /etc/chef-server /etc/chef /opt/chef-server /opt/chef /root/.chef /var/opt/chef-server/ /var/chef /var/log/chef-server/
sed -i '/export PATH=\${PATH}:\/opt\/chef-server\/bin/d' /root/.bash_profile
pkill -9 -f /opt/chef
pkill -9 -f beam