Skip to content

Instantly share code, notes, and snippets.

View erikvanoosten's full-sized avatar

Erik van Oosten erikvanoosten

View GitHub Profile
trait ConverterPlugin {
def name: String
def init(): Unit
def makeConverter(specification: String): Converter
trait Converter {
def convert(in: String): String
erikvanoosten /
Last active January 20, 2024 18:44
Update Immich
set -euo pipefail
CURRENT_VERSION=$(grep IMMICH_VERSION= .env | awk -F= '{print $2}')
echo "Getting latest version of Immich..."
LATEST_VERSION=$(curl -s --include | grep 'location:' | awk -F/ '{print $NF}')
# Remove DOS line end
package zio.kafka.example
import io.github.embeddedkafka.{ EmbeddedK, EmbeddedKafka, EmbeddedKafkaConfig }
import org.apache.kafka.clients.producer.ProducerRecord
import zio._
import zio.kafka.consumer.Consumer.AutoOffsetStrategy
import zio.kafka.consumer.{ Consumer, ConsumerSettings, OffsetBatch, Subscription }
import zio.kafka.producer.{ Producer, ProducerSettings }
import zio.kafka.serde.Serde
import zio.logging.backend.SLF4J
package test
import zio._
import zio.internal.ExecutionMetrics
object MinimalReproducer extends ZIOAppDefault {
* A runtime layer that can be used to run everything on the thread of the caller.
erikvanoosten / RuntimeReproducer.scala
Created April 8, 2023 05:47
Reproduces problem where a ZIO taks runs on another thread than expected
import zio.internal.ExecutionMetrics
import zio.{Executor, Runtime, RuntimeFlag, RuntimeFlags, Scope, Task, Trace, Unsafe, ZIO, ZIOAppArgs, ZIOAppDefault, ZLayer}
object RuntimeReproducer extends ZIOAppDefault {
override def run: ZIO[Any with ZIOAppArgs with Scope, Any, Any] =
for {
runtime <- ZIO.runtime[Any]
_ <- ZIO.attempt {
println("main thread id" + Thread.currentThread().getId)

Keybase proof

I hereby claim:

  • I am erikvanoosten on github.
  • I am erikvanoosten ( on keybase.
  • I have a public key ASAGx3KiQYeMb9TXRsaSLpS2XNt6-W2zd-d9XV1nT72G2Ao

To claim this, I am signing this object:

erikvanoosten / Parboiled2CsvParser.scala
Created September 23, 2015 11:37 — forked from maciej/Parboiled2CsvParser.scala
Parboiled2 CSV parser
/* based on comments in */
case class Parboiled2CsvParser(input: ParserInput, delimeter: String) extends Parser {
def DQUOTE = '"'
def DELIMITER_TOKEN = rule(capture(delimeter))
def DQUOTE2 = rule("\"\"" ~ push("\""))
def CRLF = rule(capture("\n\r" | "\n"))
def NON_CAPTURING_CRLF = rule("\n\r" | "\n")
val delims = s"$delimeter\r\n" + DQUOTE
import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.*;
import com.yammer.metrics.reporting.GraphiteReporter;
import com.yammer.metrics.reporting.SocketProvider;
import com.yammer.metrics.stats.Snapshot;
import java.util.concurrent.TimeUnit;
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
sudo dpkg -i scala-2.10.3.deb
sudo apt-get update
TIMECAPSULE_IP="" # e.g. ""
TIMECAPSULE_VOLUME="/Time Capsule" # also try "/Data"
export PASSWD='YOURPASSWORDHERE' # No need to escape anything (except "'")
MOUNT_POINT="/mnt/timecapsule" # no need to create the directory
IS_MOUNTED=`mount 2> /dev/null | grep "$MOUNT_POINT" | cut -d' ' -f3`
if [[ "$IS_MOUNTED" ]] ;then