Skip to content

Instantly share code, notes, and snippets.

View srenatus's full-sized avatar
🍉

Stephan Renatus srenatus

🍉
View GitHub Profile
@srenatus
srenatus / Rakefile
Last active December 23, 2015 03:59
Quickly gather news about the cookbooks locked in your Berksfile.lock
require 'octokit'
require 'json'
require 'open-uri'
#require 'pp'
# NB
# - get_master_sha fails with some forked repositories
# (it returns the SHA of the forked-off repo (?!) and the repo is thus recognized as having news)
$open = "open" # xdg-open, sensible-browser, ...
@srenatus
srenatus / get_mirrors.sh
Last active December 24, 2015 11:29
find active logical switch port mirror targets (NVP)
#!/bin/bash
# jq: http://stedolan.github.io/jq/
# resty: http://github.com/micha/resty
. resty
resty https://172.24.0.40 -u admin:admin -k # change me
for tnode in $(GET /ws.v1/transport-node | jq -r '.results[] | ._href'); do
GET $tnode/mirror | jq -r '.results[] | ._href'
@srenatus
srenatus / gist:7265253
Created November 1, 2013 13:15
neat bash history feature...
$ nova net-show new-net
usage: nova [--version] [--debug] [--os-cache] [--timings]
[--timeout <seconds>] [--os-username <auth-user-name>]
[--os-password <auth-password>]
[--os-tenant-name <auth-tenant-name>]
[--os-tenant-id <auth-tenant-id>] [--os-auth-url <auth-url>]
[--os-region-name <region-name>] [--os-auth-system <auth-system>]
[--service-type <service-type>] [--service-name <service-name>]
[--volume-service-name <volume-service-name>]
[--endpoint-type <endpoint-type>]
@srenatus
srenatus / riemann-0.2.4.json
Created December 3, 2013 08:54
Trying Riemann with OSv
{
"name" : "Riemann 0.2.4",
"main" : "riemann.bin",
"args" : ["-server", "-Xms1024m", "-Xmx1024m", "-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-XX:+CMSParallelRemarkEnabled", "-XX:+AggressiveOpts", "-XX:+UseFastAccessorMethods"]
}
@srenatus
srenatus / SSH session
Created December 4, 2013 07:10
Starting Riemann on OSv, console log (context: after having put the Riemann standalone jar and a config onto the system via the web UI)
$ ssh admin@10.122.1.91
admin@10.122.1.91's password:
____ _____
/ __ \ / ____|
| | | | (_____ __
| | | |\___ \ \ / /
| |__| |____) \ V /
\____/|_____/ \_/
@srenatus
srenatus / install-ipv6.sh
Created December 9, 2013 14:44
Opscode's install.sh with a little IPv6-twist (line 207, thanks to sixxs.org)
#!/bin/bash
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1)
# Note that the chef template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r
use_shell=0
prerelease="false"
# Check whether a command exists - returns 0 if it does, 1 if it does not
exists() {
@srenatus
srenatus / example attributes file.rb
Last active December 31, 2015 02:59
first try at auto-generating attributes that end up in nova.conf
#
# Options defined in nova.availability_zones
#
# availability_zone to show internal services under (string
# value)
node['openstack']['compute']['internal_service_availability_zone'] = 'internal'
# default compute node availability_zone (string value)
node['openstack']['compute']['default_availability_zone'] = 'nova'
@srenatus
srenatus / .kitchen.yml
Created December 18, 2013 08:50
DRY .kitchen.yml using YAML references
---
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: backend-6.2
run_list: &backend
@srenatus
srenatus / GET meters output snippet
Created January 8, 2014 08:57
ceilometer meters api woes
{
"source" : "openstack",
"name" : "network.create",
"resource_id" : "abf872af-dd24-48ae-93a5-d44bda5a39f5",
"meter_id" : "YWJmODcyYWYtZGQyNC00OGFlLTkzYTUtZDQ0YmRhNWEzOWY1K25ldHdvcmsuY3JlYXRl\n",
"unit" : "network",
"user_id" : "72310676de21401ab0760ed53e850588",
"type" : "delta",
"project_id" : "4945683a80ba4a83a2275bbb9f02ed6a"
}
@srenatus
srenatus / syslog
Created January 14, 2014 10:32
openvswitch kernel panic; openvswitch srcversion 216E480D4E0B314F8FCD8AC from openvswitch-datapath-lts-raring-dkms; Linux 3.8.0-35-generic
Jan 14 10:30:00 node15 kernel: [ 1130.796116] IPv6: ADDRCONF(NETDEV_UP): qvbd9c941da-54: link is not ready
Jan 14 10:30:00 node15 kernel: [ 1130.855830] device qvbd9c941da-54 entered promiscuous mode
Jan 14 10:30:00 node15 kernel: [ 1130.914772] IPv6: ADDRCONF(NETDEV_CHANGE): qvbd9c941da-54: link becomes ready
Jan 14 10:30:00 node15 kernel: [ 1130.967049] device qvod9c941da-54 entered promiscuous mode
Jan 14 10:30:00 node15 kernel: [ 1131.073473] qbrd9c941da-54: port 1(qvbd9c941da-54) entered forwarding state
Jan 14 10:30:00 node15 kernel: [ 1131.073478] qbrd9c941da-54: port 1(qvbd9c941da-54) entered forwarding state
Jan 14 10:30:00 node15 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl -- --may-exist add-port br-int qvod9c941da-54 -- set Interface qvod9c941da-54 external-ids:iface-id=
d9c941da-542f-4b4c-b472-83714d577961 external-ids:iface-status=active external-ids:attached-mac=fa:16:3e:f2:57:3b external-ids:vm-uuid=f2ba1a61-d39d-4284-9d23-dc55b1ac859e
Jan 14 10:30:00 node15 kernel: [ 1131.573655]