Skip to content

Instantly share code, notes, and snippets.

View stIncMale's full-sized avatar

Valentin Kovalenko stIncMale

View GitHub Profile
@stIncMale
stIncMale / mongodb-driver-staging-smoke-test.sh
Last active April 22, 2022 20:14
A Bash script verifying that the staging/release MongoDB JVM driver artifacts can be located
#!/usr/bin/env bash
# This script prints paths to directories with all the checked driver artifacts.
# You may then use that information to view META-INF/MANIFEST.MF files from JARs, e.g., as follows:
# unzip -c ~/.m2/repository/org/mongodb/mongodb-driver-core/4.5.0/mongodb-driver-core-4.5.0.jar META-INF/MANIFEST.MF
set -eu
if [[ ${#} -lt 1 || ${#} -gt 2 ]]; then
printf "Usage: %s <release version to test> <artifact repository name, either \"staging\" or \"release\" (defaults to \"staging\")>\n" "${0}" >&2
One may use LDAP caseExactMatch (see https://tools.ietf.org/html/rfc4517#section-4.2.4) by its name
(cn:caseExactMatch: = "vkovalenko")
or by OID
(cn:2.5.13.5: = "vkovalenko")
@stIncMale
stIncMale / largest.sql
Last active September 23, 2020 02:14
The largest SQL I have written so far (PostgreSQL syntax)
with
new_event_tree_model_lob as (--the format of event_tree.model_lob is specified below
select
event_tree_id,
string_agg(
array_to_string(
model_attr_array[:1] ||--a slice of the array with indices <=1, we need an array type here instead of an element of the array
check_not_null(--if there is no matching file then model_lob refers to a file that does not exist, which means the data is corrupted
files.new_id,
array['files for event_tree', event_tree_id::text, 'model_idx', model_idx::text] || 'model_attr_array'::text || model_attr_array)::text ||
package util.concurrent;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.StampedLock;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
import org.springframework.lang.NonNull;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@stIncMale
stIncMale / hs_err_pid5951.log
Last active July 2, 2019 14:57
async-profiler causes SIGSEGV nmethod::get_deopt_original_pc (see https://github.com/jvm-profiling-tools/async-profiler/issues/73)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f142aaf166e, pid=5951, tid=139719484446464
#
# JRE version: Java(TM) SE Runtime Environment (8.0_25-b17) (build 1.8.0_25-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x8ab66e] nmethod::get_deopt_original_pc(frame const*)+0x6e
#