$ tree
.
├── production
│ ├── production.tf
│ └── terraform.tfstate
└── site
└── main.tf
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
console.log('Loading function'); | |
var AWS = require('aws-sdk'); | |
var dynamo = new AWS.DynamoDB.DocumentClient(); | |
/** | |
* Provide an event that contains the following keys: | |
* | |
* - operation: one of the operations in the switch statement below | |
* - tableName: required for operations that interact with DynamoDB |
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
provider "aws" { | |
region = "us-east-1" | |
} | |
variable "cidr" { | |
# default = "0.0.0.0/0" | |
default = "" | |
} | |
resource "aws_security_group" "dummy" { |
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
import subprocess | |
import json | |
import base64 | |
import os | |
# Gather all key values | |
keys = json.loads(subprocess.check_output(['curl', '-sL', 'http://localhost:8500/v1/kv/?keys'])) | |
# Map them to their values | |
kvs = {} |
This file has been truncated, but you can view the full file.
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
Ran this query through Grafana: | |
SELECT mean("thread_cache_needed") AS "Thread Cache Needed" FROM (SELECT 100 - (("threads_created" / "connections") * 100) AS "thread_cache_needed" FROM "mysql" WHERE $timeFilter AND "host" = 'ip-10-20-0-127.ec2.internal' fill(null)) WHERE $timeFilter GROUP BY time($__interval) fill(null) | |
InfluxDB Log: | |
...snip..... | |
[I] 2017-08-03T18:13:12Z SELECT mean(thread_cache_needed) AS "Thread Cache Needed" FROM (SELECT 100 - ((threads_created / connections) * 100) AS thread_cache_needed FROM simplisafe.autogen.mysql WHERE time > 1500514212972ms AND time < 1500522389529ms AND host = '10.0.0.1') WHERE time > 1500514212972ms AND time < 1500522389529ms GROUP BY time(30s) service=query |
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
const AWS = require('aws-sdk'); | |
// Gets copy of default provider chain | |
const chain = AWS.CredentialProviderChain.defaultProviders.slice(0); | |
// Inserts additional check for specific profile in ~/.aws/credentials file | |
chain.splice(2, 0, () => new AWS.SharedIniFileCredentials({profile: 'readonly_user'})); | |
// Creates credential resolver that uses my custom provider chain | |
const credentialProvider = new AWS.CredentialProviderChain(chain); |
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
package main | |
import ( | |
"github.com/bronze1man/goStrongswanVici" | |
"github.com/davecgh/go-spew/spew" | |
"strings" | |
) | |
type Status map[string]map[string]string |
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 | |
# This takes advantage of the code in /etc/sysconfig/network-scripts/ifup-routes | |
# handle_file () { | |
# . $1 | |
# routenum=0 | |
# while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do | |
# eval $(ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum)) | |
# line="$(eval echo '$'ADDRESS$routenum)/$PREFIX" | |
# if [ "x$(eval echo '$'GATEWAY$routenum)x" != "xx" ]; then |
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
alert('testing xss vulnerability'); |