Skip to content

Instantly share code, notes, and snippets.

run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 1
# Include test files or not.
# Default: true
tests: false
GeoIP_country_continent = [
"--", "AS", "EU", "EU", "AS", "AS", "NA", "NA", "EU", "AS", "NA", "AF",
"AN", "SA", "OC", "EU", "OC", "NA", "AS", "EU", "NA", "AS", "EU", "AF",
"EU", "AS", "AF", "AF", "NA", "AS", "SA", "SA", "NA", "AS", "AN", "AF",
"EU", "NA", "NA", "AS", "AF", "AF", "AF", "EU", "AF", "OC", "SA", "AF",
"AS", "SA", "NA", "NA", "AF", "AS", "AS", "EU", "EU", "AF", "EU", "NA",
"NA", "AF", "SA", "EU", "AF", "AF", "AF", "EU", "AF", "EU", "OC", "SA",
"OC", "EU", "EU", "NA", "AF", "EU", "NA", "AS", "SA", "AF", "EU", "NA",
"AF", "AF", "NA", "AF", "EU", "AN", "NA", "OC", "AF", "SA", "AS", "AN",
"NA", "EU", "NA", "EU", "AS", "EU", "AS", "AS", "AS", "AS", "AS", "EU",
package creds
func NewProvider() (Provider) {
}
type Provider interface {
FindCredentials() (Creds)
}
NewConnector() (Connector) {
return &sshConnector{...}
}
type sshConnector struct {
dialer dialer
}
func (s *sshConnector) NewConnection(...) {
s.dialer.Dial()
@pboothe
pboothe / fake.sh
Created June 6, 2018 17:34
A command that spies on a binary by being run in its place, calling the original and forking all input and output to logfiles as well as the called subprocess
#!/bin/bash
OUTPUT=$(mktemp -d --tmpdir=/tmp "$(date -Iseconds).$(basename $0).XXXXXXX")
echo "$@" > "${OUTPUT}/cmdline"
env > "${OUTPUT}/env"
cat - \
| tee "${OUTPUT}/input" \
| /usr/cni/bin/$(basename $0) $@ \
| tee "${OUTPUT}/output"
cd "${OUTPUT}"
#!/bin/bash
echo 'This worked!'
FROM ubuntu
ADD myscript.sh /myscript.sh
RUN chmod +x myscript.sh
CMD /myscript.sh
did_they_come_back() {
echo "#### Starting did_they_come_back() ####"
#TODO: Make this take out bad entries from $REBOOT_CANDIDATES
for line in `cat "${REBOOT_ATTEMPTED}"`; do
attempted_host=`echo $line | awk -F: '{ print $1 }'`
if grep -q "${attempted_host}" "${REBOOT_CANDIDATES}" ; then
echo "${attempted_host} still not up but requested during last run:" \
$line |tee -a ${PROBLEMATIC} "${NOTIFICATION_EMAIL}" > /dev/null
else
did_they_come_back() {
echo "#### Starting did_they_come_back() ####"
#TODO: Make this take out bad entries from $REBOOT_CANDIDATES
for line in `cat "${REBOOT_ATTEMPTED}"`; do
attempted_host=`echo $line | awk -F: '{ print $1 }'`
if grep -q "${attempted_host}" "${REBOOT_CANDIDATES}" ; then
echo "${attempted_host} still not up but requested during last run:" \
$line |tee -a ${PROBLEMATIC} "${NOTIFICATION_EMAIL}" > /dev/null
else
has_it_been_24_hrs() {
echo "#### Starting has_it_been_24_hrs ####"
echo "Contents of REBOOT_CANDIDATES (/tmp/rebot-testing/ssh_outage/reboot_candidates:"
cat ${REBOOT_CANDIDATES}
echo "Contents of REBOOT_LOG (/tmp/rebot-testing/reboot_history/reboot_log:"
cat ${REBOOT_LOG}
#echo "# Starting timestamp comparison #"
echo ""
rm -f "${REBOOT_CANDIDATES}.tmp" && touch "${REBOOT_CANDIDATES}.tmp"