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
### This fully erases git hub history | |
### Make sure to backup/copy files to a safe place before running | |
SET GIT_AUTHOR_DATE="2024-11-18 16:44:44" | |
SET GIT_COMMITTER_DATE="2024-11-18 16:44:44" | |
git clone https://github.com/BitKind/repo-to-reset.git | |
cd repo-to-reset | |
git checkout --orphan datafreedom | |
git rm -rf . | |
copy C:\Users\projects\original-repo-to-reset C:\Users\projects\repo-to-reset |
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
# Script to upload file to Google Drive using Device Authorization | |
# https://developers.google.com/identity/protocols/oauth2/limited-input-device | |
# Authorization is granted by entering the User_Code and accepting via https://google.com/device | |
# this is a manual step that must be completed | |
# Prerequisite - Google Project Device Credentials Client_id and Client_Secret and google.drive API Enabled | |
#!/bin/bash | |
# https://developers.google.com/identity/protocols/oauth2/limited-input-device |
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 |
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
# 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
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
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
# | |
# | |
# 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
# 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"} |
NewerOlder