This file contains hidden or 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
=== Install Gearman === | |
sudo add-apt-repository -y ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get -y install php7.0 php7.0-fpm php-gearman | |
sudo touch /var/log/gearmand.log | |
sudo chmod 0666 /var/log/gearmand.log | |
gearmand -d |
This file contains hidden or 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
=== ElasticSearch === | |
Install DEB package from: https://www.elastic.co/downloads/elasticsearch | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb | |
dpkg -i https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get -y install oracle-java8-installer | |
java -version |
This file contains hidden or 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
=== Install === | |
=== Prepare Docker === | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
41 stable" | |
sudo apt-get install docker-ce |
This file contains hidden or 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
=== Java install === | |
java zookeeper-3.4.10.jar | |
sudo apt-add-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer | |
sudo apt install oracle-java8-set-default | |
export JAVA_HOME=/usr/lib/jvm/java-8-oracle | |
sudo update-alternatives --config java | |
sudo update-alternatives --config javac |
This file contains hidden or 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
$message = \Swift_Message::newInstance() | |
->setSubject('Hello Email') | |
->setFrom('[email protected]') | |
->setTo('[email protected]') | |
->setBody('You should see me from the profiler!') | |
; | |
$this->get('mailer')->send($message); |
This file contains hidden or 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
# Install Redis | |
sudo apt-get install redis-server | |
sudo apt-get install php-redis | |
sudo nano /etc/redis/redis.conf | |
Edit: | |
maxmemory 128mb |
This file contains hidden or 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
API PLATFORM | |
https://api-platform.com | |
https://github.com/api-platform/api-platform | |
### Install ### | |
composer create-project api-platform/api-platform bookshop-api | |
bin/console doctrine:database:create | |
bin/console server:run |
This file contains hidden or 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 | |
declare(strict_types=1); | |
namespace AppBundle\Entity; | |
use ApiPlatform\Core\Annotation\ApiProperty; | |
use ApiPlatform\Core\Annotation\ApiResource; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; |
This file contains hidden or 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
Ref: https://github.com/lexik/LexikJWTAuthenticationBundle | |
composer require lexik/jwt-authentication-bundle | |
Register in AppKernel: | |
public function registerBundles() | |
{ | |
return array( | |
// ... |
This file contains hidden or 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 | |
$serv=stream_socket_server("tcp://0.0.0.0:8000",$errno,$errstr) or die("create server failed"); | |
$base = event_base_new(); | |
$event = event_new(); | |
function read_cb($socket, $flag, $base) { | |
fread($socket); | |
fwrite("hello world\n"); | |
} |