Skip to content

Instantly share code, notes, and snippets.

View TheRatG's full-sized avatar
🐭
be balanced

Vladimir Pak TheRatG

🐭
be balanced
View GitHub Profile
@TheRatG
TheRatG / prepare_prod.markdown
Last active January 24, 2023 05:08
Prepare platform

bash

Add into begining of file ~/.bashrc

[ -d ~/bin ] && PATH=~/bin:$PATH

mysql

A mysql and a mysqldump without user:passwod

@TheRatG
TheRatG / git tricks
Last active October 24, 2022 06:00
Чтобы git работал на нашей виртуозе
git config --global http.sslVerify false
```
#~/.gitconfig
[alias]
co = checkout
br = branch
ci = commit
st = status
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
@TheRatG
TheRatG / mailhog.sh
Created October 24, 2022 05:55
mailhog sevice
#! /bin/sh
# /etc/init.d/mailhog
### BEGIN INIT INFO
# Provides: mailhog
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start MailHog at boot time.
# Description: Enable MailHog.
@TheRatG
TheRatG / dev_mysql.md
Created August 12, 2021 06:00
Dev mysql

Mysqld config

/etc/mysql/mysql.conf.d/mysqld.cnf

skip_log_bin = 1

innodb_buffer_pool_size = 6G
innodb_log_buffer_size = 1G
innodb_log_file_size = 2G
@TheRatG
TheRatG / mailhog.sh
Created April 30, 2021 06:18
Ubuntu18 /etc/init.d/mailhog
#! /bin/sh
# /etc/init.d/mailhog
### BEGIN INIT INFO
# Provides: mailhog
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start MailHog at boot time.
# Description: Enable MailHog.
@TheRatG
TheRatG / TestTidierListener.php
Created August 25, 2020 08:08
Faster PHPUnit
<?php
declare(strict_types=1);
namespace Tests\Core;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@TheRatG
TheRatG / cors.nginx.md
Last active August 3, 2020 13:13
How to enable Cross-Origin Requests (CORS) on nginx

Open nginx CORS configuration

Wide open nginx CORS configuration CORS is a W3C working standard that currently has decent (but inconsistent) implementions in Firefox, Chrome and Safari. I use it primarily to test PhoneGap apps in regular browsers instead of testing the code in simulators. PhoneGap apps can skip the usual origin checks via configuration, but running a PhoneGap app takes more setup - which make it harder for designers to work with the app. Running apps in simulators or on actual devices also takes al lot more time that just reloading a browser and this annoys me.

Read up on CORS

#https://www.vagrantup.com/docs/synced-folders/nfs.html
```
$enable_serial_logging = false
config.vm.provider "virtualbox" do |v|
v.customize [
"storagectl", :id,
"--name", "SATA Controller",
"--hostiocache", "on"
]
@TheRatG
TheRatG / copy.php
Created February 2, 2016 09:50
symfony copy dir
$fileSystem = new Filesystem();
$fileSystem->mkdir($target);
$directoryIterator = new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new \RecursiveIteratorIterator($directoryIterator, \RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $item) {
if ($item->isDir()) {
$targetDir = $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
$fileSystem->mkdir($targetDir);
} else {
@TheRatG
TheRatG / mod_proxy
Last active September 19, 2018 18:13
mod_proxy
http://www.hackersgarage.com/install-mod_proxy-apache-module-on-whmcpanel-ceentos-linux-server.html
Installation :
Check Apache current version :
/usr/local/apache/bin/httpd -v
Output :
Server version: Apache/2.2.19 (Unix)