Skip to content

Instantly share code, notes, and snippets.

@ffrank
ffrank / .vimrc
Created December 28, 2016 00:52
vim settings for readable diffing and spell checks
highlight DiffAdd term=reverse cterm=bold ctermbg=green ctermfg=white
highlight DiffChange term=reverse cterm=bold ctermbg=cyan ctermfg=black
highlight DiffText term=reverse cterm=bold ctermbg=gray ctermfg=black
highlight DiffDelete term=reverse cterm=bold ctermbg=red ctermfg=black
highlight SpellBad term=reverse cterm=bold ctermbg=red ctermfg=white
highlight SpellCap term=reverse cterm=bold ctermbg=cyan ctermfg=black
highlight SpellRare term=reverse cterm=bold ctermbg=gray ctermfg=black
# I am managed in <%= @__scope__.source.namespace %> line <%= @__scope__.source.line %>
actual
contents
...
@ffrank
ffrank / graph-template.yaml
Created May 30, 2016 20:02
mgmt tempfile weirdness
# /tmp/mgmt/testgraph-from-puppet
---
graph: fflaptop.local
comment: generated from puppet catalog for fflaptop.local
resources:
file:
- name: "/tmp/__FILE__"
path: "/tmp/__FILE__"
state: exists
content: accepted
package main
import (
"fmt"
"gopkg.in/fsnotify.v1"
"os"
)
var watcher *fsnotify.Watcher
@ffrank
ffrank / graph.yaml
Created May 16, 2016 22:13
Inotify watch starvation and recovery
---
graph: mygraph
comment: hello world example
resources:
file:
- name: dir1
path: "/tmp/removeme/"
state: exists
- name: dir2
path: "/tmp/removeme2/"
ffrank@fflaptop:~/git/mgmt$ make clean build
Building: mgmt, version: 0.0.3-26-gab73261...
time go build -ldflags "-X main.program=mgmt -X main.version=0.0.3-26-gab73261" -o mgmt;
# _/home/ffrank/git/mgmt
./main.go:226: cannot use run (type func(*cli.Context) error) as type func(*cli.Context) in field value
real 0m0.972s
user 0m1.412s
sys 0m0.080s
Makefile:69: recipe for target 'mgmt' failed
@ffrank
ffrank / manifest application
Last active January 2, 2016 15:59
puppet ssh_authorized_keys behavior is potentially confusing
Consider the current ssh_authrized_keys state and puppet manifest below.
Puppet will sync the key options away, although the manifest doesn't mention them at all.
That's because the 'options' property defaults to 'absent'.
This strikes me as unsound. There's two more sane ways I can imagine:
1. Forgo default values for all properties
2. Make default values special, so that properties use them only
when creating a new managed entity on the system
(i.e. the resource is changed from absent to a present state).
@ffrank
ffrank / stdout
Created November 9, 2013 18:06
Benchmark results of the puppet parser before and after fixing #7659
# long-ish manifest from a real code base in test.pp
# test2.pp was created by simply concatenating test.pp twice
$ wc /tmp/test*
11076 26918 371942 /tmp/test2.pp
5538 13459 185971 /tmp/test.pp
# On branch master
nothing to commit, working directory clean
$ for i in `seq 1 5` ; do time RUBYLIB=lib puppet doc -dv --color=no --mode rdoc /tmp/test.pp >/dev/null ; done
@ffrank
ffrank / gist:1629c2967104e5db3402
Last active August 29, 2015 14:19
Bundler, what's wrong with you?
$ git show HEAD
commit 5d996babd607b35ffa77d151ea94acc9c15edd77
Author: Melissa Stone <melissa@puppetlabs.com>
Date: Mon Jan 6 14:17:38 2014 -0800
(packaging) Update PUPPETVERSION to 3.4.2
...
puppy@geras:~/puppet-3.4.2$ bundle show puppet
/home/puppy/puppet-3.4.2
ffrank@geras:~/git/puppet$ bundle exec puppet apply -e 'notify { "it works": }' --trace
Already evaluated rest at /home/ffrank/gems/gems/facter-2.3.0/lib/facter/ec2.rb:21, reevaluating anyways
Already evaluated rest at /home/ffrank/gems/gems/facter-2.3.0/lib/facter/ec2.rb:38, reevaluating anyways
Already evaluated rest at /home/ffrank/gems/gems/facter-2.3.0/lib/facter/gce.rb:4, reevaluating anyways
Error: Could not parse for environment production: not symbol at line 1 on node geras.fritz.box
/home/ffrank/git/puppet/lib/puppet/parser/parser_support.rb:172:in `rescue in parse'
/home/ffrank/git/puppet/lib/puppet/parser/parser_support.rb:163:in `parse'
/home/ffrank/git/puppet/lib/puppet/node/environment.rb:557:in `perform_initial_import'
/home/ffrank/git/puppet/lib/puppet/node/environment.rb:287:in `known_resource_types'
/home/ffrank/git/puppet/lib/puppet/resource/type_collection_helper.rb:5:in `known_resource_types'