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
#!/bin/bash | |
ERR=0 | |
function ssl_check(){ | |
local TARGET=$1; | |
local DAYS=7; | |
echo "checking if $TARGET expires in less than $DAYS days"; | |
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| openssl x509 -text \ | |
| grep 'Not After' \ |
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
#!/usr/bin/env bash +x | |
#clone the repo if it's not there. | |
if [ ! -d ssllabs-scan ]; then | |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
git clone git://github.com/ssllabs/ssllabs-scan.git | |
fi | |
#jump into it | |
cd ssllabs-scan |
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 String | |
def is_first_char_upper? | |
self[0] == self[0].upcase | |
end | |
end |
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
#include <Bounce.h> | |
const int yPin = 0; | |
const int hPin = 1; | |
const int nPin = 2; | |
Bounce yB = Bounce(yPin, 10); | |
Bounce hB = Bounce(hPin, 10); | |
Bounce nB = Bounce(nPin, 10); | |
void setup() { | |
pinMode(yPin, INPUT_PULLUP); |
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
require 'inifile' | |
unless @key_id | |
aws_credentials=IniFile.load(ENV['HOME']+'/.aws/credentials') | |
puts "Profiles in ~/.aws/credentials:" | |
aws_credentials.sections.each do |section| | |
section_index = aws_credentials.sections.index(section) | |
puts section_index.to_s + ": " + section | |
end | |
puts "Enter the number for the corresponding AWS profile: " |
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
#!/bin/bash | |
terraforming help | grep terraforming | grep -v help | awk '{print "terraforming", $2, "--profile", "default", ">", $2".tf";}' | bash |
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
#!/usr/bin/env bash | |
IFS=$'\n' | |
for each in $(aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,Tags[?Key==`Name`].Value | [0]]' --output text); | |
do | |
instance=$(echo $each | cut -d$'\t' -f1) | |
name=$(echo $each | cut -d$'\t' -f2) | |
terraform import aws_instance.${name} ${instance} | |
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
for i in `aws ec2 describe-regions | jq -r '.Regions[].RegionName'` ; do | |
aws ec2 describe-availability-zones --region $i | |
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
#from $JENKINS_HOME/jobs | |
for i in $(ls -1 *JobGlob*/config.xml); do | |
prefix=$(dirname $i) | |
fn=$(basename $i) | |
cp $i /tmp/jenkins_build_issues/${prefix}_${fn} | |
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
wget --mirror -p --convert-links -P . http://webpage.url |
NewerOlder