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
# Export IP addresses to support vulnerability scanning | |
# Public IPs | |
touch /tmp/public-ips.txt | |
aws ec2 describe-instances \ | |
--query "Reservations[*].Instances[*].PublicIpAddress" \ | |
--output=text \ | |
>>/tmp/public-ips.txt | |
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
const puppeteer = require('puppeteer'); | |
const debug = process.env.DEBUG == 'true'; | |
const url = 'https://stocktwits.com/mrinvestorpro'; | |
const main = async () => { | |
const browser = await puppeteer.launch({ headless: !debug }); | |
try { | |
console.log('Launching page'); |
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 ruby | |
# Export node group data from Puppet Enterprise | |
# Setup: | |
# export PATH=$PATH:/opt/puppetlabs/puppet/bin | |
# gem install --user-install puppetclassify | |
# puppet-access login --lifetime 8h | |
require 'csv' |
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/sh | |
service xinetd stop | |
service foreman-proxy stop | |
service httpd stop | |
killall -9 sidekiq | |
service puppet stop | |
service puppetserver stop | |
service postgresql stop | |
service rh-redis5-redis stop |
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
package main | |
import ( | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3" | |
"github.com/aws/aws-sdk-go/service/s3/s3manager" | |
"github.com/pkg/errors" |
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
cat >index.http <<EOF | |
HTTP/1.1 200 OK | |
Content-Type: text/html; charset=UTF-8 | |
Server: netcat! | |
<!doctype html> | |
<html><body><h1>A webpage served by netcat</h1></body></html> | |
EOF | |
while true; do cat index.http | nc -l 8000; 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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "An input file is required" | |
echo "usage: $0 <input-file>" | |
exit 1 | |
fi | |
files=$(cat $1) | |
for f in $files; do |
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
# Install dependencies | |
apt-get update; apt-get install -y build-essential ruby2.5-dev | |
gem install bundler --version 1.16.1 | |
# Install fluentd | |
mkdir /opt/fluentd | |
pushd .; cd /opt/fluentd | |
cat <<EOD > Gemfile | |
source "https://rubygems.org" |
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
pipeline { | |
options { | |
buildDiscarder(logRotator(numToKeepStr: '10')) // Retain history on the last 10 builds | |
ansiColor('xterm') // Enable colors in terminal | |
timestamps() // Append timestamps to each line | |
timeout(time: 20, unit: 'MINUTES') // Set a timeout on the total execution time of the job | |
} | |
agent { | |
// Run this job within a Docker container built using Dockerfile.build | |
// contained within your projects repository. This image should include |
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 | |
services="" | |
page_token="" | |
while true; do | |
results=$(aws resourcegroupstaggingapi get-resources --tags-per-page 500 --pagination-token="$page_token") | |
more_services=$(echo "$results" | egrep -o 'arn:aws:([a-z]+):' | cut -d: -f 3 | sort | uniq) | |
services=$(echo -e "$services\n$more_services" | sort | uniq) |
NewerOlder