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 | |
''' | |
author: Joshua Worley | |
''' | |
import argparse | |
import json | |
import requests | |
import pprint |
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
''' | |
Description: | |
- pivot into other accounts with specified RoleARN | |
References: | |
assume_role: | |
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.assume_role | |
''' | |
import boto3 | |
import botocore.exceptions |
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 boto3 | |
from boto3.session import Session | |
from io import BytesIO | |
from sys import argv | |
pn = argv[1] | |
bucket = argv[2] | |
sub_folder_path = argv[3] |
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
## upload config | |
curl -u admin:${p} -k --form file="@./path/to/cloud-portal-template.xml" "https://${ip}/api/?type=import&category=configuration" | |
<response status="success"><msg><line>cloud-portal-template.xml saved</line></msg></response> | |
## load config | |
curl -u admin:${p} -k "https://${ip}/api/?type=op&cmd=<load><config><from>cloud-portal-template.xml</from></config></load>" | |
<response status="success"><result><msg><line>Config loaded from cloud-portal-template.xml</line></msg></result></response> | |
## commit config | |
curl -u admin:${p} -k "https://${ip}/api/?type=commit&cmd=<commit><force></force></commit>" |
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 boto3 | |
access_key = "YOURACCESSKEYHERE" | |
secret_key = "YOURSECRETKEYHERE" | |
bucket = "YOURBUCKETNAMEHERE" | |
filename = "YOURFILENAME.ova" | |
full_path = "/path/to/your/file/" | |
conn = boto3.client('s3', 'us-east-1', | |
endpoint_url="http://ceph-s3.services.dmtio.net", |
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
curl -XGET 'localhost:9200/_cluster/settings?pretty' | |
{ | |
"persistent" : { | |
"cluster" : { | |
"routing" : { | |
"allocation" : { | |
"enable" : "all" | |
} | |
} | |
} |
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
# set the following cluster settings to prevent rebalancing | |
curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d' | |
{ | |
"persistent": { | |
"cluster.routing.allocation.enable": "none" | |
} | |
} | |
' |
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
ES_DELETE_QUERY(){ | |
INDEX=$1 | |
KEY=$2 | |
VALUE=$3 | |
curl -XPOST 'localhost:9200/${INDEX}/_delete_by_query?scroll_size=5000&pretty' -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"match": { | |
"${KEY}": "${VALUE}" | |
} |
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
curl -XPUT http://localhost:9200/_template/pfsense?pretty -H 'Content-Type: application/json' -d' | |
{ | |
"order" : 0, | |
"version" : 50002, | |
"template" : "pfsense-*", | |
"settings" : { | |
"index" : { | |
"number_of_shards": 3, | |
"number_of_replicas": 1, | |
"refresh_interval" : "30s" |
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
TEMPLATE=$1 | |
curl -XGET 'localhost:9200/_template/${TEMPLATE}?pretty' |
NewerOlder