Skip to content

Instantly share code, notes, and snippets.

View solarce's full-sized avatar

Brandon Burton solarce

View GitHub Profile
@solarce
solarce / zpool.sh
Created November 11, 2014 02:59
zpools on file server
solarce@dumptruck ~ % sudo zpool list :(
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zpool_backups 2.48T 720K 2.48T - 0% 0% 1.00x ONLINE -
zpool_media 4.38T 3.35G 4.37T - 0% 0% 1.00x ONLINE -
zroot 49.8G 2.80G 47.0G - 2% 5% 1.00x ONLINE -
bburton@kafka0:~$ /opt/kafka/bin/kafka-topics.sh --describe --zookeeper zookeeper0 --topic bburton.test
Topic:bburton.test PartitionCount:8 ReplicationFactor:3 Configs:
Topic: bburton.test Partition: 0 Leader: 169869652 Replicas: 169869652,169869655,169869382 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 1 Leader: 169869655 Replicas: 169869655,169869382,169869652 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 2 Leader: 169869382 Replicas: 169869382,169869652,169869655 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 3 Leader: 169869652 Replicas: 169869652,169869382,169869655 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 4 Leader: 169869655 Replicas: 169869655,169869652,169869382 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 5 Leader: 169869382 Replicas: 169869382,169869655,169869652 Isr: 169869652,169869655,169869382
Topic: bburton.test Partition: 6 Leader: 169869652 Replicas: 169869652,169869655,169869382 I
@solarce
solarce / coffeeops_dec2.md
Created November 17, 2014 15:01
#CoffeeOps SF - Dec 2 - 8:00AM - 10:00AM

Description:

Join @solarce and others for a #coffeeops

Let's talk #devops and hack on stuff

Date and Time

Tuesday, December 2, 2014 -- 8:00 - 10:00AM

@solarce
solarce / kafka_on_coreos.txt
Created November 25, 2014 03:52
three node kafka cluster running on coreos
[19:51:06]  bburton@althalus  ~  kafka-topics.sh --describe --zookeeper coreos-zk1 --topic bburton.test3
Topic:bburton.test3 PartitionCount:3 ReplicationFactor:3 Configs:
Topic: bburton.test3 Partition: 0 Leader: 200 Replicas: 200,300,100 Isr: 200,300,100
Topic: bburton.test3 Partition: 1 Leader: 300 Replicas: 300,100,200 Isr: 300,100,200
Topic: bburton.test3 Partition: 2 Leader: 100 Replicas: 100,200,300 Isr: 100,200,300
@solarce
solarce / kafka_prod1.yaml
Last active December 13, 2017 04:58
An example YAML file to use with https://github.com/jmxtrans/jmxtrans/wiki/YAMLConfig for getting Kafka metrics and putting them into graphite. You must use v246 of jmxtrans though. You can grab the .jar I built from https://github.com/solarce/jmxtrans/releases/tag/v246. See https://github.com/solarce/chef-jmxtrans/releases/tag/v1.0.5 and https:…
# kafka_prod1.yaml
#
# The production kafka nodes for prod1
graphite_host: <%= node[:jmxtrans][:graphite][:host] %>
graphite_port: <%= node[:jmxtrans][:graphite][:port] %>
# Define sthe port that the hosts in this config listen for JMX on
# ** THIS PORT HAS TO BE THE SAME FOR ALL HOSTS **
query_port: 9999
@solarce
solarce / zk.md
Last active August 29, 2015 14:12
zookeeper fun
Zookeeper version: 3.4.6-1569965, built on 02/20/2014 09:09 GMT
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
  • Start with zk ensemble: A, B, C, D, E.
  • C is the leader according to 'echo stat | nc localhost 2181' (assume leader state is being tracked by external monitoring)
  • See leader election occur in the logs, D gets elected leader, with a quorum of A and E
  • But, C still says it's leader and B is still following it.
@solarce
solarce / docker.log
Created January 20, 2015 03:28
drone failing to see images it is trying to make?
time="2015-01-20T03:26:39Z" level="info" msg="GET /v1.9/images/bradrydzewski/ubuntu/json"
time="2015-01-20T03:26:39Z" level="info" msg="+job image_inspect(bradrydzewski/ubuntu)"
No such image: bradrydzewski/ubuntu
time="2015-01-20T03:26:39Z" level="info" msg="-job image_inspect(bradrydzewski/ubuntu) = ERR (1)"
time="2015-01-20T03:26:39Z" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: bradrydzewski/ubuntu"
time="2015-01-20T03:26:39Z" level="error" msg="HTTP Error: statusCode=404 No such image: bradrydzewski/ubuntu"
time="2015-01-20T03:26:39Z" level="info" msg="POST /v1.9/images/create?fromImage=bradrydzewski/ubuntu&tag=latest"
time="2015-01-20T03:26:39Z" level="info" msg="+job pull(bradrydzewski/ubuntu, latest)"
time="2015-01-20T03:27:11Z" level="info" msg="+job log(pull, bradrydzewski/ubuntu:latest, )"
time="2015-01-20T03:27:11Z" level="info" msg="-job log(pull, bradrydzewski/ubuntu:latest, ) = OK (0)"
@solarce
solarce / hcl2yaml.py
Last active August 29, 2015 14:15
Terraform template (HCL) to YAML in Python
#!/usr/bin/python
# need to pip install pyhcl pyyaml
import sys, yaml, hcl
filename = sys.argv[1]
print("Reading", filename)
with open(filename, 'r') as fp:
obj = hcl.load(fp)
# Ubuntu Precise full with pkgsrc bootstrapped into /home/ubuntu
FROM solarce/dockerfile-ubuntu-precise-full:latest
MAINTAINER Brandon Burton <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
# Setup pkgsrc
# Steps modified from http://www.codeghar.com/blog/pkgsrc-on-linux-quickstart-guide.html
RUN adduser --shell /bin/bash --gecos "User for builds" --disabled-password --home /home/ubuntu ubuntu
@solarce
solarce / tfvars_example.sh
Created March 12, 2015 19:03
Example using multiple tfvars files
thq-d-bburt01 福 ~/code/lookout/terraform/tf_example ➤ 608cc3b|master✓
4299 ± : terraform plan -var-file terraform_main.tfvars
Refreshing Terraform state prior to plan...
Error refreshing state: 1:3: unknown variable accessed: var.aws_access_key in:
${var.aws_access_key}
thq-d-bburt01 福 ~/code/lookout/terraform/tf_example ➤ 608cc3b|master✓
4300 ± : terraform plan -var-file terraform_main.tfvars -var-file terraform_aws.tfvars