Skip to content

Instantly share code, notes, and snippets.

Avatar

Greg Albrecht W2GMD ampledata

View GitHub Profile
@ampledata
ampledata / gist:b834e2618fef7dba2d3a
Last active Aug 29, 2015
Berkshelf.lock usage pattern
View gist:b834e2618fef7dba2d3a

Goal

We'd like changes to our Cookbooks to be automatically tested and deployed using our CI system. Additionally, these Cookbooks must also be automatically propagated to our end-users (developers).

Workflow (today)

Our current workflow is as follows:

  1. Jim, the developer, commits a change to the webapp Cookbook, and pushes that change to Github.
  2. Jenkins, the Continuous Integration system, checks-out the updated webapp Cookbook repo and runs its tests using test-kitchen.
View gist:48d7cfe984a8dba37dfd
import pygatt
str_buf = ''
def print_str_buf(x,y):
global str_buf
str_y = "%s" % y
if str_y == '$':
print str_buf
sb = str_y
else:
@ampledata
ampledata / util_client.py
Created Apr 10, 2015
Example of decoding AX.25/APRS frame using the APRS Python Module utils
View util_client.py
#!/usr/bin/env python
import aprs
TEST_FRAMES = 'tests/test_frames.log'
test_frames = open(TEST_FRAMES, 'r')
View gist:cf54e3996c571280890a
mycall W2GMD-6
<aprsis>
server igates.aprs.fi
heartbeat-timeout 70
filter m/150
login W2GMD-6
passcode xxx
</aprsis>
<logging>
pidfile /var/run/aprx.pid
View props.conf
[tweet]
TIME_PREFIX = "created_at":
REPORT-tweet=json_kv
View transforms.conf
[json_kv]
DELIMS = ",",":"
#REGEX = \"([^\"]+)\"\:\"([^\"]+)\"
#FORMAT= $1::$2
#MV_ADD=true
#REPEAT_MATCH=true
@ampledata
ampledata / gist:756753
Created Dec 28, 2010
this is a workaround for the "You don't exist, go away!" error on darwin
View gist:756753
/usr/X11/bin/sessreg -w /var/run/utmpx -a $USER
@ampledata
ampledata / inline editing with ed
Created Feb 7, 2011
i want to have the same thing for dinner
View inline editing with ed
# pack lunch
echo "i like tacos" > lunch.txt
# pack dinner
echo "i like burritos" > dinner.txt
# generate ed-style diff
diff -e dinner.txt lunch.txt > order.ed
# add a write to the end of the diff
View pycon 2011 c exercise #2
#include <string.h>
#include <stdio.h>
#include "handler.h"
void handle_request(int sockfd, const char *request)
{
int i;
int b;
char path[16];
@ampledata
ampledata / cloudkick-update_status.rb
Created Mar 23, 2011
Cloudkick 'check' status update script in a few lines of ruby.
View cloudkick-update_status.rb
require 'rubygems'
require 'oauth'
require 'openssl'
# your OAuth consumer credentials.
# https://support.cloudkick.com/API/Authentication#Generating_OAuth_Consumers
CONSUMER_KEY = 'xxx'
CONSUMER_SECRET = 'yyy'
node_id='n359b40753' # your node_id