Skip to content

Instantly share code, notes, and snippets.

View mishak87's full-sized avatar

Michal Gebauer mishak87

View GitHub Profile
@mishak87
mishak87 / README.md
Last active April 20, 2016 11:56
Docker Daily

Tools and tips that make my day better.

Holy Trinity for debugging

export TERM=xterm
apt-get update -yq && apt-get install -yq mc vim htop

DVC all the way

@mishak87
mishak87 / IDEA.md
Last active August 29, 2015 14:17
Building multiple versions docker-library/<project> using Makefile

Simple tool for building/uploading multiple versions of docker-library/ like projects

Default directory structure

[docker/]<main.minor>[/<optional>]/Dockerfile

1.) Collect tags

foreach <main>.<minor>
    if -f <main>.<minor>/Dockerfile
 tags[.]=.
@mishak87
mishak87 / string_bytes.php
Created February 3, 2015 11:05
Misc PHP snippets
echo "{"; for ($i = 0; $i < strlen($x); $i++) { echo dechex(ord($x[$i])), ", "; } echo "}";
@mishak87
mishak87 / basic-setup.sh
Last active August 29, 2015 14:14
Git tool scripts
#!/bin/bash
# Safest push default behaviour
git config --global push.default simple
# Reseting permissions (file mode) http://stackoverflow.com/a/4408378/1765978
git config --global --add alias.permission-reset '!git diff -p -R | grep -E "^(diff|(old|new) mode)" | git apply'
git permission-reset
# Global .gitignore file in home directory
git config --global core.excludesfile '~/.gitignore'
cd /usr/share/ca-certificates
mkdir gandi.net
cd gandi.net
wget http://crt.gandi.net/GandiStandardSSLCA.crt
openssl x509 -inform der -outform pem < /usr/share/ca-certificates/gandi.net/GandiStandardSSLCA.crt > GandiStandardSSLCA.pem
ln -s /usr/share/ca-certificates/gandi.net/GandiStandardSSLCA.pem /etc/ssl/certs/GandiStandardSSLCA.pem
/server add -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode irc.freenode.net 6697
@mishak87
mishak87 / .deploy.yaml
Created November 25, 2014 18:05
KISS definition of
# simple file for app deployment to single node
# host and namespace can be overriden by CLI parameters
# - it can be used to spread setup accross multiple servers that can't be in fleet.
host: # globally
namespace: customer01
enable:
- redis
services:
@mishak87
mishak87 / set-strict-permissions.sh
Created November 20, 2014 13:28
Nette strict permissions script
#!/bin/bash
ROOT=$(pwd)
USER=nette
WEB_SERVER_GROUP=www-data
# create cache
if [ ! -d "$ROOT/temp/cache" ]; then
mkdir -p "$ROOT/temp/cache"
fi
# journal
@mishak87
mishak87 / DbalBatchFile.php
Created June 18, 2014 22:43
With <3 for Hosiplan
<?php
namespace Kdyby\Doctrine\Console;
use Kdyby;
use Kdyby\Doctrine\BatchImportException;
use Kdyby\Doctrine\Helpers;
use Rixxi;
use Symfony;
@mishak87
mishak87 / deploy.sh
Last active August 29, 2015 14:02
Simple deploy script for demo/sandbox server - supports changed file
#!/bin/bash
echo "Deploy launched."
# fetch new version
git fetch origin
# check for changes
CHANGES=$(git status -s)
<?php
namespace App;
use Nette;
class ProviderCollector extends Nette\Object
{