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 / .htaccess
Created January 23, 2018 10:06
Yii2 advanced .htaccess configuration
Options -Indexes
Options FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/admin/$
RewriteRule ^(admin)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/admin
@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 / README.md
Last active December 13, 2022 10:52
docker tun device into container

Docker tun device into container install openvpn or other soft, which uses tun devices

@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 / docker-install.sh
Last active September 9, 2022 13:03
docker automate installation sh
#!/bin/bash
sudo apt-get update
sudo service docker stop
sudo apt-get remove -y docker docker-engine docker.io
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
wget
@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 / 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);