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
local csv = require("csv") | |
local f = csv.open("device-table2.csv", {['header'] = true}) | |
local columns = {"id", "free_storage_in_byte", "used_storage_in_byte"} | |
local parameters = {} | |
local counter = 0 | |
for fields in f:lines() do | |
perRowCondition = {} | |
for index, value in pairs(fields) do | |
for _,v in pairs(columns) do |
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
# 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
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
@ContextConfiguration | |
@DataJpaTest | |
class DbunitWithGenesisTest extends Specification { | |
private static Logger log = LoggerFactory.getLogger(DbunitWithGenesisTest.class) | |
def hi = 1L..10L | |
// testEntityManager는 persistence context 테스트 목적으로 사용된다. | |
// 즉, 실제 데이터베이스에 적용할수는 없다 | |
@Autowired |
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
# 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 |
NewerOlder