Skip to content

Instantly share code, notes, and snippets.

akesterson@ATLPTLBS3TWW1 ~/source/xml2json
$ ./xml2json.py -t xml2json test.xml |\
head -n 1 |\
python -c 'import dpath.util; import json; import sys; print json.dumps(dpath.util.search(json.loads(sys.stdin.read()), "/ListHostedZonesResponse/HostedZones/HostedZone/[0-3]/Id"), indent=4, sort_keys=True)' 2>&1
{
"ListHostedZonesResponse": {
"HostedZones": {
"HostedZone": [
{
"Id": "/hostedzone/ZM0TA3Q0DI8S1"
[root@failwhale: lib]$ cat ~/.ssh/config
Host github-automation-alias
IdentityFile ~/.ssh/automation.pem
HostName github.com
User git
BatchMode yes
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
[root@failwhale: lib]$ ssh github-automation-alias
#!/bin/bash
cd ..
GIT_DIR=.git
if ! [ -t 0 ]; then
read -a ref
fi
IFS='/' read -ra REF <<< "${ref[2]}"
BRANCH="${REF[2]}"
akesterson@ATLPTLBS3TWW1 ~/source/vocalocity/machinist
$ tracert 50.19.32.70
Tracing route to ec2-50-19-32-70.compute-1.amazonaws.com [50.19.32.70]
over a maximum of 30 hops:
1 2 ms 2 ms 2 ms 192.168.43.1
2 315 ms 50 ms 32 ms 180.sub-66-174-175.myvzw.com [66.174.175.180]
3 59 ms 69 ms 62 ms 82.sub-69-83-57.myvzw.com [69.83.57.82]
4 47 ms 39 ms 39 ms 225.sub-69-83-57.myvzw.com [69.83.57.225]
root@radar:~# nagios3 -v /etc/nagios3/nagios.cfg
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL
Website: http://www.nagios.org
Reading configuration data...
File "./ldap-convert.sh", line 216, in main
main "$@"
File "./ldap-convert.sh", line 198, in main
store_user userobj
File "./ldap-convert.sh", line 63, in store_user
ssh -q "${cmdarg_cfg['dst_ssh']}" "$@"
File "./ldap-convert.sh", line 15, in _trap_err
cmdarg_traceback
akesterson@ATLPTLBS3TWW1 ~/source/cmdarg
$ cat test.sh
#!/bin/bash
source cmdarg.sh
function x
{
y
#!/usr/bin/bash4
declare -A thingy
function x
{
local doohicky
doohicky=$1
echo ${!doohicky[x]}
}
if [ -f ~/.ssh-agent ]; then
. ~/.ssh-agent
if [ ! -e $SSH_AUTH_SOCK ] || [ "$(pgrep ssh-agent | grep $SSH_AGENT_PID)" == "" ]; then
echo "Stale ~/.ssh-agent file, ssh agent appears to be dead"
ssh-agent > ~/.ssh-agent
. ~/.ssh-agent
ssh-add
fi
else
ssh-agent > ~/.ssh-agent
(1:39:33 PM) unxmaal: is it better to have a very short list, basically common and nodename, and then apply classes to each node, or to have a "container" for each "node type" that'd then include the classes?
(1:50:39 PM) akesterson: mmm you're talking about how to specify which systems get which puppet classes?
(1:51:29 PM) unxmaal: yeah
(1:51:46 PM) unxmaal: did you use hiera yet?
(2:00:40 PM) unxmaal: that's the main issue now: what method do i use to tell hiera what kind of system something is?
(2:15:14 PM) akesterson: sorry been busy
(2:15:33 PM) akesterson: So the real problem you're facing here is the lack of any ENC
(2:16:08 PM) akesterson: and faced with the lack of ENC, you only have 2 options:
(2:16:08 PM) akesterson: 1- Use hiera data to determine, automagically, by either the hostname or some other tag, like you said
(2:16:08 PM) akesterson: 2- have the system itself tell you that through facter