Skip to content

Instantly share code, notes, and snippets.

View hranicka's full-sized avatar

Jaroslav Hranička hranicka

View GitHub Profile
@hranicka
hranicka / project.docker-compose.yml
Created November 28, 2019 12:29
Traefik & multiple docker-compose projects
version: '3'
services:
nginx:
labels:
- "traefik.enable=true"
- "traefik.http.routers.provys-transformer.rule=Host(`www.example.com`)"
- "traefik.http.routers.provys-transformer.tls=true"
networks:
- traefik
@hranicka
hranicka / openldap.md
Last active November 27, 2019 10:16
OpenLDAP Installation

Configure firewall

apt-get install ufw
ufw allow ssh
ufw allow http
ufw allow https
ufw allow ldap
ufw allow ldaps
ufw enable
@hranicka
hranicka / http-basic-auth.php
Created September 18, 2017 09:36
HTTP Basic Auth header generator
<?php
$user = '';
$pass = '';
$header = sprintf('Authorization: Basic %s', base64_encode(sprintf('%s:%s', $user, $pass)));
echo $header . "/n";
@hranicka
hranicka / AvailabilityResolver.php
Created February 22, 2017 17:15
AvailabilityResolver - Can you find a bug w/o tests?
<?php
class AvailabilityResolver
{
/** @var \DateTimeInterface */
private $dateTime;
public function __construct(\DateTimeInterface $dateTime = NULL)
{
@hranicka
hranicka / ob.php
Last active May 5, 2023 14:52
PHP flush() under Apache, mod_proxy, php-fpm
<?php
function doFlush()
{
if (!headers_sent()) {
// Disable gzip in PHP.
ini_set('zlib.output_compression', 0);
// Force disable compression in a header.
// Required for flush in some cases (Apache + mod_proxy, nginx, php-fpm).

Keybase proof

I hereby claim:

  • I am hranicka on github.
  • I am hranicka (https://keybase.io/hranicka) on keybase.
  • I have a public key ASA7S3DC1yp48XOLziNDo0U8PgSfE6yJrj56Z_SeaElmxQo

To claim this, I am signing this object:

@hranicka
hranicka / runtastic-export-all-activities.md
Last active October 5, 2022 01:00
Download all activities from Runtastic.com (as .gpx)

Export all your Runtastic data at once

Inspired by christianewald/runtastic-export-all-activities.md. Thank you!

Major problem of the original solution above is that it opens "Save as" dialog for each file.

Yes, it can be by-passed if you set up a browser to automatically save the file (it's set up by default).

But I don't like it.