Skip to content

Instantly share code, notes, and snippets.

@pflooky
pflooky / OpenMetadataGenerateValidate.scala
Created December 7, 2023 01:56
Example of Data Caterer connecting to OpenMetadata to generate and validate data in JSON and CSV file. Customised field values for JSON file as well.
class AdvancedOpenMetadataSourcePlanRun extends PlanRun {
val openMetadataSource = metadataSource.openMetadata(
"http://host.docker.internal:8585/api",
OPEN_METADATA_AUTH_TYPE_OPEN_METADATA,
Map(
OPEN_METADATA_JWT_TOKEN -> "abc123", //find under settings/bots/ingestion-bot/token
OPEN_METADATA_TABLE_FQN -> "sample_data.ecommerce_db.shopify.raw_customer"
)
)
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-container
volumeMounts:
- name: tmp-dir
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-container
[
{
"op": "add",
"path": "/spec/volumes/-",
"value": {
"name": "tmp-dir",
"emptyDir": {}
}
},
{
@pflooky
pflooky / mutating_webhook_rules.yaml
Created December 23, 2021 09:05
Rules section for Kubernetes mutating webhook configuration
rules:
- operations: ["CREATE"]
apiGroups: ["*"]
apiVersions: ["*"]
resources: ["pods"]
objectSelector:
matchLabels:
app: backend
@pflooky
pflooky / put_object_s3.json
Created August 30, 2021 13:17
Sample put object policy for AWS S3
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::secret-bucket/*"
@pflooky
pflooky / spark_write_s3_policy.json
Last active January 13, 2022 08:04
Minimum AWS permissions needed for Spark to write a file to S3
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListObject",
"s3:DeleteObject"
],
@pflooky
pflooky / install_mac_apps.sh
Last active January 7, 2021 07:30
Install all base apps for dev
#!/bin/bash
Green='\033[0;32m'
echo -e "${Green} Installing all apps under $HOME/install folder"
mkdir ~/install
cd install
#Homebrew
echo -e "${Green} Installing homebrew..."
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
# https://github.com/uBlockOrigin/uAssets/pull/3517
twitch-videoad.js application/javascript
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
var realFetch = window.fetch;
window.fetch = function(input, init) {
if ( arguments.length >= 2 && typeof input === 'string' && input.includes('/access_token') ) {
var url = new URL(arguments[0]);
url.searchParams.forEach(function(value, key) {
url.searchParams.delete(key);