This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#### | |
# This script use .env where should be defined DB_FOLDER (the PG data folder) and DB_BACKUPS_FOLDER (the backups location). | |
# It stops the immich stack then make the backup by zipping the db data to a tar file. | |
#### | |
set -a | |
source .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.core.Version; | |
import com.fasterxml.jackson.databind.AnnotationIntrospector; | |
import com.fasterxml.jackson.databind.introspect.Annotated; | |
import com.fasterxml.jackson.databind.introspect.AnnotatedMember; | |
import com.fasterxml.jackson.databind.module.SimpleModule; | |
import java.lang.annotation.Annotation; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/<user>/<repo>/releases/latest) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.databind.ObjectReader; | |
import com.fasterxml.jackson.dataformat.avro.AvroMapper; | |
import com.fasterxml.jackson.dataformat.avro.AvroSchema; | |
import io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer; | |
import io.confluent.kafka.serializers.KafkaAvroDeserializerConfig; | |
import lombok.SneakyThrows; | |
import org.apache.avro.Schema; | |
import org.apache.kafka.common.errors.SerializationException; | |
import org.apache.kafka.common.serialization.Deserializer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.opentracing.log.Fields | |
import io.opentracing.tag.Tags | |
import io.opentracing.util.GlobalTracer | |
import org.aspectj.lang.ProceedingJoinPoint | |
import org.aspectj.lang.annotation.Around | |
import org.aspectj.lang.annotation.Aspect | |
import org.springframework.stereotype.Component | |
import reactor.core.publisher.Mono | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chattr +i /mountpoint # will prevent writes for /mountpoint, but not prevent mounting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Dofusbook real dmg calculator | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.dofusbook.net/fr/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=dofusbook.net | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String toSQL(EntityManager em, String hql) { | |
SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class); | |
HQLQueryPlan p = new HQLQueryPlan(hql, false, Map.of(), hibernateSession.getSessionFactory()); | |
if (p.getTranslators().length > 1) { | |
throw new UnsupportedOperationException(); | |
} | |
return p.getTranslators()[0].getSQLString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
compose_version=$(curl https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) | |
output='/usr/local/bin/docker-compose' | |
curl -L https://github.com/docker/compose/releases/download/$compose_version/docker-compose-$(uname -s)-$(uname -m) -o $output | |
chmod +x $output | |
echo $(docker-compose --version) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With ffmpeg installed : | |
for f in *.mkv ; do ffmpeg -hide_banner -i "$f" -map 0 -c:v copy -c:a ac3 -c:s copy "${f%.mkv}.AC3.mkv" ; done | |
# Without ffmpeg installed | |
for f in *.mkv ; do docker run --rm -v multimedia-series:/temp/ jrottenberg/ffmpeg:4.1-scratch -stats -hide_banner -i /temp/"$f" -map 0 -c:v copy -c:a ac3 -c:s copy /temp/"${f%.mkv}.AC3.mkv" ; done |
NewerOlder