Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@schmunk42
schmunk42 / giiant
Created February 10, 2015 19:49
Generating extensions via CLI with Gii
./yii gii/extension \
--vendorName=dmstr \
--packageName=yii2-application-info \
--namespace=dmstr\\modules\\backend\\ \
--license=BSD-3-Clause \
--title="Extended application information for Yii 2.0 Framework" \
--description="Provides in-depth configuration and application information" \
--authorName="Tobias Munk" \
--authorEmail=tobias@diemeisterei.de
@schmunk42
schmunk42 / Vagrantfile
Created February 28, 2015 01:08
Vagrantfile for a dockerhost
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.synced_folder "./", "/vagrant", type: "rsync"
# Access docker container via private_network interface
# Port mapping to this IP can be defined in the Vagrantfile of the container
config.vm.network "private_network", ip: "192.168.3.3", netmask: "255.255.255.0"
@schmunk42
schmunk42 / docker-ps
Created March 6, 2015 01:21
docker ps with scaling
Kraftbuch:~ tobias$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
147224c0610c mariadb:latest "/docker-entrypoint. 2 minutes ago Up 2 minutes 3306/tcp playground_db_1
c5895d1f7938 redis:latest "/entrypoint.sh redi 2 minutes ago Up 2 minutes 6379/tcp playground_redis_1
2202a4c7ede8 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49184->80/tcp playground_prodweb_9
151240a93e87 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49183->80/tcp playground_prodweb_8
951048fa14ab 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49182->80/tcp playground_prodweb_7
@schmunk42
schmunk42 / assets-prod.php
Created March 9, 2015 10:49
Phundament Playground Production Assets
<?php
/**
* This file is generated by the "yii asset" command.
* DO NOT MODIFY THIS FILE DIRECTLY.
* @version 2015-03-06 06:45:46
*/
return [
'frontend' => [
'class' => 'yii\\web\\AssetBundle',
'basePath' => '@app/web/assets-prod',
@schmunk42
schmunk42 / Dockermake
Created March 12, 2015 10:53
Dockermake
.PHONY: all build default release
default: build
all: build
build: yii2 phundament
yii2:
docker build -t schmunk42/php-yii2:cli stacks/yii2/stack/php-cli
@schmunk42
schmunk42 / log.txt
Created March 13, 2015 10:49
docker rm 1001
Kraftbuch:mcgx tobias$ docker rm $(docker ps -a -q)
9833821027bd
ff098a725b81
0ca05b140136
34eb1776e6e3
676a48cf98f5
30176b7c6e2b
2817510f7a94
9c495938a7d7
37ff7618abc4
@schmunk42
schmunk42 / gist:bb6dafcd4636c827102e
Created April 7, 2015 13:50
Vagrant Virtualbox VM error with iSCSI
Apr 7 13:09:43 internal kernel: [263974.304858] e1000 0000:00:03.0 eth0: Detected Tx Unit Hang
Apr 7 13:09:43 internal kernel: [263974.304858] Tx Queue <0>
Apr 7 13:09:43 internal kernel: [263974.304858] TDH <60>
Apr 7 13:09:43 internal kernel: [263974.304858] TDT <62>
Apr 7 13:09:43 internal kernel: [263974.304858] next_to_use <62>
Apr 7 13:09:43 internal kernel: [263974.304858] next_to_clean <60>
Apr 7 13:09:43 internal kernel: [263974.304858] buffer_info[next_to_clean]
Apr 7 13:09:43 internal kernel: [263974.304858] time_stamp <103edd2a1>
Apr 7 13:09:43 internal kernel: [263974.304858] next_to_watch <61>
Apr 7 13:09:43 internal kernel: [263974.304858] jiffies <103edd671>
@schmunk42
schmunk42 / docker-compose.yml
Created April 12, 2015 15:04
Registry Stack
registry:
image: registry:0.9.1
ports:
- '5000:5000'
volumes:
- '/NAS/registry:/registry'
environment:
###VIRTUAL_HOST: registry.example.com
SETTINGS_FLAVOR: local
STORAGE_PATH: /registry
@schmunk42
schmunk42 / giiant.php
Last active August 29, 2015 14:22 — forked from cornernote/README.md
<?php
use cornernote\giitools\helpers\TabPadding;
use yii\helpers\VarDumper;
\Yii::$container->set('\app\gii\giiant\crud\providers\DateTimeProvider', [
'columnNames' => ['scheduled_at','type', 'status'],
]);
\Yii::$container->set('\app\gii\giiant\crud\providers\RelationProvider', [
@schmunk42
schmunk42 / snip.php
Created June 2, 2015 14:57
Partially hide password-string (keep hint)
<?php
if (YII_DEBUG) {
$passwordDisplay = substr($root_password,0,2).str_repeat("*",max(0,strlen($root_password)-4)).substr($root_password,-2,2);
} else {
$passwordDisplay = '**HIDDEN**';
}
$this->stdout("Creating database '{$db}' and granting permissions to user '{$user}' on DSN '{$dsn}' with user '{$root}/{$passwordDisplay}'");