Skip to content

Instantly share code, notes, and snippets.

View xarses's full-sized avatar

Andrew Woodward xarses

  • San Francisco, Bay Area, CA
View GitHub Profile
. ~/openrc
nova flavor-create flavor 7 64 0 1
nova secgroup-add-default-rule icmp -1 -1 0.0.0.0/0
nova secgroup-add-default-rule tcp 22 22 0.0.0.0/0
nova boot --flavor flavor --image TestVM --nic net-id=$(neutron net-show net04 -c id -f value) test
nova floating-ip-create
nova floating-ip-associate test <ip returned by ip-create>
#in newer versions it may be necessary to replace nova floating-ip* with neutron calls
fuel node --help
usage: fuel node [-h] [--env ENV]
[--list | --set | --delete | --network | --disk | --deploy | --hostname HOSTNAME | --delete-from-db | --provision]
[--default | --download | --upload] [--dir DIR]
[--node NODE [NODE ...]] [--force] [--all] [--role ROLE]
[--skip TASK [TASK ...] | --tasks TASK [TASK ...]]
[--end TASK] [--start TASK]
optional arguments:
-h, --help show this help message and exit
from Crypto.Cipher import DES
from hashlib import md5
class PBEWithMD5AndDES(object):
"""PBES1 implementation according to RFC 2898 section 6.1"""
SALT = '\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc'
COUNT = 5
def __init__(self, key):
key = self._generate_key(key, self.SALT, self.COUNT, 16)
@xarses
xarses / example deployment
Last active December 21, 2015 23:48
serial cehp-deploy
mon1:# ceph-deploy new mon1
mon1:# echo "public_network: 10.0.0.0/24" >> ceph.conf
mon1:# ceph-deploy create mon1
mon1:# ceph-deploy osd create mon1:sdb
...later...
mon2:# ceph-deploy config pull mon1
mon2:# ceph-deploy gatherkeys mon1
mon2:# ceph-deploy create mon2
@xarses
xarses / gist:6599234
Created September 17, 2013 19:10
example ceph-deploy using network decl
given host mon-1
hostname -s
> mon-1
eth0: 10.0.0.2/24
eth1: 10.0.1.2/24
eth2: 192.168.1.2/24
host mon-1
> 192.168.1.2
@xarses
xarses / fuel 2.2
Last active December 24, 2015 03:09
Openstack-Fuel site.pp snippet for bonding
#Network configuration
stage {'netconfig':
before => Stage['main'],
}
class {'l23network': stage=> 'netconfig'}
class node_netconfig (
$mgmt_ipaddr,
$mgmt_netmask = '255.255.255.0',
$private_ipaddr = undef,
@xarses
xarses / gist:6815516
Created October 3, 2013 19:19
ceph-deploy osd create / prepare logic
1) if ceph-deploy osd create/prepare is passed a whole device (ie sda) then it will format the device and create two partitions, one for the journal, and one of the osd its self
2) if ceph-deploy osd create/prepare is passed a partitioned device (ie sda1) it formats the partition and creates a journal FILE inside the partition
3) if ceph-deploy osd create/prepare is passed a mounted path, ie (/mnt/osd) it will do create a journal FILE in side the mount path
4) in the case of ceph-deploy being passed a device/sub-device/path and a journal file-path (ie sda:/mounts/journal/journal-sda) it will do whichever is relevant (a whole device will get a partition and mkfs) (a subdevice will get a mkfs) and a journal FILE will be created at the journal file-path. from my experience, if the journal file-path is invalid it will default to its default location for the journal.
examples:
@xarses
xarses / .git_config
Last active December 26, 2015 09:09
Git post hook setup script.
[remote "node"]
fetch = +refs/heads/*:refs/remotes/node/*
url = ssh://10.108.3.2/root/git-repo/fuel.git
url = ssh://10.108.7.2/root/git-repo/fuel.git
url = ssh://10.108.11.2/root/git-repo/fuel.git
---- Minecraft Crash Report ----
// Shall we play a game?
Time: 1/24/16 9:21 PM
Description: Exception while updating neighbours
java.lang.NoClassDefFoundError: cofh/api/tileentity/IEnergyInfo
at li.cil.oc.integration.cofh.tileentity.DriverEnergyInfo.getTileEntityClass(DriverEnergyInfo.java:15)
at li.cil.oc.api.prefab.DriverTileEntity.worksWith(DriverTileEntity.java:11)
at li.cil.oc.server.driver.Registry$$anonfun$2.apply(Registry.scala:70)
[21:19:51] [Server thread/WARN] [OpenComputers]: A component of type 'li.cil.oc.common.tileentity.Adapter' threw an error while being connected to the component network.
java.lang.NoClassDefFoundError: cofh/api/tileentity/IEnergyInfo
at li.cil.oc.integration.cofh.tileentity.DriverEnergyInfo.getTileEntityClass(DriverEnergyInfo.java:15) ~[DriverEnergyInfo.class:?]
at li.cil.oc.api.prefab.DriverTileEntity.worksWith(DriverTileEntity.java:11) ~[DriverTileEntity.class:?]
at li.cil.oc.server.driver.Registry$$anonfun$2.apply(Registry.scala:70) ~[Registry$$anonfun$2.class:?]
at li.cil.oc.server.driver.Registry$$anonfun$2.apply(Registry.scala:70) ~[Registry$$anonfun$2.class:?]
at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259) ~[TraversableLike$$anonfun$filterImpl$1.class:?]
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) ~[ResizableArray$class.class:?]
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) ~[ArrayBuffer.cla