Skip to content

Instantly share code, notes, and snippets.

View odinuv's full-sized avatar
🐺
Wolf

Ondrej Popelka odinuv

🐺
Wolf
View GitHub Profile
{
"id": "1470083",
"name": "Sample Orchestration J2J",
"description": "",
"created": "2022-03-17T10:21:51+0100",
"creatorToken": {
"id": 545,
"description": "ondrej.popelka@keboolaconnection.onmicrosoft.com"
},
"version": 11,
{
"id": "1465238",
"name": "Sample Transformation",
"description": "",
"created": "2022-03-16T18:01:59+0100",
"creatorToken": {
"id": 545,
"description": "ondrej.popelka@keboolaconnection.onmicrosoft.com"
},
"version": 12,
{
"id": "1465299",
"name": "My MySQL Data Destination",
"description": "",
"created": "2022-03-16T18:16:02+0100",
"creatorToken": {
"id": 545,
"description": "ondrej.popelka@keboolaconnection.onmicrosoft.com"
},
"version": 9,
{
"id": "1471168",
"name": "My HTTP Data Source",
"description": "",
"created": "2022-03-17T13:36:59+0100",
"creatorToken": {
"id": 545,
"description": "ondrej.popelka@keboolaconnection.onmicrosoft.com"
},
"version": 1,
@odinuv
odinuv / script.py
Created April 20, 2021 19:27
Script
import requests
baseUrl = "https://connection.keboola.com"
deleteFrom = "2021-04-19T07:48:00+00:00"
deleteTo = "2021-04-19T10:45:00+00:00"
storageToken = "578-xxxxx"
tableIds = ["in.c-sample.non-existent", "in.c-sample-data.boo"]
for tableId in tableIds:
@odinuv
odinuv / test.sh
Last active March 24, 2021 19:55
test
#!/usr/bin/env bash
set -Eeuo pipefail
printf "\nSetting up disk\n"
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
sudo mkfs.xfs -f /dev/sdc1
sudo partprobe /dev/sdc1
block_record=$(sudo blkid | grep "xfs")
uuid=$(printf "$block_record" | gawk 'match($0, /UUID="([a-zA-Z0-9\-]*)"/, a) {print a[1]}')
pr: none
trigger:
batch: true
branches:
include:
- '*'
variables:
imageName: 'job-queue-daemon'
tag: $(Build.BuildId)
@odinuv
odinuv / main.R
Created August 3, 2020 18:35
DoParallel with Retry
library(doParallel)
cl <- makeCluster(detectCores()-1,outfile="")
registerDoSEQ()
registerDoParallel(cl)
data = data.frame(
first = c('a', 'b', 'c', 'd', 'e'),
second = c('aa', 'bb', 'cc', 'dd', 'ee'),
third = c('aaa', 'bbb', 'ccc', 'ddd', 'eee'),
fourth = c('aaaa', 'bbbb', 'cccc', 'dddd', 'eeee'),
<?php
use Aws\Ecr\EcrClient;
use Aws\Ecr\Exception\EcrException;
use Aws\Exception\CredentialsException;
use Keboola\DockerBundle\Exception\LoginFailedException;
require "vendor/autoload.php";
$ecrClient = new EcrClient(array(
@odinuv
odinuv / fetch-network-killer.php
Created September 27, 2018 15:27
Testing the untestable: Test network kill during fetch
<?php
public function testNetworkKillerFetch(): void
{
$this->setupLargeTable();
ErrorHandler::register(null, true);
$stmt = $this->taintedPdo->query('SELECT * FROM largeTable LIMIT 100000');
$stmt->execute();
self::expectException(\ErrorException::class);
self::expectExceptionMessage('Warning: Empty row packet body');