This file contains 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
#!/bin/bash | |
if [ $# -ne 3 ] ; then | |
echo "usage: $0 <interface> <ip/cidr> <gateway>" | |
echo "ie: $0 eno1 10.0.0.25/24 10.0.0.1" | |
exit 1 | |
fi | |
INTERFACE=$1 | |
IP=$2 |
This file contains 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
# Attach to a running ssh-agent or start a new one | |
if [ `find /tmp -maxdepth 1 -name "ssh-*" -user ${USER} | wc -l` == 1 ] ; then | |
echo "Found ssh-agent, attaching.." | |
SSHDIR=`find /tmp -maxdepth 1 -name "ssh-*" -user ${USER}` | |
SSH_AUTH_SOCK=`ls ${SSHDIR}/agent*` ; export SSH_AUTH_SOCK | |
SSH_AGENT_PID=`echo ${SSH_AUTH_SOCK} | awk -F"." '{print $2+1}'` ; export SSH_AGENT_PID | |
echo "Agent pid ${SSH_AGENT_PID}" | |
elif [ `find /tmp -maxdepth 1 -name "ssh-*" -user ${USER} | wc -l` == 0 ] ; then | |
echo "no ssh-agent found, starting.." | |
eval `ssh-agent -t 86400` |
This file contains 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
#!/bin/sh | |
if [ $# = 2 ] ; then | |
NODENAME=$1 | |
LEVEL=$2 | |
elif [ $# = 1 ] ; then | |
NODENAME=$HOSTNAME | |
LEVEL=$1 | |
else | |
NODENAME=$HOSTNAME |
This file contains 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
#!/usr/bin/env python3 | |
import datetime | |
import pytz | |
import boto3 | |
def lambda_handler(event, context): | |
TerminateDelayDays = 3 | |
StopDelayDays = 1 |
This file contains 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
#!/usr/bin/env python3 | |
import configparser | |
import re | |
import string | |
from random import choice | |
from os.path import expanduser | |
PasswordLength = 32 | |
SpecialCount = 4 |
This file contains 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
#!/bin/bash | |
DOMAIN="example.com" | |
MAILFROM="cmdline@${DOMAIN}" | |
MAILTO="someone@example.com" | |
SUBJECT="Amazon SES SMTP Test from ${HOSTNAME}" | |
USER="AWSKEY" | |
PASSWORD="AWSSMTPPASSWORD" | |
SMTPHOST="email-smtp.us-east-1.amazonaws.com:587" |
This file contains 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
#!/bin/sh | |
echo "Domain: _acme-challenge.${CERTBOT_DOMAIN}" > /tmp/Manual.log | |
echo "Secret: ${CERTBOT_VALIDATION}" >> /tmp/Manual.log | |
echo "Looking for /tmp/done.$$" >> /tmp/Manual.log | |
while [ ! -f /tmp/done.$$ ] | |
do | |
sleep 2 |
This file contains 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
#!/usr/bin/env python3 | |
import calendar, datetime, holidays | |
import math | |
import os, json | |
# hours.json format | |
# | |
# { | |
# "Client1": 116, |
This file contains 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
#!/bin/bash | |
API_KEY="##NFS-API-KEY##" | |
LOGIN="##NFS-USER##" | |
updatedns() { | |
OLDDATA=`dig @${NAMESERVER} -t txt +noall +answer ${DNSRECORD}.${CERTBOT_DOMAIN} | awk '{gsub("\"",""); print $5}'` | |
for FUNCTION in removeRR addRR ; do | |
echo "Running ${FUNCTION}" |
This file contains 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
#!/bin/bash | |
USER="##USER_NAME_NOT_EMAIL##" | |
SECRET="##SECRET##" | |
TEAM="##TEAMNAME##" | |
CACHE="/tmp/repolist.$$" | |
REPOFILE="/tmp/repolist.txt" | |
URL="https://api.bitbucket.org/2.0/repositories/${TEAM}?pagelen=100" |
NewerOlder