Skip to content

Instantly share code, notes, and snippets.

@jk
jk / docker-compose.yml
Created May 25, 2022
Traefik docker-compose network settings
View docker-compose.yml
version: '3.8'
services:
traefik:
image: traefik:v2.5.0-rc2
container_name: traefik
restart: always
environment:
- TZ=Asia/Taipei
ports:
@jk
jk / regex.txt
Created Sep 14, 2021
YouTrack Issue Number RegEx
View regex.txt
/\b[A-Z_0-9]+-[1-9]\d?\b/gmi
@jk
jk / sodium.php
Created Mar 16, 2021
Sodium Test
View sodium.php
<?php
if (sodium_crypto_aead_aes256gcm_is_available()) {
echo 'sodium_crypto_aead_aes256gcm_is_available is true'.PHP_EOL;
} else {
echo 'sodium_crypto_aead_aes256gcm_is_available is false'.PHP_EOL;
}
//echo 'Generated key with sodium_crypto_aead_aes256gcm_keygen is: ' . sodium_crypto_aead_aes256gcm_keygen() . PHP_EOL;
$msg = 'john.doe@example.com';
@jk
jk / gitlab-ci.yml
Created Dec 18, 2020
Run JetBrains Qodana on GitLab CI
View gitlab-ci.yml
qodana:
stage: report
image:
name: jetbrains/qodana:latest
entrypoint: ["/usr/bin/bash", "-l", "-c"]
needs:
- composer-prod
script:
- ln -sf $CI_PROJECT_DIR/ /data/project
- /opt/idea/bin/entrypoint --save-report
View Dockerfile
FROM nvidia/cuda:10.0-base-ubuntu18.04
# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
LABEL com.nvidia.volumes.needed="nvidia_driver"
RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libc6-dev \
@jk
jk / hh-wettermast.sh
Last active Jul 25, 2019
Get current temperatur from hamburger wettermast as text (instead of an image)
View hh-wettermast.sh
#!/bin/bash
curl -fsSL -o /tmp/temp.gif https://wettermast.uni-hamburg.de/plots/TT002_TND.gif \
&& tesseract /tmp/temp.gif /tmp/out -l eng 2&>1 /dev/null \
&& cat /tmp/out.txt \
| grep -h -P '\d+,\d' \
; rm -f out.txt temp.gif
View enviroplus-influxdb.py
# -*- coding: utf-8 -*-
"""Test using the InfluxDB client."""
import time
import colorsys
import os
import sys
import socket
import ST7735
import ltr559
@jk
jk / Dockerfile
Created Apr 29, 2019
PHP 7.3 with zstd extension
View Dockerfile
FROM php:7.3
LABEL maintainer="Jens Kohl <jens.kohl@gmail.com>"
RUN apt-get update && \
apt-get install --no-install-recommends -y git-core && \
git clone --recursive --depth=1 https://github.com/kjdev/php-ext-zstd.git && \
cd php-ext-zstd && \
phpize && \
./configure && \
@jk
jk / 01-install_telegraf.sh
Last active Mar 14, 2021
Telegraf Speedtest
View 01-install_telegraf.sh
#!/bin/bash
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt install -y telegraf
View raspi-borg-install.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Official binaries: https://github.com/borgbackup/borg/releases
# ARM binaries: https://borg.bauerj.eu/
wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-1.1.9-armv6 -O /usr/bin/borg