The Modern Developer Toolbox 
Photo by https://www.flickr.com/photos/zergev/ 
Pablo Godel @pgodel 
https://joined.in/11798
Hi, I am Pablo.
Hi, I am Pablo. 
! 
@pgodel
The Modern Developer Toolbox 
Modern?
The Modern Developer Toolbox 
[root@prod] # vi index.php
The Modern Developer Toolbox 
Never stop ! 
improving
The Modern Developer Toolbox 
The Toolbox
The Modern Developer Toolbox 
Development environment
The Modern Developer Toolbox 
Development environment 
! 
Testing
The Modern Developer Toolbox 
Development environment 
! 
Testing 
! 
Debugging
The Modern Developer Toolbox 
Development environment 
! 
Testing 
! 
Debugging 
! 
Profiling
The Modern Developer Toolbox 
Development environment 
! 
Testing 
! 
Debugging 
! 
Profiling 
! 
Deployment
The Modern Developer Toolbox 
Development environment 
! 
Testing 
! 
Debugging 
! 
Profiling 
! 
Deployment 
! 
Logging
The Modern Developer Toolbox 
Development environment 
! 
Testing 
! 
Debugging 
! 
Profiling 
! 
Deployment 
! 
Logging 
! 
Monitoring
The Modern Developer Toolbox 
Development Environment
Development Environment 
Everything starts with a 
great development environment
Development Environment 
Choosing an OS
The Development Modern Developer Environment 
Toolbox 
Rule #1
The Development Modern Developer Environment 
Toolbox 
Rule #1: Stay close to Production
The Development Modern Developer Environment 
Toolbox 
Rule #2
The Development Modern Developer Environment 
Toolbox 
Rule #2: Ditch Windows
The Development Modern Developer Environment 
Toolbox 
Rule #3
The Development Modern Developer Environment 
Toolbox 
Rule #3: Don’t forget Rule #2
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox
The Development Modern Developer Environment 
Toolbox 
Automate your setup
The Development Modern Developer Environment 
Toolbox 
Automate your setup 
! 
#1 Store your dot-files in Git/GitHub
The Development Modern Developer Environment 
Toolbox 
Dot files 
.profile / .bash_profile / .bashrc 
.gitconfig 
.gitignores 
.ssh/config 
https://github.com/pgodel/dotfiles 
https://github.com/everzet/dotfiles
The Development Modern Developer Environment 
Toolbox 
Automate your setup 
! 
#2 Automate your software installation
The Development Modern Developer Environment 
Toolbox 
Homebrew! 
! 
• hhvm 
• wget 
• git 
• tmux 
• ssh-copy-id 
• brew-cask 
• ansible
The Modern Developer Toolbox 
Even .dmg’s! 
! 
$ brew cask install … 
! 
Development Environment 
• google-chrome 
• vagrant 
• virtualbox 
• iterm2 
• alfred 
• phpstorm 
! 
https://github.com/caskroom/homebrew-cask
The Development Modern Developer Environment 
Toolbox 
Installing PHP 
Run Linux natively / locally 
! 
• REMI repo for CentOS 
• PPAs for Ubuntu / Debian
The Development Modern Developer Environment 
Toolbox 
Installing PHP 
Run Linux on VPS / remote 
! 
• REMI repo for CentOS 
• PPAs for Ubuntu / Debian
The Development Modern Developer Environment 
Toolbox 
Installing PHP 
Mac OSX 
! 
• MAMP 
• Liip PHP installer
The Development Modern Developer Environment 
Toolbox 
Installing PHP 
Virtual Machine 
• VirtualBox / Parallels / VMware 
• Vagrant 
• Docker
The Development Modern Developer Environment 
Toolbox 
PHARS! 
! 
• Composer 
• PHPUnit 
• behat 
• WP-CLI 
• versionscan
The Development Modern Developer Environment 
Toolbox 
Vagrant! 
! 
• PuPHPet 
• Phansible
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Vagrant 
Host 
Vagrant 
VM VM VM 
Web 
DB 
Server 
Server 
App 
Server
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Docker 
Host 
Docker client 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Docker 
Host 
Docker client 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Docker 
Host 
Docker client 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Docker 
Host 
Docker client 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server 
Host 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server
ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox 
Docker 
Host 
Docker client 
C 
VM 
Web 
Server 
C C 
DB 
Server 
App 
Server 
Host 
C 
VM 
Web 
Server 
Host 
C C 
DB 
Server 
C C 
App 
Server 
C 
Web 
Server 
DB 
Server 
App 
Server 
Docker 
Kernel
The Development Modern Developer Environment 
Toolbox 
$ ansible-playbook -i inventories/dev  
playbook.yml -v -K 
https://github.com/pgodel/ansible-local-dev
The Development Modern Developer Environment 
Toolbox 
Use the right Editor/IDE for you
The Development Modern Developer Environment 
Toolbox 
Choose the right Editor/IDE for you! 
! 
• PHPStorm 
• Zend Studio 
• TextMate 
• Vim
The Development Modern Developer Environment 
Toolbox 
Choose the right Editor/IDE for you! 
! 
• PHPStorm! 
• Zend Studio 
• TextMate 
• Vim
The Development Modern Developer Environment 
Toolbox 
Choose the right Editor/IDE for you! 
! 
• PHPStorm! 
• Fast 
• Syntax highlighting with PHP 5.6 
• Git diffs and other actions 
• Breakpoints 
• and much more! 
! 
!
Development Environment 
Setting up SSH 
$ ssh-keygen -t dsa 
~/.ssh/id_dsa.pub 
! 
$ ssh-copy-id user@remote-host 
~/.ssh/authorized_keys 
~/.ssh/authorized_keys2 
! 
$ ssh-add
Development Environment 
Setting up SSH 
~/.ssh/config 
Host * 
ForwardAgent yes 
Port 22123 
! 
Host gh 
HostName github.com 
Port 22 
PreferredAuthentications publickey 
IdentityFile ~/.ssh/me_rsa
Development Environment 
Virtual Document Root 
UseCanonicalName Off 
! 
VirtualDocumentRoot /var/www/vhosts/%0/web 
! 
<Location /var/www/vhosts> 
AllowOverride All 
Options +FollowSymLinks 
</Location> 
example.com => /var/www/vhosts/example.com/web 
example2.com => /var/www/vhosts/example2.com/web
The Modern Developer Toolbox 
Testing
Testing 
! 
! 
• Unit testing with PHPUnit
Testing 
! 
! 
• Unit testing with PHPUnit 
• BDD with Behat
Testing 
! 
! 
• Unit testing with PHPUnit 
• BDD with Behat 
• Git hooks + php -l
Testing 
! 
! 
• Unit testing with PHPUnit 
• BDD with Behat 
• Git hooks + php -l 
• Jenkins
Testing 
! 
! 
• Unit testing with PHPUnit 
• BDD with Behat 
• Git hooks + php -l 
• Jenkins 
• Travis CI 
!
Testing 
! 
! 
• Unit testing with PHPUnit 
• BDD with Behat 
• Git hooks + php -l 
• Jenkins 
• Travis CI 
• JoliCI
! 
! 
Testing 
• phpmd / PHP Depend 
• PhpMetrics 
• SensioLabs Insight 
• Scrutinizer
The Modern Developer Toolbox 
Debugging
Debugging 
print_r($data);
LadyBug 
<?php 
$var = array( 
array( 
Debugging 
'name' => 'Raul', 
'age' => 29 
), 
array( 
'name' => 'John', 
'age' => 27 
) 
); 
! 
ladybug_dump($var)
LadyBug 
Debugging
Debugging 
XDebug + PHPStorm
The Development Modern Developer Environment 
Toolbox 
Debug CLI commands with PHPStorm 
! 
PRO TIP 
$ export  
XDEBUG_CONFIG=“idekey=PHPSTORM"
Debugging 
Symfony Developer Toolbar
Debugging 
Zend Studio + Zend Server + Z-Ray
The Modern Developer Toolbox 
Profiling
Profiling 
! 
! 
XDebug
Profiling 
! 
! 
XHProf + XHProf.io
Profiling 
! 
Commercial options 
! 
• Zend Server 
• SensioLabs Profiler (coming soon)
The Modern Developer Toolbox 
Deployment
Deployment 
• Capistrano (Ruby) / Capifony 
• Fabric (Python) 
• Idephix (PHP) 
• Magellanes (PHP) 
• Deployer (PHP) 
• Laravel / envoy (PHP) 
• Rocketeer (PHP) 
• Ansible (YAML)
Deployment 
Common steps
Deployment 
! 
! 
• Define hosts
Deployment 
! 
! 
• Define hosts 
• Define tasks / actions
Deployment 
! 
! 
• Define hosts 
• Define tasks / actions 
• Run process
Deployment 
! 
! 
• Define hosts 
• Define tasks / actions 
• Run process 
• Safe operation
Deployment 
! 
! 
• Define hosts 
• Define tasks / actions 
• Run process 
• Safe operation 
• Migrations
Deployment 
! 
! 
• Define hosts 
• Define tasks / actions 
• Run process 
• Safe operation 
• Migrations 
• Rollbacks
Deployment 
Deploying with
Deployment with Ansible 
! 
! 
Define hosts 
[webservers] 
foo.example.com 
bar.example.com 
www[01:50].example.com 
! 
[dbservers] 
one.example.com 
two.example.com 
three.example.com
Deployment with Ansible 
! 
! 
Define tasks / actions 
--- 
- hosts: webservers 
vars: 
http_port: 80 
max_clients: 200 
remote_user: root 
tasks: 
- name: ensure apache is at the latest version 
yum: pkg=httpd state=latest 
- name: write the apache config file 
template: src=/srv/httpd.j2 dest=/etc/httpd.conf 
notify: 
- restart apache 
- name: ensure apache is running
Deployment with Ansible ! 
! 
Define tasks / actions 
- hosts: webservers 
roles: 
- { 
role: servergrove.symfony2, 
symfony2_project_root: /var/www/vhosts/ 
example.com/, 
symfony2_project_name: demo, 
symfony2_project_branch: master , 
symfony2_project_release: 1 
}
Deployment with Ansible 
! 
! 
Run process 
$ ansible-playbook -i inventories/servers  
playbook.yml -v
Deployment with Ansible 
! 
! 
Run process
Deployment 
Effing Package Management 
Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity. 
fpm -s dir -t rpm -n "webapp" -v 1.0 /var/www/webapp 
! 
fpm -s dir -t deb -a all -n webapp -v 1.0 /etc/apache2/ 
conf.d/my.conf /var/www/webapp 
https://github.com/jordansissel/fpm
The Modern Developer Toolbox 
Logging
Logging 
tail -f /var/log/*
Logging 
tail -f /var/log/* | grep “Fatal error”
Logging 
Logstash + ElasticSearch + Kibana 
App / Logstash 
App / Logstash App / Logstash 
Redis Logstash 
filter/processor 
ElasticSearch Kibana
Monolog 
Logging 
use MonologLogger; 
use MonologHandlerStreamHandler; 
! 
// create a log channel 
$log = new Logger('name'); 
$log->pushHandler(new StreamHandler('path/to/your.log', 
Logger::WARNING)); 
! 
// add records to the log 
$log->addWarning('Foo'); 
$log->addError('Bar');
Logging 
Monolog 
! 
• Rotates logs 
• Syslog / AMQP 
• Email / Chat servers 
• Redis / MongoDB / ElasticSearch 
• NullHandler 
• FingersCrossedHandler
Logstash 
Logging 
input { 
file { 
path => “/var/log/apache2/access_log” 
} 
} 
output { 
elasticsearch { 
host => localhost 
} 
}
Kibana 
Logging
The Modern Developer Toolbox 
Monitoring
Monitoring 
Measure everything!
Monitoring 
StatsD + Graphite + Grafana 
App 
App App 
StatsD Graphite 
Grafana
Monitoring 
StatsD + liuggio/statsd-php-client 
$ composer require liuggio/statsd-php-client:dev-master
Monitoring 
StatsD + liuggio/statsd-php-client 
$sender = new SocketSender(/*'localhost', 8126, 'udp'*/); 
! 
$client = new StatsdClient($sender); 
$factory = new StatsdDataFactory('LiuggioStatsdClientEntityStatsdData'); 
! 
// create the data with the factory 
$data[] = $factory->timing('usageTime', 100); 
$data[] = $factory->increment('visitor'); 
$data[] = $factory->decrement('click'); 
$data[] = $factory->gauge('gaugor', 333); 
$data[] = $factory->set('uniques', 765); 
! 
// send the data as array or directly as object 
$client->send($data);
Monitoring 
StatsD + liuggio/statsd-php-client 
$data[] = $factory->timing('usageTime', 100);! 
! 
// send the data as array or directly as object 
$client->send($data);
Monitoring 
StatsD + liuggio/statsd-php-client 
$data[] = $factory->increment('visitor');! 
! 
// send the data as array or directly as object 
$client->send($data);
Monitoring 
StatsD + liuggio/statsd-php-client 
$data[] = $factory->decrement('click');! 
! 
// send the data as array or directly as object 
$client->send($data);
Monitoring 
StatsD + liuggio/statsd-php-client 
$data[] = $factory->gauge('gaugor', 333);! 
! 
// send the data as array or directly as object 
$client->send($data);
Graphite 
Monitoring
Graphite 
Monitoring
Grafana 
Monitoring
Monitoring 
Apache Requests 
<Location /server-status> 
SetHandler server-status 
Order deny,allow 
Deny from all 
Allow from .your_domain.com 
</Location> 
! 
ExtendedStatus On
Monitoring 
Apache Requests
Monitoring 
CPU / Memory / IO 
top
Monitoring 
IO 
iotop
The Modern Developer Toolbox 
https://www.flickr.com/photos/jaquiza
The Modern Developer Toolbox 
Questions!
The Modern Developer Toolbox 
! 
! 
! 
Thank you! ! 
Rate me please! 
! 
! 
https://joind.in/11798 
http://slideshare.net/pgodel 
@pgodel

