Skip to content

Instantly share code, notes, and snippets.

View slachiewicz's full-sized avatar

Sylwester Lachiewicz slachiewicz

View GitHub Profile
@slachiewicz
slachiewicz / polaris-pg_lake.sql
Created November 11, 2025 15:25 — forked from sfc-gh-mslot/polaris-pg_lake.sql
Expose pg_lake Iceberg tables via Polaris metadata
create or replace function add_table_to_polaris(p_namespace_name text, p_table_name text, p_metadata_location text)
returns void
language plpgsql
as $function$
declare
v_catalog_id bigint;
v_namespace_id bigint;
v_table_id bigint;
v_now bigint := (extract(epoch FROM clock_timestamp()) * 1000)::bigint;
v_location text;

📝 Documentation updates

  • [MRAR-94] - Add documentation and examples for rarResources configuration (#143)

👻 Maintenance

  • Adjust site descriptor (#146) @slachiewicz
  • Enable prevent branch protection rules (#135) @sparsick
  • Replace deprecated configureReproducible method (#131) @elharo
  • Enable GitHub issues (#36) @Bukama
@slachiewicz
slachiewicz / benchmark-commands.txt
Created December 21, 2024 23:12 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@slachiewicz
slachiewicz / create-jira-link-pr.sh
Created December 8, 2024 22:21 — forked from gnodet/create-jira-link-pr.sh
Script creating a JIRA issue for a given PR
@slachiewicz
slachiewicz / jira_oauth.go
Created August 27, 2022 22:11 — forked from Lupus/jira_oauth.go
Example of using OAuth authentication with JIRA in Go
/*
To the extent possible under law, Konstantin Olkhovskiy has waived
all copyright and related or neighboring rights to this snippet.
CC0 license: http://creativecommons.org/publicdomain/zero/1.0/
*/
package main
import (
"crypto/x509"
@slachiewicz
slachiewicz / build-protoc.sh
Created May 10, 2022 10:36 — forked from syhily/build-protoc.sh
Build protoc.exe for Apple M1
#!/bin/bash
# Builds protoc executable into target/<OS>/<ARCH>/protoc.exe; optionally builds
# protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe
#
# Usage: ./build-protoc.sh <OS> <ARCH> <TARGET>
#
# <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH>
# combinations:
# HOST <OS> <ARCH> <COMMENT>
@slachiewicz
slachiewicz / metadata.sh
Created August 29, 2021 17:53 — forked from atheiman/metadata.sh
EC2 Metadata API basics
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
METADATA_TOKEN="$(curl -s -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 21600')"
AVAILABILITY_ZONE="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone)"
export AWS_REGION="$(echo "$AVAILABILITY_ZONE" | rev | cut -c 2- | rev)"
export AWS_DEFAULT_REGION="$AWS_REGION"
export INSTANCE_ID="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/instance-id)"
# Instance identity documents is another very useful interface with many key value pairs in json format
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
@slachiewicz
slachiewicz / export-files-job.yaml
Created August 29, 2021 17:52 — forked from atheiman/export-files-job.yaml
Generate job artifacts in an initContainer and export the files to workstation afterwards.
# Allows copying of job files to local after execution. Example copy command:
#
# kubectl apply -f ./export-file-job.yaml
# POD=$(kubectl get pod --selector=job-name=export-files -o jsonpath='{.items[0].metadata.name}')
# kubectl wait pod/$POD --for=condition=ready
# until kubectl logs $POD | grep 'Ready for download'; do sleep 2; done
# kubectl cp $POD:files.zip ./job-files-$(date +"%Y%m%d%H%M").zip
#
# Another option would be for the `export-files` container to be a webserver to
# serve of the artifact files to be downloaded with `kubectl port-forward ...`.
@slachiewicz
slachiewicz / SpringTaskExecutor.java
Created April 19, 2021 19:53 — forked from mguilherme/SpringTaskExecutor.java
Start 5 tasks and wait until they finish (Spring AsyncTaskExecutor)
package com.guilherme.miguel;
import io.vavr.control.Try;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@slachiewicz
slachiewicz / setup.md
Created January 10, 2021 00:55 — forked from rinarakaki/setup.md
Set up dev environment based on Ubuntu 20.10

.bash_profile

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

export CC=clang-11
export CXX=clang++-11

export PATH=/usr/lib/linux-tools-4.15.0-66:$PATH