Skip to content

Instantly share code, notes, and snippets.

View mrsombre's full-sized avatar

Dmitrii Barsukov mrsombre

  • Montenegro
  • 15:34 (UTC +02:00)
View GitHub Profile
@mrsombre
mrsombre / centos
Last active March 16, 2020 00:19
CentOS VirtualBox install
=== Symlink Support in Windows
The first step is installing Polsedit - User Policies Editor. When you open it, look for Create symbolic links.
http://www.southsoftware.com/polsedit.zip
Double click the row, click Add User or Group... and look for your username in the list.
Closing the app will automatically save your choices, and you'll need to reboot your machine.
=== Updating fresh system
;; Edit /etc/yum.conf and set installonly_limit: 2
yum upgrade
reboot
@mrsombre
mrsombre / xdebug.md
Last active November 19, 2019 07:01
PHP XDebug configuration

Enable xdebug in CLI for phpstorm

export PHP_IDE_CONFIG="serverName={SERVER NAME IN PHP STORM}"
export XDEBUG_CONFIG="remote_host={YOUR_IP} idekey=PHPSTORM"
@mrsombre
mrsombre / OpCache
Created March 16, 2015 07:27
Заметки о PHP
http://jpauli.github.io/2015/03/05/opcache.html
Configuring OPCache#
If you use a framework based application, like a Symfony2 based application, I strongly suggest :
you turn off revalidation mechanism on production (turn opcache.validate_timestamps to 0)
you deploy using a full new runtime of your scripts, this is the case with Symfony2 applications
you size correctly your buffers
opcache.memory_consumption, the most important
opcache.interned_strings_buffer , monitor your usage, and size accordingly, take care if you tell OPCache to save comments, which you will likely do if you use PHP "annotations" (opcache.save_comments = 1), those are strings, big strings, that will eat your interned strings buffer
@mrsombre
mrsombre / git.md
Last active September 11, 2018 03:28
GIT cheat-sheet

For example following command adds user execute permission to an arbitrary file:

git update-index --chmod=+x <file>
git ls-files --stage
git commit -m "Set exec"
@mrsombre
mrsombre / snippets.sh
Last active March 14, 2019 04:41
Useful snippets
# MySQL config files
/usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
# composer install
curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
@mrsombre
mrsombre / _readme.md
Last active June 6, 2017 12:26
LE SSL

default domain


server {
  listen  80 default_server;

  access_log  /var/log/nginx/default__access.log  main;
  error_log   /var/log/nginx/default__error.log   error;

 client_max_body_size 512k;
@mrsombre
mrsombre / cli-speedtest.md
Last active July 31, 2017 10:47
cli-speedtest

500mb

wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip

10mb

wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip

How to start powershell in admin mode

  • Create shortcut for powershell
  • Set windows size Maximized
  • Set Advanced -> Run as administrator
  • Target line: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -ExecutionPolicy Unrestricted -Command "cd C:\WebDev"
@mrsombre
mrsombre / github.md
Created November 23, 2018 09:33
Github Contribute

Step 1

  • Fork project
  • git remote add upstream git@github.com:<project>.git

Step 2

git checkout master
git pull upstream master
git push origin master