The Modern Developer Toolbox

  • 1.
    The Modern DeveloperToolbox Photo by https://www.flickr.com/photos/zergev/ Pablo Godel @pgodel https://joined.in/11798
  • 2.
    Hi, I amPablo.
  • 3.
    Hi, I amPablo. ! @pgodel
  • 5.
    The Modern DeveloperToolbox Modern?
  • 7.
    The Modern DeveloperToolbox [root@prod] # vi index.php
  • 8.
    The Modern DeveloperToolbox Never stop ! improving
  • 9.
    The Modern DeveloperToolbox The Toolbox
  • 10.
    The Modern DeveloperToolbox Development environment
  • 11.
    The Modern DeveloperToolbox Development environment ! Testing
  • 12.
    The Modern DeveloperToolbox Development environment ! Testing ! Debugging
  • 13.
    The Modern DeveloperToolbox Development environment ! Testing ! Debugging ! Profiling
  • 14.
    The Modern DeveloperToolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment
  • 15.
    The Modern DeveloperToolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment ! Logging
  • 16.
    The Modern DeveloperToolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment ! Logging ! Monitoring
  • 17.
    The Modern DeveloperToolbox Development Environment
  • 18.
    Development Environment Everythingstarts with a great development environment
  • 19.
  • 20.
    The Development ModernDeveloper Environment Toolbox Rule #1
  • 21.
    The Development ModernDeveloper Environment Toolbox Rule #1: Stay close to Production
  • 22.
    The Development ModernDeveloper Environment Toolbox Rule #2
  • 23.
    The Development ModernDeveloper Environment Toolbox Rule #2: Ditch Windows
  • 24.
    The Development ModernDeveloper Environment Toolbox Rule #3
  • 25.
    The Development ModernDeveloper Environment Toolbox Rule #3: Don’t forget Rule #2
  • 26.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox
  • 27.
    The Development ModernDeveloper Environment Toolbox Automate your setup
  • 28.
    The Development ModernDeveloper Environment Toolbox Automate your setup ! #1 Store your dot-files in Git/GitHub
  • 29.
    The Development ModernDeveloper Environment Toolbox Dot files .profile / .bash_profile / .bashrc .gitconfig .gitignores .ssh/config https://github.com/pgodel/dotfiles https://github.com/everzet/dotfiles
  • 30.
    The Development ModernDeveloper Environment Toolbox Automate your setup ! #2 Automate your software installation
  • 31.
    The Development ModernDeveloper Environment Toolbox Homebrew! ! • hhvm • wget • git • tmux • ssh-copy-id • brew-cask • ansible
  • 32.
    The Modern DeveloperToolbox Even .dmg’s! ! $ brew cask install … ! Development Environment • google-chrome • vagrant • virtualbox • iterm2 • alfred • phpstorm ! https://github.com/caskroom/homebrew-cask
  • 33.
    The Development ModernDeveloper Environment Toolbox Installing PHP Run Linux natively / locally ! • REMI repo for CentOS • PPAs for Ubuntu / Debian
  • 34.
    The Development ModernDeveloper Environment Toolbox Installing PHP Run Linux on VPS / remote ! • REMI repo for CentOS • PPAs for Ubuntu / Debian
  • 35.
    The Development ModernDeveloper Environment Toolbox Installing PHP Mac OSX ! • MAMP • Liip PHP installer
  • 36.
    The Development ModernDeveloper Environment Toolbox Installing PHP Virtual Machine • VirtualBox / Parallels / VMware • Vagrant • Docker
  • 37.
    The Development ModernDeveloper Environment Toolbox PHARS! ! • Composer • PHPUnit • behat • WP-CLI • versionscan
  • 38.
    The Development ModernDeveloper Environment Toolbox Vagrant! ! • PuPHPet • Phansible
  • 39.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Vagrant Host Vagrant VM VM VM Web DB Server Server App Server
  • 40.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 41.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 42.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 43.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server Host C VM Web Server C C DB Server App Server
  • 44.
    ThDe eMvoeldoeprmn eDnetvEenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server Host C VM Web Server Host C C DB Server C C App Server C Web Server DB Server App Server Docker Kernel
  • 45.
    The Development ModernDeveloper Environment Toolbox $ ansible-playbook -i inventories/dev playbook.yml -v -K https://github.com/pgodel/ansible-local-dev
  • 46.
    The Development ModernDeveloper Environment Toolbox Use the right Editor/IDE for you
  • 47.
    The Development ModernDeveloper Environment Toolbox Choose the right Editor/IDE for you! ! • PHPStorm • Zend Studio • TextMate • Vim
  • 48.
    The Development ModernDeveloper Environment Toolbox Choose the right Editor/IDE for you! ! • PHPStorm! • Zend Studio • TextMate • Vim
  • 49.
    The Development ModernDeveloper Environment Toolbox Choose the right Editor/IDE for you! ! • PHPStorm! • Fast • Syntax highlighting with PHP 5.6 • Git diffs and other actions • Breakpoints • and much more! ! !
  • 50.
    Development Environment Settingup SSH $ ssh-keygen -t dsa ~/.ssh/id_dsa.pub ! $ ssh-copy-id user@remote-host ~/.ssh/authorized_keys ~/.ssh/authorized_keys2 ! $ ssh-add
  • 51.
    Development Environment Settingup SSH ~/.ssh/config Host * ForwardAgent yes Port 22123 ! Host gh HostName github.com Port 22 PreferredAuthentications publickey IdentityFile ~/.ssh/me_rsa
  • 52.
    Development Environment VirtualDocument Root UseCanonicalName Off ! VirtualDocumentRoot /var/www/vhosts/%0/web ! <Location /var/www/vhosts> AllowOverride All Options +FollowSymLinks </Location> example.com => /var/www/vhosts/example.com/web example2.com => /var/www/vhosts/example2.com/web
  • 53.
    The Modern DeveloperToolbox Testing
  • 54.
    Testing ! ! • Unit testing with PHPUnit
  • 55.
    Testing ! ! • Unit testing with PHPUnit • BDD with Behat
  • 56.
    Testing ! ! • Unit testing with PHPUnit • BDD with Behat • Git hooks + php -l
  • 57.
    Testing ! ! • Unit testing with PHPUnit • BDD with Behat • Git hooks + php -l • Jenkins
  • 58.
    Testing ! ! • Unit testing with PHPUnit • BDD with Behat • Git hooks + php -l • Jenkins • Travis CI !
  • 59.
    Testing ! ! • Unit testing with PHPUnit • BDD with Behat • Git hooks + php -l • Jenkins • Travis CI • JoliCI
  • 60.
    ! ! Testing • phpmd / PHP Depend • PhpMetrics • SensioLabs Insight • Scrutinizer
  • 61.
    The Modern DeveloperToolbox Debugging
  • 62.
  • 63.
    LadyBug <?php $var= array( array( Debugging 'name' => 'Raul', 'age' => 29 ), array( 'name' => 'John', 'age' => 27 ) ); ! ladybug_dump($var)
  • 64.
  • 65.
  • 66.
    The Development ModernDeveloper Environment Toolbox Debug CLI commands with PHPStorm ! PRO TIP $ export XDEBUG_CONFIG=“idekey=PHPSTORM"
  • 67.
  • 68.
    Debugging Zend Studio+ Zend Server + Z-Ray
  • 69.
    The Modern DeveloperToolbox Profiling
  • 70.
  • 71.
    Profiling ! ! XHProf + XHProf.io
  • 72.
    Profiling ! Commercialoptions ! • Zend Server • SensioLabs Profiler (coming soon)
  • 73.
    The Modern DeveloperToolbox Deployment
  • 74.
    Deployment • Capistrano(Ruby) / Capifony • Fabric (Python) • Idephix (PHP) • Magellanes (PHP) • Deployer (PHP) • Laravel / envoy (PHP) • Rocketeer (PHP) • Ansible (YAML)
  • 75.
  • 76.
    Deployment ! ! • Define hosts
  • 77.
    Deployment ! ! • Define hosts • Define tasks / actions
  • 78.
    Deployment ! ! • Define hosts • Define tasks / actions • Run process
  • 79.
    Deployment ! ! • Define hosts • Define tasks / actions • Run process • Safe operation
  • 80.
    Deployment ! ! • Define hosts • Define tasks / actions • Run process • Safe operation • Migrations
  • 81.
    Deployment ! ! • Define hosts • Define tasks / actions • Run process • Safe operation • Migrations • Rollbacks
  • 82.
  • 83.
    Deployment with Ansible ! ! Define hosts [webservers] foo.example.com bar.example.com www[01:50].example.com ! [dbservers] one.example.com two.example.com three.example.com
  • 84.
    Deployment with Ansible ! ! Define tasks / actions --- - hosts: webservers vars: http_port: 80 max_clients: 200 remote_user: root tasks: - name: ensure apache is at the latest version yum: pkg=httpd state=latest - name: write the apache config file template: src=/srv/httpd.j2 dest=/etc/httpd.conf notify: - restart apache - name: ensure apache is running
  • 85.
    Deployment with Ansible! ! Define tasks / actions - hosts: webservers roles: - { role: servergrove.symfony2, symfony2_project_root: /var/www/vhosts/ example.com/, symfony2_project_name: demo, symfony2_project_branch: master , symfony2_project_release: 1 }
  • 86.
    Deployment with Ansible ! ! Run process $ ansible-playbook -i inventories/servers playbook.yml -v
  • 87.
    Deployment with Ansible ! ! Run process
  • 88.
    Deployment Effing PackageManagement Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity. fpm -s dir -t rpm -n "webapp" -v 1.0 /var/www/webapp ! fpm -s dir -t deb -a all -n webapp -v 1.0 /etc/apache2/ conf.d/my.conf /var/www/webapp https://github.com/jordansissel/fpm
  • 89.
    The Modern DeveloperToolbox Logging
  • 90.
    Logging tail -f/var/log/*
  • 91.
    Logging tail -f/var/log/* | grep “Fatal error”
  • 92.
    Logging Logstash +ElasticSearch + Kibana App / Logstash App / Logstash App / Logstash Redis Logstash filter/processor ElasticSearch Kibana
  • 93.
    Monolog Logging useMonologLogger; use MonologHandlerStreamHandler; ! // create a log channel $log = new Logger('name'); $log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); ! // add records to the log $log->addWarning('Foo'); $log->addError('Bar');
  • 94.
    Logging Monolog ! • Rotates logs • Syslog / AMQP • Email / Chat servers • Redis / MongoDB / ElasticSearch • NullHandler • FingersCrossedHandler
  • 95.
    Logstash Logging input{ file { path => “/var/log/apache2/access_log” } } output { elasticsearch { host => localhost } }
  • 96.
  • 97.
    The Modern DeveloperToolbox Monitoring
  • 98.
  • 99.
    Monitoring StatsD +Graphite + Grafana App App App StatsD Graphite Grafana
  • 100.
    Monitoring StatsD +liuggio/statsd-php-client $ composer require liuggio/statsd-php-client:dev-master
  • 101.
    Monitoring StatsD +liuggio/statsd-php-client $sender = new SocketSender(/*'localhost', 8126, 'udp'*/); ! $client = new StatsdClient($sender); $factory = new StatsdDataFactory('LiuggioStatsdClientEntityStatsdData'); ! // create the data with the factory $data[] = $factory->timing('usageTime', 100); $data[] = $factory->increment('visitor'); $data[] = $factory->decrement('click'); $data[] = $factory->gauge('gaugor', 333); $data[] = $factory->set('uniques', 765); ! // send the data as array or directly as object $client->send($data);
  • 102.
    Monitoring StatsD +liuggio/statsd-php-client $data[] = $factory->timing('usageTime', 100);! ! // send the data as array or directly as object $client->send($data);
  • 103.
    Monitoring StatsD +liuggio/statsd-php-client $data[] = $factory->increment('visitor');! ! // send the data as array or directly as object $client->send($data);
  • 104.
    Monitoring StatsD +liuggio/statsd-php-client $data[] = $factory->decrement('click');! ! // send the data as array or directly as object $client->send($data);
  • 105.
    Monitoring StatsD +liuggio/statsd-php-client $data[] = $factory->gauge('gaugor', 333);! ! // send the data as array or directly as object $client->send($data);
  • 106.
  • 107.
  • 108.
  • 109.
    Monitoring Apache Requests <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .your_domain.com </Location> ! ExtendedStatus On
  • 110.
  • 111.
    Monitoring CPU /Memory / IO top
  • 112.
  • 113.
    The Modern DeveloperToolbox https://www.flickr.com/photos/jaquiza
  • 114.
    The Modern DeveloperToolbox Questions!
  • 115.
    The Modern DeveloperToolbox ! ! ! Thank you! ! Rate me please! ! ! https://joind.in/11798 http://slideshare.net/pgodel @pgodel