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 / gist:6105679
Last active December 20, 2015 09:09
Using the "xf86-input-mtrack" driver as found here : https://github.com/BlueDragonX/xf86-input-mtrack/tree/dev : this is the config I have found to be the most useful. I drop the config here "/usr/share/X11/xorg.conf.d/" and name the file "50-mtrack.conf". This is my working config when running on a Macbook Pro 8,2 with Ubuntu.
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
Option "Sensitivity" ".65"
Option "FingerHigh" "10"
Option "FingerLow" "5"
Option "IgnoreThumb" "true"
Option "IgnorePalm" "true"
Option "TapButton1" "0"
CLIENTRB = """
log_level :info
log_location STDOUT
chef_server_url '%(config_server)s'
validation_key '/etc/chef/validation.pem'
validation_client_name '%(config_clientname)s'
node_name '%(node_name)s'
"""
@cloudnull
cloudnull / python-ohai-subprocess.py
Last active December 23, 2015 00:09
Get CIDR from network interfaces in Ohai.Loads ohai data in as JSON and returns the CIDR based on a device.
import json
import subprocess
# Get Ohai Data
_ohai = subprocess.Popen(['ohai', '-l', 'fatal'], stdout=subprocess.PIPE)
ohai = _ohai.communicate()[0]
data = json.loads(ohai)
# Parse Ohai Data
def get_network(interface):
@cloudnull
cloudnull / gist:7322922
Created November 5, 2013 17:35
Super-Duper Submodule updater. Used for updating a mess of sub-modules which belong to the RCBOPS chef-cookbooks repo.
#!/usr/bin/env bash
# This is the SUPER SUBMODULE UPDATE!
# To use this you HAVE TO BE IN THE "chef-cookbooks" directory.
set -e
set -u
BRANCH=${BRANCH:-master}
if [ -d "cookbooks" ];then
@cloudnull
cloudnull / gist:7325348
Last active December 27, 2015 12:19
Using Openstack Clients as Libraries. This is a simple gist with the means to allow you to leverage the various openstack clients as libraries.
import logging
from novaclient.v1_1 import client as nova_client
from cinderclient.v1 import client as cinder_client
from swiftclient import client as swift_client
LOG = logging.getLogger(__name__)
@cloudnull
cloudnull / gist:7326310
Created November 5, 2013 21:06
Setup a Swap file on a server where swap is not found.
if [ ! -d "/opt" ];then
mkdir /opt
fi
if [ ! "$(swapon -s | grep -v Filename)" ];then
cat > /opt/swap.sh <<EOF
#!/usr/bin/env bash
if [ ! "\$(swapon -s | grep -v Filename)" ];then
@cloudnull
cloudnull / gist:7444013
Last active December 28, 2015 04:39
Patch Ceilometer for Havana Openstack to allow for the Ceilometer Metaquery functions to run. This also allows Ceilometer to render Graphs and Metrics in Horizon.
#!/usr/bin/env bash
# Ceilometer patch
set -e
set -u
set -v
# OS Check
if [ "$(grep -i -e redhat -e centos /etc/redhat-release)" ]; then
yum -y install git python-pip
@cloudnull
cloudnull / gist:7964317
Last active December 31, 2015 08:59
RCBOPS Grizzly to Havana Upgrade process
#!/usr/bin/env bash
set -e
# Set to true if you want this
FIX_QEMU=${FIX_QEMU:false}
# Before deploying New Cookbooks / Code Backup your quantum Database.
mysqldump quantum > ~/quantum.mysql.sql
@cloudnull
cloudnull / mysql-openstack-reset.sh
Last active December 31, 2015 23:29
delete keystone endpoints in MySQL
function reset_nova_endpoint() {
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 / neutron-vpnaas-fwaas-lbaas-configSetup.rst
Last active September 4, 2019 08:53
Setup Openstack Havana with Neutron using VPNaaS (VPN as a Service), FWaaS (Firewall as a Service), LBaaS (Load Balancer as a Service).

Installing Openstack VPNaaS, LBaaS, and FWaaS

This brief overview assumes that Openstack Havana has been installed and setup with Neutron Networking. If you have not already done this, you could use "https://github.com/cloudnull/rcbops_allinone_inone" or devstack to setup a dev box and then perform the following actions.


  • install "openswan":

    # (apt-get install openswan neutron-plugin-vpn-agent) || (yum install openswan openstack-neutron-vpn-agent && chkconfig neutron-vpn-agent on)