Skip to content

Instantly share code, notes, and snippets.

@pcn
pcn / perf_session.txt
Last active August 29, 2015 14:19
Not getting much in the way of linux perf data...
spacey@spacey-vm:~$ sudo perf record -F 99 -p 1531 -g -- sleep 5
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.156 MB perf.data (~6825 samples) ]
spacey@spacey-vm:~$ sudo perf report -n perf.data --stdio
Failed to open /tmp/perf-1531.map, continuing without symbols
# To display the perf.data header info, please use --header/--header-only option
#
# Samples: 58 of event 'cpu-clock'
# Event count (approx.): 585858580
@pcn
pcn / d3_geo.cljs
Last active August 29, 2015 14:16
Does this look right? Translating from javascript to clojurescript
(defn- build-map [svg topo-obj]
(let [subunits (.-subunits (.-objects topo-obj))
geo (.-geo js/d3)
feature (.-feature js/topojson)
mercator (.-mercator geo)]
(.. svg
(append "path")
(datum (feature topo-obj subunits))
(attr "d"
(.. geo
@pcn
pcn / integers_are_just_integers.json
Last active August 29, 2015 14:13
sandesh data converted from xml to json
{
"sandesh": {
"@length": "0000001565",
"SandeshCtrlClientToServer": {
"@type": "sandesh",
"http_port": 8091,
"instance_id_name": {
"#text": "0",
"@identifier": "8",
"@type": "string"
@pcn
pcn / output.md
Created January 18, 2015 19:51
Can't build rust-by-example static site
Peters-MacBook-Pro:rust-by-example peter$ make all
./setup-stage.sh
Checked out revision 110.
cargo run
     Running `target/update`
json: couldn't open examples/staging/json/input.md
json-enum: couldn't open examples/staging/json/json-enum/input.md
decodable: couldn't open examples/staging/json/decodable/input.md
encodable: couldn't open examples/staging/json/encodable/input.md
@pcn
pcn / contrail_quantum.py.diff
Last active August 29, 2015 14:10
Horizon in opencontrail's horizon dashboard is broken WRT newer neutron Client objects
--- /usr/lib/python2.7/dist-packages/contrail_openstack_dashboard/openstack_dashboard/api/contrail_quantum.py 2014-12-05 10:34:36.263265972 -0500
+++ /usr/lib/python2.7/dist-packages/contrail_openstack_dashboard/openstack_dashboard/api/contrail_quantum.py.dist 2014-12-05 10:20:54.163429308 -0500
@@ -50,11 +50,8 @@
def ipam_summary(request, **params):
LOG.debug("ipam_summary(): params=%s" % (params))
- # ipams = neutronclient(request).list_ipams(**params).get('ipams')
- # return [ExtensionsContrailIpam(n) for n in ipams]
- # -PN 20141205 Fix for https://bugs.launchpad.net/juniperopenstack/+bug/1390315
- return []
@pcn
pcn / output
Created December 4, 2014 18:38
list of /etc/opencontrail
root@kvm-openstack-5:/opt/contrail/utils# ls /etc/contrail
agent_param.tmpl contrail-query-engine.conf rpm_agent.conf supervisord_control.conf supervisord_vrouter_files
config.global.js contrail_reboot supervisord_analytics.conf supervisord_control_files supervisord_webui.conf
contrail-analytics-api.conf contrail-schema.conf supervisord_analytics_files supervisord_openstack.conf supervisord_webui_files
contrail-api.conf contrail-vrouter-agent.conf supervisord_config.conf supervisord_openstack_files svc-monitor.conf
contrail-collector.conf debs_list.txt supervisord_config_files supervisord_support_service.conf vnc_api_lib.ini
contrail-control.conf dns supervisord_contrail_database.conf supervisord_support_service_files vrouter_nodemgr_param
contrail-discovery.conf redis-webui.conf
@pcn
pcn / Essentials.md
Last active August 29, 2015 14:10
Notes on cobbler

== Don't use the python tftpd

As of 2.4.x, cobbler doesn't properly manage symlinks if you want to use the python in.tftpd. According to cobbler/cobbler#1150 this doesn't look like it'll be fixed until the 3.0 timeframe?

== Repos

The list of apt components that each repo needs to have in orderto boot off of a local mirror are at least:

main universe restricted main/debian-installer restricted/debian-installer

@pcn
pcn / my_ml2_conf.ini
Created September 23, 2014 20:57
Fixup neutron to write the ml2_conf.ini to the openvswitch.ini so that it works.
<%= node['openstack']['network']['custom_template_banner'] %>
[ml2]
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
type_drivers = <%= node['openstack']['network']['ml2']['type_drivers'] %>
# (ListOpt) Ordered list of network_types to allocate as tenant
@pcn
pcn / ml2_conf.ini
Created September 23, 2014 20:32
ml2 conf for neutron on icehouse
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
[ml2]
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
type_drivers = vxlan
@pcn
pcn / watch_ovsdb.py
Last active August 29, 2015 14:05
gawd I love python's sh module
import sh
import errno
import time
import json
table_json = json.loads(str(sh.ovsdb_client("--format", "json", "list-tables")))
monitor_dict = dict()
for t in table_json['data']:
monitor_dict[t[0]] = sh.ovsdb_client("--format", "json", "monitor", t[0], _piped=True, _iter_noblock=True)