Skip to content

Instantly share code, notes, and snippets.

View ptflp's full-sized avatar
🤟
Quality over quantity?

Petr Filippov ptflp

🤟
Quality over quantity?
View GitHub Profile
@ptflp
ptflp / boot.sh
Created February 5, 2018 23:13
preparing CMD for entry point
#!/bin/bash
if [ -d "$1" ]; then
if [ -L "$1" ]; then
echo "ITS A SYMLINK"
else
# It's a directory!
# Directory command goes here.
echo "Directory exists"
fi
else
@ptflp
ptflp / README.md
Created January 23, 2018 17:35
workflow

Release management (GitFlow branches)

  • master - We consider master to be the main branch where the source code of HEAD always reflects a production-ready state.
  • develop - This branch always reflects a state with the latest delivered development changes for the next release.
  • features/<feature> - Start developing new features by creating a new branch based on develop. Once your feature is completed merge your feature back to develop (you have to create merge-request to the develop branch, and do NOT remove the source branch).
  • release/<version> - After all features for the release are in develop branch, you can create a release branch using version. Our version string will strictly follow PEP-440 standard and we could associate. version string format sample:
Version Sample
@ptflp
ptflp / .htaccess
Created March 14, 2018 06:54
Yii2 advanced app htaccess for frontend and backend
# use mode rewrite for pretty URL support
RewriteEngine on
# if a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . index.php
@ptflp
ptflp / yii2-user.sh
Last active March 15, 2018 07:35
migration for dektrium/yii2-user
#!/bin/bash
read -p "Type ip/host MySQL database: " -r
export hostdb=$REPLY;
read -p "Type MySQL database name: " -r
export dbname=$REPLY;
read -p "Type user of MySQL database: " -r
export userdb=$REPLY;
read -p "Type password of MySQL database: " -r
export passdb=$REPLY;
composer create-project --prefer-dist yiisoft/yii2-app-advanced web
@ptflp
ptflp / initdb
Last active March 15, 2018 21:17
install yii2 for ptflp/yii2 dockerized Yii2-application
#!/usr/bin/env php
<?php
if (defined('STDIN')) {
$hostdb = $argv[1];
$dbname = $argv[2];
$userdb = $argv[3];
$passdb = $argv[4];
}
$servername = $hostdb;
$username = $userdb;
@ptflp
ptflp / config.inc.php
Created June 8, 2018 06:11
phpmyadmin autologin autorization configuration
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
@ptflp
ptflp / docker.ps1
Last active June 19, 2018 12:40
Yii2 gulp 4 file reference
docker-compose up -d
@ptflp
ptflp / gulpfile.js
Last active June 20, 2018 01:02
Gulp 4 installation
var
gulp = require("gulp"),
browserSync = require('browser-sync').create(),
childProcess = require('child_process');
gulp.task('docker-start', function (callback) {
console.log("---------Start--------------------------");
return childProcess.exec('Powershell.exe -executionpolicy remotesigned -File docker.ps1', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
@ptflp
ptflp / HyperV-switch-VirtualBox.ps1
Last active July 1, 2018 15:17
Set easy switching between Hyper-V and Virtualbox at startup. Run from powershell once, if you run multiple times, go to msconfig and delete excess entry.
param([switch]$Elevated)
function Check-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Check-Admin) -eq $false) {
if ($elevated)
{
# could not elevate, quit
}
@ptflp
ptflp / 1.txt
Created July 1, 2018 15:42
python bcdedit parser
идентификатор {bootmgr}
device partition=\Device\HarddiskVolume8
path \EFI\Microsoft\Boot\bootmgfw.efi
description Windows Boot Manager
locale ru-RU
inherit {globalsettings}
default {current}
resumeobject {123123421}
displayorder {current}
{214214421}