Skip to content

Instantly share code, notes, and snippets.

View damm's full-sized avatar

Scott M. Likens damm

  • Seattle, Washington USA
View GitHub Profile
@markwalkom
markwalkom / logstash.conf
Last active April 29, 2022 10:23
Reindexing Elasticsearch with Logstash 2.0
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
scan => true
}
@rosskukulinski
rosskukulinski / cloud_config
Created October 10, 2014 23:25
CoreOS cloud_config for Rackspace Public Cloud
#cloud-config
coreos:
fleet:
public-ip: $public_ipv4
metadata: region=dfw,provider=rackspace
etcd:
discovery: https://discovery.etcd.io/youridhere
# multi-region and multi-cloud deployments need to use $public_ipv4
# We'll actually fill this in using fixup_etc.sh (see below)
# addr: $rax_privatenet_ipv4:4001
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
@pnasrat
pnasrat / gist:7327338
Created November 5, 2013 22:19
Using nsenter and docker
/ # root@precise64:~/util-linux# docker ps
ID IMAGE COMMAND CREATED STATUS PORTS NAMES
71546cef7b56 busybox:latest sleep 3600 16 minutes ago Up 16 minutes pink_monkey
root@precise64:~/util-linux# docker inspect 71546cef7b56 | grep Pid
"Pid": 10614,
root@precise64:~/util-linux# ./nsenter --mount -t 10621 /usr/bin/sh
BusyBox v1.19.3 (Ubuntu 1:1.19.3-7ubuntu1.1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
docker run -e SETTINGS_FLAVOR=prod -e AWS_ACCESS_KEY_ID=$aws_access_key -e AWS_SECRET_KEY=$aws_secret_key -e S3_BUCKET=$s3_bucket -e WORKER_SECRET_KEY=$worker_key -p 5000:5000 -m 0 samalba/docker-registry
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@jtimberman
jtimberman / gist:639638
Created October 21, 2010 23:56 — forked from btm/gist:639581
different ways to get interface IPs
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses]
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses]
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ?
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ?
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file.
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0]
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo
20:29 < kallistec> pp node[:network][:interfaces].current_attribute