Skip to content

Instantly share code, notes, and snippets.

View Afterglow's full-sized avatar

Paul Thomas Afterglow

  • Oracle Inc
  • Bristol
View GitHub Profile
source 'https://rubygems.org'
gem 'rubocop'
gem 'chef-provisioning'
gem 'chef-provisioning-vagrant'
gem 'infrataster', '~> 0.2.0'
gem 'berkshelf', '~> 3.1.0'
gem 'chef', "~> 11.12.8"
gem 'net-ssh', '= 2.9.1'
================================================================================
Error executing action `converge` on resource 'machine_batch[default]'
================================================================================
NoMethodError
-------------
Unexpected method []= for MergedConfig with arguments [:ohai_hints, {"ec2"=>""}]
Resource Declaration:
---------------------
#!/usr/bin/env bash
/usr/bin/env ssh -i "/etc/chef/id_deploy" $1 $2
log_level :auto
log_location STDOUT
validation_client_name "chef-server-validator"
validation_key "/etc/chef/validation.pem"
client_key "/etc/chef/some_file.pem" # Just needs to be a valid PEM for zero as not checked
node_name "usually-the-hostname"
#
# Author:: Paul Thomas <pthomas@dyn.com>
# Copyright:: Copyright (c) 2014 Dyn Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@Afterglow
Afterglow / gmlan-to-es.py
Created April 24, 2014 10:42
Stream GMLAN messages from a CAN socket to elasticsearch for later analysis using python
#!/usr/bin/env python3.4
from elasticsearch import Elasticsearch
from elasticsearch import helpers
from binascii import unhexlify
from gmlan import parse_frame
from datetime import datetime
import socket
import threading
@Afterglow
Afterglow / canparsed.txt
Created April 17, 2014 22:54
More parsed gmlan output
0x0 | 0 | [ ]
0x0 | 8 | [ 0x1 0x14 0x0 0x0 0x0 0x0 0x0 0x0 ]
RFA_FUNCTION | 2 | [ 0x2 0x2 ]
0x1fff | 0 | [ ]
SYSTEM_POWER_MODE_BACKUP | 1 | [ 0x0 ]
0x1fff | 0 | [ ]
0x1fff | 0 | [ ]
0x1fff | 0 | [ ]
0x46 | 1 | [ 0x0 ]
HS_DEVICE_INFORMATION | 6 | [ 0x7 0x0 0x0 0x0 0x69 0x0 ]
@Afterglow
Afterglow / candump.txt
Created April 17, 2014 17:19
Dump from my GMLAN canbus
CLIMATE_CONTROL = b'000000606f0268'
HS_DEVICE_INFORMATION = b'170080ff6908'
FUEL_INFORMATION = b'0072000000000000'
ENGINE_INFORMATION_1 = b'00009c00026a3539'
ANTILOCK_BRAKE_AND_TC_STATUS = b'0400020005001d'
AIR_CONDITIONING_CONTROL = b'001c00'
ADAPTIVE_CRUISE_DISPLAY = b'00000000'
BATTERY_VOLTAGE = b'005a7a00'
HS_DEVICE_INFORMATION = b'170080ff6908'
VEHICLE_SPEED_INFORMATION = b'0089000000003100'
@Afterglow
Afterglow / srf01.py
Created March 2, 2013 12:04
A quick script to show using an SRF01 ultrasonic transducer with a raspberry pi (although in reality presumably any serial port)
import serial
import sys
import time
SRF01_PORT = '/dev/ttyAMA0'
class SRF01:
""" A class to operate an SRF01 ultrasonic range finder """
def __init__(self):
@Afterglow
Afterglow / gist:4142046
Created November 25, 2012 01:39
omnibus-chef fpm fail
[project:chef] Executing `fpm -s dir -t deb -v 10.16.2-300-g70f80b2 -n chef --iteration 0.debian.wheezy/sid /opt/chef -m 'Opscode, Inc.' --description 'The full stack of chef' --url http://www.opscode.com --post-install '/home/pi/work/omnibus-chef/package-scripts/chef/postinst' --post-uninstall '/home/pi/work/omnibus-chef/package-scripts/chef/postrm' --replaces chef-full`
rake aborted!
Expected process to exit with [0], but received '1'
---- Begin output of fpm -s dir -t deb -v 10.16.2-300-g70f80b2 -n chef --iteration 0.debian.wheezy/sid /opt/chef -m 'Opscode, Inc.' --description 'The full stack of chef' --url http://www.opscode.com --post-install '/home/pi/work/omnibus-chef/package-scripts/chef/postinst' --post-uninstall '/home/pi/work/omnibus-chef/package-scripts/chef/postrm' --replaces chef-full ----
STDOUT:
STDERR: tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
ar: /var/cache/omnibus/pkg/chef_10.16.2-300-g70f80b2-