Skip to content

Instantly share code, notes, and snippets.

View jcooklin's full-sized avatar

Joel Cooklin jcooklin

View GitHub Profile
@jcooklin
jcooklin / -
Created November 25, 2015 01:48
#!/bin/bash
find . -path './.git' -prune -type f -o -name "*go" -o -name "*sh" -o -name "*md" -o -name "*json" -o -name "*Dockerfile" -o -name "Makefile" -o -name "Vagrantfile" -o -name "NOTICE"| grep -v '/cmd$' | xargs gsed -i 's/pulse/snap/g'
find . -path './.git' -prune -type f -o -name "*go" -o -name "*sh" -o -name "*md" -o -name "*json" -o -name "*Dockerfile" -o -name "Makefile" -o -name "Vagrantfile" -o -name "NOTICE"| grep -v '/cmd$' | xargs gsed -i 's/Pulse/Snap/g'
find . -path './.git' -prune -type f -o -name "*go" -o -name "*sh" -o -name "*md" -o -name "*json" -o -name "*Dockerfile" -o -name "Makefile" -o -name "Vagrantfile" -o -name "NOTICE"| grep -v '/cmd$' | xargs gsed -i 's/PULSE/SNAP/g'
#change directories names that contain pulse
for i in $(find . -type d | grep pulse); do
echo $i | sed s/pulse/snap/ | xargs -I{} mv $i {}
done
@jcooklin
jcooklin / create-gpg-signing-key.sh
Last active December 3, 2015 00:29
Creates a gpg signing key
#!/bin/bash
gpg_batch_config="/tmp/gpg-batch"
my_name="Joel Cooklin"
my_email="joel.r.cooklin@intel.com"
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo ""
@jcooklin
jcooklin / sign-plugin.sh
Last active December 3, 2015 00:28
Signs snap plugin
#!/bin/bash
die() {
echo >&2 "$@"
exit 1
}
if [ "$#" -lt 3 ] || [ "$#" -gt 3 ]
then
die "Error: expected the secret-keyring public-keyring and plugin to sign"
@jcooklin
jcooklin / -
Last active December 3, 2015 19:43
snap-preso.html
<!DOCTYPE html>
<html>
<head>
<title>snap</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
@jcooklin
jcooklin / rfc.md
Last active December 20, 2015 19:43
rfc: tribe redux

#RFC: Tribe - subtribes, policy, message encryption and calling remote plugins

This spec proposes the following features and enhancements to tribe

  • Group members of the global tribe into named subtribes replacing what today is called agreements
  • Tribe policies to dynamically add nodes to subtribes
  • Enable calling remote plugins through sharing plugin meta via tribe
  • Encryption of tribe messages
@jcooklin
jcooklin / run-snapd.sh
Created January 5, 2016 21:51
starts a snap tribe, loads plugins and starts a task
#!/bin/bash
typeset -i num
num=6
echo "starting seed"
$SNAP_PATH/bin/snapd --tribe --tribe-port 6000 --tribe-addr 127.0.0.1 --tribe-node-name seed --api-port 8181 -l 1 -t 0 --enable-instrumentation 2>&1 > /tmp/p-seed.out &
echo "starting $num snap agents"
for ((i=1;i<num;i++))
do
sleep .1
@jcooklin
jcooklin / -
Last active March 22, 2016 18:10
{
"schedule": {
"interval": "200ms",
"type": "simple"
},
"version": 1,
"workflow": {
"collect": {
"metrics": {
"/intel/procfs/cpu/all/active_percentage": {},
#!/bin/bash -x
SESSION_NAME="snap-cpu"
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
# create the session
tmux new-session -s ${SESSION_NAME} -n snapd -d
package nginxdbg
import (
"bufio"
"fmt"
"os"
"strings"
"time"
"github.com/intelsdi-x/snap/control/plugin"
@jcooklin
jcooklin / -
Created May 22, 2017 18:49
snap psutil task definition
---
version: 1
schedule:
interval: 1s
type: simple
workflow:
collect:
metrics:
/intel/psutil/cpu/*/guest: {}
/intel/psutil/cpu/*/idle: {}