This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/hiera.yaml config: | |
--- | |
:backends: | |
- yaml | |
:hierarchy: | |
- %{fqdn} | |
- defaults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<synonyms> | |
<synonym>(-)-Thyroxine</synonym> | |
<synonym>3,3',5,5'-Tetraiodo-L-thyronine</synonym> | |
<synonym>L-Thryoxin</synonym> | |
<synonym>L-Thyroxine</synonym> | |
<synonym>Laevothyroxinum</synonym> | |
<synonym>Levo-t</synonym> | |
<synonym>Levothyroxin</synonym> | |
<synonym>Levothyroxine Sodium</synonym> | |
<synonym>O-(4-Hydroxy-3,5-diidophenyl)-3,5-diiodo-L-tyrosine</synonym> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[email protected] : ~]$ for dir in /bin /usr/bin /usr/local/bin /usr/sbin /sbin /usr/local/sbin ; \ | |
do \ | |
find $dir -exec grep -Hni '^#!' \{\} \; 2>/dev/null ; \ | |
done | grep -v 'Binary file' | sort -u > scripts.txt | |
[[email protected] : ~]$ grep -E 'bin/(ba)*sh' scripts.txt | wc -l | |
255 | |
# ^ 255 bash scripts | |
[[email protected] : ~]$ grep -E 'bin/python' scripts.txt | wc -l | |
44 | |
# 44 python scripts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akesterson@ATLPTLBS3TWW1 ~/source/vocalocity/tools-orchestration | |
$ cat ~/tmp/test.sh | |
#!/bin/bash | |
declare -A hashvar | |
declare -a array | |
function useit | |
{ | |
hashvar['lolsomething']=lol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
killtree() { | |
# Stolen from stack overflow | |
local _pid=$1 | |
local _sig=${2:-TERM} | |
kill -stop ${_pid} 2>/dev/null # needed to stop quickly forking parent from producing child between child killing and parent killing | |
for _child in $(ps -o pid --no-headers --ppid ${_pid}); do | |
killtree ${_child} ${_sig} | |
done | |
kill -${_sig} ${_pid} 2>/dev/null | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[akesterson@ec2-54-242-78-15 ~]$ cat test.sh | |
#!/usr/bin/bash4 | |
function printpid() | |
{ | |
echo $$ | |
} | |
echo $$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given this code: | |
CMDARG_ARGARRAY=($@) | |
echo "Arguments: " | |
for key in ${!CMDARG_ARGARRAY[@]} | |
do | |
echo "${key} => ${CMDARG_ARGARRAY[$key]}" | |
done | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(8:28:46 AM) akesterson: here's another sudoers question, which google hasn't been good at answering | |
(8:29:17 AM) akesterson: I have a user that is in a group (App_Admin_Puppet) that needs to be able to | |
run a sudo commandin some network locations, but not others. We need one sudoers file that can express | |
this everywhere, and I'd like to do it with only the one App_Admin_Puppet group. | |
(8:29:34 AM) akesterson: so I have a host alias that says "All hosts except ec2 internal, amz1 vpc, | |
or our xyz datacenter" | |
(8:29:39 AM) akesterson: Host_Alias NONPROD=DEV_SYSTEMS,!INTERNAL,!AMZ1,!XYZ | |
(8:29:54 AM) akesterson: then there's the line that says "if he's in the puppet application admins | |
group, let him through" | |
(8:29:59 AM) akesterson: %App_Admin_Puppet ALL=(ALL) NOPASSWD:ALL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> x = "" | |
=> "" | |
irb(main):002:0> y = [x] | |
=> [""] | |
irb(main):003:0> x="lolzors" | |
=> "lolzors" | |
irb(main):004:0> y | |
=> [""] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class userobj { | |
user { 'myuser': | |
ensure => present | |
} | |
} | |
class otherthing { | |
user { 'myuser': | |
group => 'mock' | |
} |