Skip to content

Instantly share code, notes, and snippets.

View azolotko's full-sized avatar
🛠️

Alex Zolotko azolotko

🛠️
  • Zaandam, The Netherlands
View GitHub Profile
@azolotko
azolotko / build.sbt
Last active November 23, 2022 14:21
Generating a scratch-based container image with a GraalVM static native-image binary (via sbt-native-packager's GraalVMNativeImagePlugin and DockerPlugin)
enablePlugins(
GraalVMNativeImagePlugin,
DockerPlugin
)
GraalVMNativeImage / containerBuildImage := Some("ghcr.io/graalvm/native-image")
GraalVMNativeImage / graalVMNativeImageOptions += "--static"
GraalVMNativeImage / packageBin := (GraalVMNativeImage / packageBin).map { f =>
@azolotko
azolotko / nonograms.clj
Last active August 14, 2019 19:29 — forked from skuro/forkme.clj
KS+AZ: Nonograms dojo
(ns nonograms.core
(:require [mikera.image.core :as img]
[mikera.image.colours :as col]))
(def foo (img/load-image-resource "100px-Greek_lc_lamda_thin.png"))
(def w (img/width foo))
(def h (img/height foo))
(def n 20)
private val vpc = Vpc("demo-vpc", "172.101.0.0/16")
private val subnet = Subnet("demo-subnet", "172.101.0.0/24", vpc)
private val sshPermission = new IpPermission()
.withIpv4Ranges(new IpRange().withCidrIp("0.0.0.0/32"))
.withIpProtocol("tcp")
.withFromPort(22)
.withToPort(22)
@azolotko
azolotko / macOS 10.13.5 unbound issue description.md
Last active June 13, 2018 11:58
macOS 10.13.5 unbound issue

The /usr/libexec/unbound resolver shipped with macOS 10.13.5 doesn't seem to work with UDPv6 properly. I tried to reproduce a setup from this guide and encountered an issue: unbound won't respond to DNS queries arriving to IPv6 UDP *:53 (while IPv6 TCP *:53 works fine). I downloaded and compiled the latest published version of unbound and it works well.

Thread 9 (Thread 0x7f1d1f26b700 (LWP 14195)):
#0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007f1d25e4b110 in _L_lock_155 () from /lib/x86_64-linux-gnu/libpthread.so.0
#2 0x00007f1d25e4907c in __deallocate_stack (pd=0x7f1d2605f350 <stack_cache_lock>, pd@entry=0x7f1d1f26b700) at allocatestack.c:760
#3 0x00007f1d25e4a275 in __free_tcb (pd=0x7f1d1f26b700) at pthread_create.c:226
#4 start_thread (arg=0x7f1d1f26b700) at pthread_create.c:432
#5 0x00007f1d2390437d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Thread 8 (Thread 0x7f1d1ea6a700 (LWP 14197)):
#0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
➜ jol hg summary
parent: 91:b5653b56d154 tip
7901803: JOL should try instantiating the sample instances with non-default constructors
branch: default
commit: (clean)
update: (current)
➜ jol java -jar /Users/azolotko/.m2/repository/org/openjdk/jol/jol-cli/0.7-SNAPSHOT/jol-cli-0.7-SNAPSHOT-full.jar estimates java.util.concurrent.ForkJoinPool
# WARNING: Unable to attach Serviceability Agent. You can try again with escalated privileges. Two options: a) use -Djol.tryWithSudo=true to try with sudo; b) echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
# Running 64-bit HotSpot VM.
package clojure;
import clojure.core$partial$fn__4527;
import clojure.core$partial$fn__4529;
import clojure.core$partial$fn__4531;
import clojure.core$partial$fn__4533;
import clojure.lang.RestFn;
public final class core$partial extends RestFn {
public core$partial() {
require 'ostruct'
o = OpenStruct.new(value: 1, tail: OpenStruct.new(value: 2, tail: OpenStruct.new(value: 3, tail: nil)))
def reverse(list, rest = nil)
result = cons(list.value, rest)
if list.tail.nil?
result
else
reverse(list.tail, result)
@azolotko
azolotko / get classpath property.clj
Last active August 29, 2015 14:19
Getting current classpath from Clojure
(System/getProperty "java.class.path")
@azolotko
azolotko / gist:012fd9d9284c27c3d906
Last active August 29, 2015 14:19
Inspecting a Homebrew's wrapper for a Datomic command
cat `which datomic-repl`