Skip to content

Instantly share code, notes, and snippets.

<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>
[root@ec2-54-211-240-78.akesterson-dev : ~]$ 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
[root@ec2-54-211-240-78.akesterson-dev : ~]$ grep -E 'bin/(ba)*sh' scripts.txt | wc -l
255
# ^ 255 bash scripts
[root@ec2-54-211-240-78.akesterson-dev : ~]$ grep -E 'bin/python' scripts.txt | wc -l
44
# 44 python scripts
akesterson@ATLPTLBS3TWW1 ~/source/vocalocity/tools-orchestration
$ cat ~/tmp/test.sh
#!/bin/bash
declare -A hashvar
declare -a array
function useit
{
hashvar['lolsomething']=lol
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
}
[akesterson@ec2-54-242-78-15 ~]$ cat test.sh
#!/usr/bin/bash4
function printpid()
{
echo $$
}
echo $$
Given this code:
CMDARG_ARGARRAY=($@)
echo "Arguments: "
for key in ${!CMDARG_ARGARRAY[@]}
do
echo "${key} => ${CMDARG_ARGARRAY[$key]}"
done
(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
irb(main):001:0> x = ""
=> ""
irb(main):002:0> y = [x]
=> [""]
irb(main):003:0> x="lolzors"
=> "lolzors"
irb(main):004:0> y
=> [""]
class userobj {
user { 'myuser':
ensure => present
}
}
class otherthing {
user { 'myuser':
group => 'mock'
}
akesterson@ATLPTLBS3TWW1 ~/source/3rdparty/FizzBuzzEnterpriseEdition
$ tree
.
├── pom.xml
├── README.md
└── src
├── main
│   └── java
│   └── com
│   └── seriouscompany