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
[user] | |
name = ton_nom | |
email = [email protected] | |
[color] | |
ui = true | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
[alias] |
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
Symfony 2.5 changed the way validation files were loaded. Here is how to do it now (using the Finder component to dynamically load): | |
Create a compiler pass: | |
namespace MyBundle\DependencyInjection\Compiler; | |
use Symfony\Component\Finder\Finder; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; |
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 | |
use Doctrine\ORM\Event\LoadClassMetadataEventArgs; | |
use Pim\Bundle\ApiBundle\Entity\AuthCode; | |
class AuthCodeMappingListener | |
{ | |
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) | |
{ | |
$classMetadata = $eventArgs->getClassMetadata(); |
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
Using cURL | |
curl -XDELETE localhost:9200/index/type/documentID | |
e.g. | |
curl -XDELETE localhost:9200/shop/product/1 | |
You will then receive a reply as to whether this was successful or not. You can delete an entire index or types with an index also, you can delete a type by leaving out the document ID like so - |
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
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) |
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
sudo ln -s "$(which nodejs)" /usr/local/bin/node |
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
Alias /phpmyadmin/ "/usr/share/phpmyadmin/" | |
<Directory /usr/share/phpmyadmin/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> |
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
sed -i 's/bind-address.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf && sudo service mysql restart | |
UPDATE mysql.user SET Host='%' WHERE Host='localhost' AND User='username'; | |
FLUSH PRIVILEGES; |
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
mysqldump -u root -p database > dump.sql | |
scp -P 22 root@host:dump.sql ./ | |
pv sqlfile.sql | mysql -uxxx -pxxxx dbname |
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
sudo -i | |
/etc/init.d/mysql stop | |
mysqld_safe --skip-grant-tables & | |
mysql -u root mysql | |
update user set password=PASSWORD("mdp") where User='root'; | |
flush privileges; | |
exit; | |
killall mysqld | |
/etc/init.d/mysql start |
NewerOlder