Skip to content

Instantly share code, notes, and snippets.

@zeroXten
zeroXten / asdf
Created February 8, 2018 14:47
asdfasdf
asdf
#!/usr/bin/env ruby
module Badgers
class BlackWhite
attr_accessor :name
def initialize(name)
@name = name
end
type ThreatSpec struct {
Boundaries map[string]struct {
Name string `json:"name"`
} `json:"boundaries"`
Components map[string]struct {
Name string `json:"name"`
} `json:"components"`
Threats map[string]struct {
Name string `json:"name"`
Reference string `json:"reference"`
type threatspec struct {
boundaries map[string]struct {
name string
}
components map[string]struct {
name string
}
threats map[string]struct {
name string
reference string
================================================================================
Recipe Compile Error in /tmp/kitchen/cookbooks/sensu_spec/recipes/test_client.rb
================================================================================
Chef::Exceptions::ValidationFailed
----------------------------------
Option name must be a kind of [Regexp]! You passed "(?-mix:(?:must fail|fails) with message ['\"]?(?<message>.*?)['\"]?)".
Cookbook Trace:
---------------
function _track_pwd() {
HIST_MAX=25
if [ -z "$PCD_ID" ]; then
# Create a new ID
export PCD_ID=$(cat /dev/urandom | tr -d -c 'a-f0-9' | fold -w 16 | head -1)
echo "$PWD" > "$HOME/.pwd_history.d/${PCD_ID}"
fi
if [ -e "$HOME/.pwd_history.d/${PCD_ID}" ]; then
@zeroXten
zeroXten / pcd.rb
Created October 6, 2015 16:30
pcd.rb
#!/usr/bin/env ruby
require 'json'
trap "SIGINT" do
exit 130
end
def debug(msg)
$stderr.write "DEBUG #{msg}\n" if debug == true
@zeroXten
zeroXten / gist:e1b77ac4e49def4fcfdf
Created September 17, 2015 11:23
queue/store as DB
CREATE TABLE messages (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
created DATE NOT NULL,
source VARCHAR(16) NOT NULL, -- entity id
destination VARCHAR(16) NOT NULL, -- entity id
queue VARCHAR(255) NOT NULL, -- e.g incoming/csrs or outgoing/certs
body TEXT NOT NULL -- json message itself (probably encrypted)
)
CREATE TABLE store (
package api
type Api struct {
Id string
Path string
}
type Apier interface {
Connect(string) error
Authenticate(string, string) error
@zeroXten
zeroXten / mvc.go
Created August 10, 2015 15:01
mvc
package main
import (
"fmt"
log "github.com/cihub/seelog"
"github.com/docopt/docopt-go"
)
// ******************************************************************
// Models - actually probably just what's already in core