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 bash | |
set -e | |
SOURCE_KV=$1 | |
TARGET_KV=$2 | |
results=() | |
list_secrets() { | |
local path=$1 | |
# List secrets at the current path | |
secrets=$(vault kv list -format=json "${SOURCE_KV}/${path}" 2>/dev/null) |
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
private val tableEnv: StreamTableEnvironment by lazy { | |
val tableEnvConfigMap = mapOf( | |
"lookup.cache" to "PARTIAL", | |
"lookup.partial-cache.max-rows" to "50000", | |
"lokup.partial-cache.expire-after-access" to "60min" | |
) | |
val tableEnvSetting = EnvironmentSettings.Builder() | |
.withConfiguration(Configuration.fromMap(tableEnvConfigMap)) | |
.build() |
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
#!/bin/bash | |
startdate=$1 | |
enddate=$2 | |
function print_formatted() { | |
res=`date -j -f %Y-%m-%d $1 +%Y-%m-%d` | |
echo $res | |
} |
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
from itertools import chain | |
import numpy as np | |
from collections import Counter | |
from multiprocessing import cpu_count, Pool | |
def a(weights): | |
w_sum = np.sum(weights) | |
value = np.random.randint(w_sum, size=1)[0] |
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
# Register your models here. | |
import inspect | |
import sys | |
from cytoolz import * | |
from django.contrib import admin | |
from guardian.admin import GuardedModelAdmin | |
from .models import * |
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
# before apply below script, run command | |
# kubectl create clusterrolebinding ecr-cluster-rule --clusterrole=cluster-admin --serviceaccount=default:default | |
apiVersion: batch/v1beta1 | |
kind: CronJob # Tell kuber' that this is a cronjob | |
metadata: | |
name: ecr-puller # Name of the job ,can be anything | |
namespace: default | |
spec: | |
concurrencyPolicy: Allow |
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 json | |
import re | |
from io import BytesIO, StringIO | |
from typing import List | |
import requests | |
import bs4 | |
import boto3 | |
s3 = boto3.client('s3') |
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 numpy as np | |
import pandas as pd | |
import pyarrow as pa | |
from pyarrow import plasma | |
def insert_df_to_plasma(client, df: pd.DataFrame, key=plasma.ObjectID(np.random.bytes(20))) -> plasma.ObjectID: | |
record_batch = pa.RecordBatch.from_pandas(df) | |
object_id = key |
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
def create_yearmonth_list(start_year:int, end_year: int): | |
start_at = start_year * 100 | |
end_at = end_year - start_year | |
for year in range(0,end_at+1): | |
year_acc = year*100 | |
start = start_at + year_acc | |
for month in range(1,13): | |
yyyymm = start+month |
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
settings { | |
logfile = "/tmp/lsyncd.log", | |
statusFile = "/tmp/lsyncd.status", | |
nodaemon = true | |
} | |
sync { | |
default.rsyncssh, | |
source="/path/to/source", | |
host="target-ip-address", | |
targetdir = "/path/to/target", |
NewerOlder