Skip to content

Instantly share code, notes, and snippets.

View dkarlovi's full-sized avatar
🖌️
Moving bytes around.

Dalibor Karlović dkarlovi

🖌️
Moving bytes around.
View GitHub Profile
@dkarlovi
dkarlovi / README.md
Last active August 29, 2015 14:16
Testing the gist.io layout

This is basically a test of using gist.io as a blogging tool.

For example

Using it might involve some headings and paragraphs.

<?php
use WindowsAzure\Blob\Models\ContainerAcl;
use WindowsAzure\Blob\Models\PublicAccessType;
// after having run a Job to create a thumbnail from our uploaded media item as seen:
// http://stackoverflow.com/questions/31070909/how-to-get-a-thumbnail-from-a-video-on-azure-media-services
// this asset contains our thumbnails
$asset = current($mediaServicesProxy->getJobOutputMediaAssets($job));
@dkarlovi
dkarlovi / registry.example.com.conf
Last active February 7, 2024 19:38
GitLab's Container Registry (docker) behind Apache 2.4 reverse proxy
<VirtualHost *:80>
ServerName registry.example.com
ServerSignature Off
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
</VirtualHost>
<VirtualHost *:443>
@dkarlovi
dkarlovi / Dockerfile
Last active April 6, 2023 08:38
Setting up permissions for a (Symfony) web app on Docker
FROM alpine:3.7
# this is the "app" image, contains PHP-FPM
RUN addgroup -g 82 -S www-data && \
adduser -u 82 -H -D -S -G www-data www-data && \
# etc..
# PHP-FPM is setup to run as "www-data"
WORKDIR /app
@dkarlovi
dkarlovi / qa.Dockerfile
Created January 30, 2019 10:56
QA Dockerfile
ARG BUILD_VERSION
FROM example.com/app:${BUILD_VERSION}
# copy QA tools from a known source
COPY --from=jakzal/phpqa:alpine /tools /tools/
COPY --from=jakzal/phpqa:alpine /usr/bin/composer /tools/
RUN apk add --update --no-cache \
curl \
openssl \
@dkarlovi
dkarlovi / README.md
Last active March 9, 2020 23:42
Split a large XML file into several smaller XML files

How to run

saxon -s:in.xml -xsl:split.xsl name=Products size=1200
@dkarlovi
dkarlovi / Dockerfile
Last active March 18, 2020 07:45
Symfony + RoadRunner + build-time cache volume Dockerfile
# syntax=docker/dockerfile:experimental
FROM alpine:3.11 AS runtime
WORKDIR /app
RUN addgroup -g 82 -S www-data && \
adduser -u 82 -H -D -S -G www-data www-data && \
apk add --update --no-cache \
php7 \
php7-ctype \
php7-dom \
php7-iconv \

Test

Pushing to this gist via Git repo

@dkarlovi
dkarlovi / mkcert
Last active July 4, 2020 10:12
/etc/sudoers.d/mkcert
dalibor.karlovic ALL=/usr/bin/tee /etc/pki/ca-trust/source/anchors/mkcert_development_CA*, /usr/bin/rm -f /etc/pki/ca-trust/source/anchors/mkcert_development_CA*, /usr/bin/update-ca-trust extract
@dkarlovi
dkarlovi / Exporter.php
Created April 8, 2021 10:53
Zipkin exporter decoupled from Guzzle
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Zipkin;
use InvalidArgumentException;
use OpenTelemetry\Sdk\Trace;
use OpenTelemetry\Trace as API;
use Psr\Http\Client\ClientExceptionInterface;