This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To increase temporary (during the current session): | |
sudo sysctl -w kern.sysv.shmmax=12582912 | |
sudo sysctl -w kern.sysv.shmall=12582912 | |
To enable it forever: | |
sudo vim /etc/sysctl.conf | |
kern.sysv.shmall=12582912 | |
kern.sysv.shmmax=12582912 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldPath="vendor/example" | |
git config -f .git/config --remove-section "submodule.${oldPath}" | |
git config -f .gitmodules --remove-section "submodule.${oldPath}" | |
git rm --cached "${oldPath}" | |
rm -rf "${oldPath}" ## remove src (optional) | |
rm -rf ".git/modules/${oldPath}" ## cleanup gitdir (optional housekeeping) | |
git add .gitmodules | |
git commit -m "Removed ${oldPath}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Paste this in your .vimrc file | |
" Use w!! when you've forgotten to open your file as root | |
cmap w!! w !sudo tee % >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PHP_IDE_CONFIG=serverName=mywebsite.lan | |
php -dxdebug.remote_host=192.168.33.1 app/console ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable OPCache | |
zend_extension=/path/to/lib/php/extensions/no-debug-non-zts-20121212/opcache.so | |
# OPCache settings | |
opcache.memory_consumption=128 | |
opcache.interned_strings_buffer=8 | |
opcache.max_accelerated_files=4000 | |
opcache.revalidate_freq=60 | |
opcache.fast_shutdown=1 | |
opcache.enable_cli=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Your\Bundle\Listener; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class LocaleListener implements EventSubscriberInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo\BarBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
class ArticleController extends Controller | |
{ | |
public function editAction(Article article) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "SELECT table_schema, round(sum(data_length+index_length)/1024/1024,4) AS \"Size (MB)\" FROM information_schema.tables GROUP BY table_schema;" | mysql -u root --password=XXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm /dev/null && mknod -m 666 /dev/null c 1 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -Haurov {USER}@{IP}:{REMOTE_PATH} {LOCAL_PATH} |