Skip to content

Instantly share code, notes, and snippets.

View cholcombe973's full-sized avatar

Chris Holcombe cholcombe973

  • @tesla.com
  • Portland
View GitHub Profile
#!/usr/bin/python
"""Calculate and manipulate CRC32.
http://en.wikipedia.org/wiki/Cyclic_redundancy_check
-- StalkR
"""
import struct
import sys
# Polynoms in reversed notation
POLYNOMS = {
This file has been truncated, but you can view the full file.
-5338> 2015-12-03 09:29:08.603508 7f9e71435700 1 -- 172.18.78.103:6922/1368415 --> 172.18.78.101:6878/337413 -- pg_info(1 pgs e7686:23.3das0(4)) v4 -- ?+0 0x7f9ec8b83c00 con 0x7f9ec6c07440
-5337> 2015-12-03 09:29:08.603547 7f9e71435700 1 -- 172.18.78.103:6922/1368415 --> 172.18.78.101:6886/388004 -- pg_info(1 pgs e7686:23.3das0(4)) v4 -- ?+0 0x7f9ec9298e00 con 0x7f9ec6c57860
-5336> 2015-12-03 09:29:08.603645 7f9e71435700 1 -- 172.18.78.103:6922/1368415 --> 172.18.78.101:6894/399129 -- pg_info(1 pgs e7686:23.3das0(4)) v4 -- ?+0 0x7f9ec9299180 con 0x7f9ec6cadb80
-5335> 2015-12-03 09:29:08.603667 7f9e71435700 1 -- 172.18.78.103:6922/1368415 --> 172.18.78.101:6914/445515 -- pg_info(1 pgs e7686:23.3das0(4)) v4 -- ?+0 0x7f9ec929a840 con 0x7f9ec6cafc80
-5334> 2015-12-03 09:29:08.604031 7f9e71435700 1 -- 172.18.78.103:6922/1368415 --> osd.111 172.18.78.102:6894/741247 -- pg_info(1 pgs e7686:30.1d2) v4 -- ?+0 0x7f9ec929b9c0
-5333> 2015-12-03 09:29:08.604053 7f9e71435700 1 -- 172.18.78.103:6922/1368415 -->
[global]
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
keyring = /etc/ceph/$cluster.$name.keyring
mon host = 172.18.77.61:6789 172.18.77.62:6789 172.18.77.63:6789
fsid = bf7f534a-98fd-11e5-b296-0050569b016c
sudo ceph df
GLOBAL:
SIZE AVAIL RAW USED %RAW USED
981T 970T 11278G 1.12
POOLS:
NAME ID USED %USED MAX AVAIL OBJECTS
.rgw.buckets.index.old 22 0 0 744T 0
.rgw.buckets 23 8383G 0.83 744T 2185377
.rgw.root 24 840 0 322T 3
.rgw.control 25 0 0 322T 8
[global]
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
mon host = 172.18.77.61:6789 172.18.77.62:6789 172.18.77.63:6789
log to syslog = true
err to syslog = true
clog to syslog = true
ubuntu@1e819d3a3c68:~/trusty/ceph-erasure-next$ tox
lint runtests: commands[0] | flake8 hooks unit_tests tests actions
lint runtests: commands[1] | charm proof
I: metadata name (ceph) must match directory name (ceph-erasure-next) exactly for local deployment.
I: config.yaml: option ephemeral-unmount has no default value
I: config.yaml: option monitor-secret has no default value
I: config.yaml: option ceph-public-network has no default value
I: config.yaml: option ceph-cluster-network has no default value
I: config.yaml: option key has no default value
I: config.yaml: option fsid has no default value
@cholcombe973
cholcombe973 / versioned.rs
Last active January 29, 2016 19:39
Versioned structs
macro_rules! cond_with_error(
($i:expr, $cond:expr, $submac:ident!( $($args:tt)* )) => (
{
if $cond {
match $submac!($i, $($args)*) {
nom::IResult::Done(i,o) => nom::IResult::Done(i, ::std::option::Option::Some(o)),
nom::IResult::Error(e) => nom::IResult::Error(e),
nom::IResult::Incomplete(i) => nom::IResult::Incomplete(i)
}
} else {
import json
import subprocess
import time
not_healthy = True
iterations = 0 # Make this configurable
# Loop here until timeout is reached
while not_healthy:
if iterations > 60:
# It's been 10 minutes. Continue on.
def get_link_speed(network_interface):
"""
This will find the link speed for a given network device. Returns None
if an error occurs.
:param network_interface:
:return: LinkSpeed or None if an error occurs.
"""
speed_path = os.path.join(os.sep, 'sys', 'class', 'net',
network_interface, 'speed')
# I'm not sure where else we'd check if this doesn't exist
@cholcombe973
cholcombe973 / debug-log.txt
Created February 19, 2016 00:38
juju debug log of availability zone
This file has been truncated, but you can view the full file.
machine-0: 2016-02-19 00:27:39 INFO juju.cmd supercommand.go:37 running jujud [1.25.3-trusty-amd64 gc]
machine-0: 2016-02-19 00:27:39 DEBUG juju.agent agent.go:482 read agent config, format "1.18"
machine-0: 2016-02-19 00:27:39 INFO juju.cmd.jujud machine.go:420 machine agent machine-0 start (1.25.3-trusty-amd64 [gc])
machine-0: 2016-02-19 00:27:39 DEBUG juju.wrench wrench.go:112 couldn't read wrench directory: stat /var/lib/juju/wrench: no such file or directory
machine-0: 2016-02-19 00:27:39 INFO juju.cmd.jujud upgrade.go:88 no upgrade steps required or upgrade steps for 1.25.3 have already been run.
machine-0: 2016-02-19 00:27:39 INFO juju.network network.go:242 setting prefer-ipv6 to false
machine-0: 2016-02-19 00:27:39 INFO juju.worker runner.go:269 start "api"
machine-0: 2016-02-19 00:27:39 INFO juju.worker runner.go:269 start "statestarter"
machine-0: 2016-02-19 00:27:39 DEBUG juju.worker runner.go:196 "statestarter" started
machine-0: 2016-02-19 00:27:39 INFO juju.api apiclient.go:262 dialing "wss://l