Skip to content

Instantly share code, notes, and snippets.

View xgin's full-sized avatar

Eugene Kazakov xgin

View GitHub Profile
@xgin
xgin / ImageDownload.php
Last active May 6, 2016 05:15
Track progress of image creation with docker-php library
<?php
$docker = new Docker\Docker();
$imageManager = $docker->getImageManager();
$params = [
'fromImage' => $this->getParam('name'),
'tag' => ('' === $this->getParam('tag')) ? 'latest' : $this->getParam('tag'),
];
$stream = $imageManager->create(null, $params, $imageManager::FETCH_STREAM);
$layerProgress = [];
$stream->onFrame(function (CreateImageInfo $createImageInfo) use (&$layerProgress) {
@xgin
xgin / letsencrypt-hostname.sh
Created January 4, 2016 07:29
Secure plesk clean installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory