USE information_schema;
DESC MV_DATA_DISK_USAGE;
SELECT * FROM MV_DATA_DISK_USAGE;
SELECT DATABASE_NAME, FORMAT(SUM(`BLOBS_B`) / 1024/1024, 0) MB
FROM MV_DATA_DISK_USAGE
GROUP BY DATABASE_NAME
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 json | |
# Path to your HAR file | |
har_file = "example.har" | |
# Load HAR file | |
with open(har_file, "r", encoding="utf-8") as f: | |
har_data = json.load(f) | |
# HAR files store entries under log.entries |
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 bash | |
set -euo pipefail | |
AWS_PROFILE="devops" | |
function hosted_zone_exists() { | |
local domain=$1 | |
aws route53 list-hosted-zones-by-name \ | |
--dns-name "$domain" \ | |
--query "HostedZones[?Name=='${domain}.'] | length(@)" \ |
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 { DBSQLClient } from "@databricks/sql"; | |
import IDBSQLSession from "@databricks/sql/dist/contracts/IDBSQLSession"; | |
interface DataBricksWareHouseConnect { | |
token: string; | |
host: string; | |
path: string; | |
} | |
class DataBricksManager { |
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 databricks import sql | |
DATABRICKS_USE2_PAT = "" | |
use2_workspace = sql.connect( | |
server_hostname="<YOUR-SERVER-HOSTNAME>", | |
http_path="<YOUR-HTTP-PATH>", | |
access_token=DATABRICKS_USE2_PAT, | |
catalog="<YOUR-CATALOG-NAME>", | |
schema="<YOUR-SCHEMA-NAME>" |
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
bedrock_agent: | |
role: > | |
Bedrock AI Assistant | |
goal: > | |
Help users generate responses using AWS Bedrock's LLM. | |
backstory: > | |
You are an advanced AI assistant powered by AWS Bedrock. You excel at processing | |
and generating meaningful insights from textual data. | |
tools: | |
- bedrock_tool |
- Print all of the JSON content in a key value pair, like in an environment file.
echo '{"key1":"value1", "key2": "value2", "key3": "value3"}'\
| jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]'
echo '{"key1":"value1", "key2": "value2", "key3": "value3"}'\
| jq -r 'to_entries[] | "\(.key)=\(.value | tostring)"'
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 | |
current_time=$(date "+%Y_%m_%dT%H_%M_%S") | |
rm -rf .my_job 2> /dev/null | |
mkdir -p .my_job | |
mkdir -p .my_job/{100,101,102,103,104,105,106,107,108,109,110} | |
ls -d .my_job/* | xargs -I {} bash -c "cd '{}' && touch sample_$random_$current_time.txt" | |
curl -s -X GET https://filesamples.com/samples/document/csv/sample4.csv -o .my_job/sample_$current_time.csv | |
curl -s -X GET https://filesamples.com/samples/document/pdf/sample2.pdf -o .my_job/sample_$current_time.pdf | |
curl -s -X GET https://filesamples.com/samples/document/xls/sample3.xls -o .my_job/sample_$current_time.xls |
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
-- Delete a key from JSON Object | |
-- INPUT: {"somekey":"somevalue", "meta": {"ui": false, "miscTest": {"unit": "kWh", "value": 10}}} | |
UPDATE myTable | |
SET meta=JSON_DELETE_KEY(meta, 'miscTest') | |
WHERE id="85c8a446-fe24-11ed-8abf-af2f19c7e27f"; | |
-- RESULT: {"somekey":"somevalue", "meta": {"ui": false}} | |
-- Update a key in JSON Object | |
-- INPUT: {"somekey":"somevalue", "meta": {"ui": false}} |
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
@echo off | |
echo %DATE% %TIME%>C:\Users\Swateek\Downloads\tmp\abc_%RANDOM%.txt |
NewerOlder