Skip to content

Instantly share code, notes, and snippets.

View fatmcgav's full-sized avatar

Gavin Williams fatmcgav

View GitHub Profile
@fatmcgav
fatmcgav / act-base Puppetfile.rb
Created July 22, 2015 15:07
Inconsistent Librarian-puppet dependency resolution
#!/usr/bin/env ruby
forge 'http://forge.puppetlabs.com'
metadata
# Pull Nexus repo from Git
mod 'cescoffier/nexus', '>=0.0.1',
:git => 'https://github.com/cescoffier/puppet-nexus.git'
@fatmcgav
fatmcgav / api.json
Last active August 29, 2015 14:24
Tyk Middleware testing...
{
"api_definition": {
"active": true,
"allowed_ips": [],
"api_id": "714007cd6f1347906a9218a0a7ad2213",
"auth": {
"auth_header_name": "Authorization",
"use_param": false
},
"auth_provider": {
@fatmcgav
fatmcgav / default.pp
Created April 21, 2015 09:11
RabbitMQ Apply failure
require ::erlang
include ::rabbitmq
@fatmcgav
fatmcgav / mongo-shell output
Created April 17, 2015 13:32
Mongo-shell exit status when 'auth failed'
# mongo admin --quiet --host 127.0.0.1:27017 --eval "load('/root/.mongorc.js'); db.version()"; echo $?
2.6.9
0
# mongo admin1 --quiet --host 127.0.0.1:27017 --eval "load('/root/.mongorc.js'); printjson(db.system.users.find().toArray())"; echo $?
Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 }
2015-04-17T14:23:16.317+0100 error: { "$err" : "not authorized for query on admin1.system.users", "code" : 13 } at src/mongo/shell/query.js:131
252
# mongo appdb --quiet --eval "load('/root/.mongorc.js'); db.runCommand({\"createUser\": \"app-user\",\"pwd\": \"baaa8ad52b17ec7fbe0a76893e388061\",\"customData\": {\"createdBy\": \"Puppet Mongodb_user['User app-user on db appdb']\"},\"roles\": [\"dbAdmin\"],\"digestPassword\": false})"; echo $?
Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 }
[object Object]
@fatmcgav
fatmcgav / librarian-puppet exception
Last active August 29, 2015 14:18
Librarian Puppet exception
be librarian-puppet install --path=spec/fixtures/modules/ --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: x86_64-linux
[Librarian] Rubygems Version: 2.4.5
[Librarian] Librarian Version: 0.6.2
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 1.5.0
[Librarian] Project: /home/card.co.uk/gavinw/Puppet/module-dev/cataloguesvc
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
@fatmcgav
fatmcgav / beaker-exception
Last active August 29, 2015 14:18
Beaker TypeError - can't convert Symbol into Integer
beaker-2.8.0/lib/beaker/dsl/helpers/host_helpers.rb:61:in `[]': can't convert Symbol into Integer (TypeError)
from /home/card.co.uk/gavinw/.rvm/gems/ruby-1.9.3-p550@catsvc/gems/beaker-2.8.0/lib/beaker/dsl/helpers/host_helpers.rb:61:in `block in on'
from /home/card.co.uk/gavinw/.rvm/gems/ruby-1.9.3-p550@catsvc/gems/beaker-2.8.0/lib/beaker/shared/host_manager.rb:95:in `run_block_on'
from /home/card.co.uk/gavinw/.rvm/gems/ruby-1.9.3-p550@catsvc/gems/beaker-2.8.0/lib/beaker/dsl/patterns.rb:32:in `block_on'
from /home/card.co.uk/gavinw/.rvm/gems/ruby-1.9.3-p550@catsvc/gems/beaker-2.8.0/lib/beaker/dsl/helpers/host_helpers.rb:54:in `on'
from /home/card.co.uk/gavinw/.rvm/gems/ruby-1.9.3-p550@catsvc/gems/beaker-2.8.0/lib/beaker/dsl/helpers/host_helpers.rb:371:in `curl_on'
@fatmcgav
fatmcgav / default.yaml
Created April 2, 2015 14:41
default.yaml with ssh config
HOSTS:
centos-66-x64:
roles:
- agent
platform: el-6-x86_64
hypervisor: vmpooler
template: centos-6-x86_64
CONFIG:
log_level: verbose
type: foss
@fatmcgav
fatmcgav / dynamic_autorequire.rb
Created March 5, 2015 17:03
Dynamic Type autorequire
self.catalog.resources.select { |res|
next if res.type == :domain # Skip domain resources, as autorequired above...
next if res.type == :user # Skip user resources, as autorequired above...
next if res.type == :resourceref # Skip resourceref resources, as that's us...
# Match on resource name...
debug("Res = #{res[:name]}, type = #{res.type}. Self = #{self[:name]}.")
debug("Match = #{res[:name] == self[:name]}.")
res if res[:name] == self[:name]
}.collect { |res|
debug("Collected resource: #{res[:name]}.")
@fatmcgav
fatmcgav / Puppetfile.lock
Last active August 29, 2015 14:16
LIbrarian-puppet 'out of sync!'.
cat Puppetfile.lock
FORGE
remote: http://forge.puppetlabs.com
specs:
datacentred-ldap (0.3.0)
puppetlabs-stdlib (~> 4.0)
deric-accounts (1.0.1)
puppetlabs-stdlib (>= 0.1.7)
puppetlabs-concat (1.2.0)
puppetlabs-stdlib (< 5.0.0, >= 3.2.0)
@fatmcgav
fatmcgav / bigip-f5.patterns
Last active December 6, 2019 20:35
Logstash F5 Access Logging
# F5 Logstash Grok patterns
# F5 Fields
VHOST %{IPORHOST:url}:\s?%{POSINT:port}
VIRTSERVER ((?:\/?[\w\.\-]+){2,4}(?:\s?\d*)?)
F5DATE %{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME}
SSL_CIPHER (?:[\w\-]*)
SSL_VERSION (?:[\w\-\.]*)
SSL_BITS (?:\d{2,4})
SSL_DN (?:[\w]{1,2}=[\w\s]*,?)