Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Custom scripts here
echo "This is an extended entrypoint!"
# Run the original entrypoint located at
# /docker-entrypoint.sh
exec /docker-entrypoint.sh "$@"
@PieterScheffers
PieterScheffers / shopware-di-classes.php
Created September 11, 2017 12:56
Shopware - Dependency Injection container classes - HTML overview
/**
* @param InstallContext $context
*/
public function install(InstallContext $context)
{
$serviceIds = $this->container->getServiceIds();
$services = [];
$incr = 1;
@PieterScheffers
PieterScheffers / docker-registry.js
Last active June 4, 2017 11:30
Get docker registry repo:tag list
// install docker-registry-api: npm install docker-registry-api
// fill in options
// run this: node docker-registry.js
const dockerRegistry = require('docker-registry-api');
async function main() {
const options = {
user: "myuser",
@PieterScheffers
PieterScheffers / docker-entrypoint.sh
Last active June 1, 2017 13:19
Docker entrypoint, allow plugins
#!/bin/bash
# http://www.camptocamp.com/en/actualite/flexible-docker-entrypoints-scripts/
DIR=/docker-entrypoint.d
if [[ -d "$DIR" ]]
then
/usr/bin/run-parts --exit-on-error --verbose --arg "$@" "$DIR"
fi
@PieterScheffers
PieterScheffers / docker-raspberry-pi.sh
Created May 30, 2017 12:49
Build ARM docker images for Raspberry Pi with QEMU
# https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/
### Choose a base image with QEMU binary
# FROM hypriot/rpi-alpine
# FROM resin/rpi-raspbian
# FROM resin/raspberry-pi-alpine-node:slim
### Register QEMU in the build agent
docker run --rm --privileged multiarch/qemu-user-static:register --reset
@PieterScheffers
PieterScheffers / encode_base64.bat
Created May 14, 2017 14:04
Give the base64 of a file via PHP
@echo off
:: %~dp0 = directory of this batch file
:: %CD% = pass cwd
:: %* = pass all arguments
php %~dp0\encode_base64.php %*
:: Usage: encode_base64 <path-to-file>
@PieterScheffers
PieterScheffers / gist:1afefd1d464897d408eb8c025c426e83
Created May 8, 2017 11:53 — forked from sheepkiller/gist:9740b280ba199cdc5baa
Quickstart : Simple docker-registry on FreeBSD
root@dcoker-registry:/root # pkg install -y py27-supervisor libevent2 py27-pip-1.5.6
Updating repository catalogue
FreeBSD repository is up-to-date
All repositories are up-to-date
pkg: mplayerxp has a missing dependency: win32-codecs
The following 10 packages will be affected (of 0 checked):
New packages to be INSTALLED:
py27-supervisor: 3.0_1,1
py27-meld3: 0.6.8_1
node {
stage("composer_install") {
sh 'composer install'
}
stage("php_lint") {
sh 'find . -name "*.php" -print0 | xargs -0 -n1 php -l'
}
stage("phpunit") {
@PieterScheffers
PieterScheffers / low_level_memory.js
Created April 14, 2017 18:31
Javascript variant of low level memory
function and(first, second) {
return Number(first && second);
}
function or(first, second) {
return Number(first || second);
}
function not(first) {
return Number(!first);
@PieterScheffers
PieterScheffers / find_files.php
Created April 13, 2017 13:46
Get the output from all files with a name into a log file
<?php
const NL = "\n";
function getCmdArg($key, $default = '')
{
global $argv;
$arguments = array_reverse($argv);