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
C:\Users\Employee\projects\aws\aws-cert\tf\security\test>tf state list | |
2020/09/06 15:15:35 [INFO] Terraform version: 0.13.2 | |
2020/09/06 15:15:35 [INFO] Go runtime version: go1.14.7 | |
2020/09/06 15:15:35 [INFO] CLI args: []string{"c:\\app\\terraform\\tf.exe", "state", "list"} | |
2020/09/06 15:15:35 [DEBUG] Attempting to open CLI config file: C:\Users\Employee\AppData\Roaming\terraform.rc | |
2020/09/06 15:15:35 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2020/09/06 15:15:35 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins | |
2020/09/06 15:15:35 [DEBUG] ignoring non-existing provider search directory C:\Users\Employee\AppData\Roaming\terraform.d\plugins | |
2020/09/06 15:15:35 [DEBUG] ignoring non-existing provider search directory C:\Users\Employee\AppData\Roaming\HashiCorp\Terraform\plugins |
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 /F %i IN (regions.txt) do @aws ssm get-parameters --names /aws/service/ami-windows-latest/Windows_Server-2019-English-Full-Base --query "Parameters[]" --region "%i" >> winami.json | |
FOR /F %i IN ('aws ec2 describe-instances --filters "Name=tag:Name,Values=tableau" --query "Reservations[*].Instances[*].{Instance:InstanceId}" --output text') DO echo start | aws ec2 start-instances --instance-ids %i | |
FOR /F %i IN (all_regions.txt) DO @FOR /F %q IN ('aws ec2 describe-vpcs --query "Vpcs[*].VpcId" --region %i --output text') DO @echo %i %q | |
FOR /L %i in (1,1,254) do ping -w 25 -n 1 10.0.0.%i | grep "Reply" >> n.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
# pip install pandas | |
# pip install openpyxl | |
# pip install xlsxwriter | |
import pandas as pd | |
url='https://www.oracle.com/cloud/data-regions/#government' | |
df = pd.read_html(url) | |
writer = pd.ExcelWriter('OCI-Cloud-Active-Features.xlsx', engine='xlsxwriter') | |
sheets = {0:"North America DS",1:"North America OCI",2:"EMEA DS",3:"EMEA OCI",4:"LAD DS",5:"LAD OCI",6:"APAC DS",7:"APAC OCI",8:"Dedicated",9:"GovCloud"} |
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
# | |
# | |
# Todo: Jinja2 template | |
# | |
# | |
import oci | |
# from jinja2 import Template | |
import re | |
from datetime import datetime |
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 pathlib import Path | |
# Example load_files('c:/data/sqlfiles','sql') | |
def load_files(source_path,file_suffix): | |
filelist=[] | |
basepath = Path(source_path) | |
files = basepath.iterdir() | |
for file in files: | |
if file.suffix == "."+file_suffix: | |
fileinfo = str(file.name) + "," + str(file) + "," + str(file.stat().st_size) + str(file.stat().st_mtime) |
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
oci ns get --auth instance_principal | |
export OCI_CLI_AUTH=instance_principal | |
# Downloading with oci os object command is much faster than using Signed URL when Service Gateway is configured. | |
# bulk load files | |
oci os object bulk-upload --bucket-name dmpfiles --src-dir dumpfiles/ | |
# bulk download with filter | |
oci os object bulk-download --bucket-name dmpfiles --include warehouse_01* --download-dir . |
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
# AMI ID ami-0affd4508a5d2481b | |
sudo yum install vsftpd | |
sudo systemctl start vsftpd | |
sudo systemctl enable vsftpd | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install | |
#Local Command Line |
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
import requests | |
import wget | |
import os | |
BaseFolder ='https://s3-us-gov-west-1.amazonaws.com/cg-d4b776d0-d898-4153-90c8-8336f86bdfec/masters/' | |
datalist = ['arson','asr','cargo-theft','hate-crime','human-trafficking','pe','nibrs','reta','shr','supp'] | |
try: | |
if not os.path.exists('./data/'): | |
os.mkdir('./data/') |
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
# Region ID is embeded in Image ID format: ocid1.image.oc1.REGION.ImageID | |
set CID=compartmentid | |
for /F %i IN (AvailableRegions.txt) DO (oci compute image list --compartment-id=%CID% --all --display-name Canonical-Ubuntu-20.04-2023.04.18-0 --region %i --query "data[].[\"id\"]") | |
# Save File with regions | |
af-johannesburg-1 | |
ap-chuncheon-1 | |
ap-hyderabad-1 |