Skip to content

Instantly share code, notes, and snippets.

View tinker1987's full-sized avatar

Dmytro Paiareli tinker1987

View GitHub Profile
<!-- Apple Touch Icons -->
<link rel="apple-touch-icon" href="/images/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/apple-touch-icon-152x152.png">
<!-- End of Apple Touch Icons -->
#!/bin/bash
PHP_V="$2";
if [ $PHP_V == "" ]; then
PHP_V=1
fi
__done(){
echo -e "Done\n";
}
#!/bin/bash
VHOSTS_CONTAINER_FILE="/etc/apache2/sites-available/vhosts.conf"
HOSTS_FILE="/etc/hosts"
CREATE_SYMLINK="N"
HOME_DIR=""
while [[ $# -gt 1 ]]
do
key="$1"
@tinker1987
tinker1987 / symfony.conf
Last active February 13, 2017 13:44
Simple nginx vhost configuration with SSL for symfony project
server {
include /etc/nginx/mime.types;
default_type application/octet-stream;
listen 80;
listen 443 ssl;
server_name {example.com};
root /var/www/{path/to/project};
client_max_body_size 64M;
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@tinker1987
tinker1987 / mysql_import_progress
Created April 6, 2017 09:54
It will show you a progress bar during the import progress based on the IO throughput.
`pv -i 1 -p -t -e /path/to/sql/dump | mysql -u USERNAME -p DATABASE_NAME`
@tinker1987
tinker1987 / tail-color.sh
Last active September 11, 2017 08:36 — forked from kartikshah/tail-color.sh
Color output of linux tail command
tail -100f var/logs/dev.log | awk '
/INFO/ {print "\033[32m" $0 "\033[39m"}
/ERROR|Exception/ {print "\033[31m" $0 "\033[39m"}
/DEBUG/ {print "\033[33m" $0 "\033[39m"}
'
@tinker1987
tinker1987 / 00_OSX_Docker_Machine_Setup.md
Created June 26, 2017 09:25 — forked from bitjockey42/00_OSX_Docker_Machine_Setup.md
Use native virtualization on OS X docker with xhyve

What this?

So one of the painful points of using docker on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker use the native OS X hypervisor to run containers.

No more dealing with virtualbox shenanigans!

In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine) so you do not have to run eval $(docker-machine env whatever) every time you open a new terminal window.

Requirements

@tinker1987
tinker1987 / FixtureAwareTestCaseTrait.php
Last active September 1, 2017 14:00
Allow to load fixtures for integration tests
<?php
declare(strict_types=1);
namespace Tests;
use Doctrine\Common\DataFixtures\{
Executor\ORMExecutor, FixtureInterface, Purger\ORMPurger, SharedFixtureInterface
};
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
@tinker1987
tinker1987 / nginx-tuning.md
Created September 26, 2017 12:21 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.