Skip to content

Instantly share code, notes, and snippets.

@jk
jk / gitlab-ci.yml
Created December 18, 2020 13:11
Run JetBrains Qodana on GitLab CI
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
@jk
jk / 01-install_telegraf.sh
Last active March 14, 2021 17:31
Telegraf Speedtest
#!/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
<?php
$content = file_get_contents("http://wiki.akosma.com/IPhone_URL_Schemes");
preg_match_all('/(\w+):\/\//', $content, $matches, PREG_SET_ORDER);
$tmpSchemes = [];
foreach ($matches as $match) {
$tmpSchemes[$match[1]] = true;
}
$schemes = [];
@jk
jk / Dockerfile
Last active April 22, 2020 11:50
glove
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 July 25, 2019 11:49
Get current temperatur from hamburger wettermast as text (instead of an image)
#!/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
@jk
jk / Dockerfile
Created April 29, 2019 13:02
PHP 7.3 with zstd extension
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 && \
#!/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
@jk
jk / FeatureContext.php
Last active February 14, 2019 16:37 — forked from michalochman/gist:3175175
Take screenshots with Behat + Mink + Selenium2 Stack when a step fails. CAUTION: Work in progress
<?php
use Behat\Behat\Event\StepEvent;
use Behat\Gherkin\Node\StepNode,
Behat\Gherkin\Node\ScenarioNode,
Behat\Gherkin\Node\FeatureNode;
use Behat\Mink\Driver\Selenium2Driver;
/**
@jk
jk / objc_api_visibility.pl
Created December 26, 2011 17:26
iOS AppStore private API usage checker
#!/usr/bin/env perl
# objc_api_visibility.pl
# by Ryan Petrich, inspired by Dustin Howett's Logos
# Reads all Objective-C method names from an installed SDK, determines their visibility and optionally compares against an iOS app binary
sub read_methods {
my $cmd = shift;
my $when_found = shift;
my $current_class;
open(LS_CMD, "$cmd |") or die "Can't run '$cmd'\n$!\n";
diff -ur pngquant-2.9.0/configure pngquant-2.9.0.fixed/configure
--- pngquant-2.9.0/configure 2017-03-06 09:37:30.000000000 +0100
+++ pngquant-2.9.0.fixed/configure 2017-03-07 09:57:20.246012152 +0100
@@ -48,6 +48,7 @@
help "--with-cocoa/--without-cocoa use Cocoa framework to read images"
fi
help "--with-libpng=<dir> search for libpng in directory"
+ help "--with-zlib=<dir> search for zlib in directory"
echo
help "CC=<compiler> use given compiler command"