SlideShare a Scribd company logo
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
The Modern Developer Toolbox 
Modern?
The Modern Developer Toolbox
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

More Related Content

PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PDF
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PDF
Deploying Symfony | symfony.cat
PDF
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
PDF
Development with Ansible & VMs
PDF
Code reviews vs Pull requests
PDF
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
Deploying Symfony | symfony.cat
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Development with Ansible & VMs
Code reviews vs Pull requests
Bootstrapping Puppet and Application Deployment - PuppetConf 2013

What's hot (20)

PPTX
PHP & JavaScript & CSS Coding style
PDF
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
PDF
Django dev-env-my-way
ODP
ATDD with Behat and Selenium (LDNSE6)
PDF
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
PDF
Open Source Tools for Leveling Up Operations FOSSET 2014
PDF
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
KEY
Perlbrew
PDF
Zero Downtime Deployment with Ansible
PDF
Towards Continuous Deployment with Django
KEY
Practical introduction to dev ops with chef
PDF
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
PDF
How to integrate front end tool via gruntjs
PDF
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
PDF
Gearman work queue in php
PDF
Building a Drupal site with Git
PDF
Zero Downtime Deployment with Ansible
PPTX
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
PPTX
DevOps Hackathon - Session 1: Vagrant
PDF
Building a private CI/CD pipeline with Java and Docker in the cloud as presen...
PHP & JavaScript & CSS Coding style
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Django dev-env-my-way
ATDD with Behat and Selenium (LDNSE6)
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Open Source Tools for Leveling Up Operations FOSSET 2014
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Perlbrew
Zero Downtime Deployment with Ansible
Towards Continuous Deployment with Django
Practical introduction to dev ops with chef
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
How to integrate front end tool via gruntjs
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Gearman work queue in php
Building a Drupal site with Git
Zero Downtime Deployment with Ansible
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
DevOps Hackathon - Session 1: Vagrant
Building a private CI/CD pipeline with Java and Docker in the cloud as presen...
Ad

Viewers also liked (20)

PPTX
Marama 3
PDF
Musicas cifradas bossa nova samba 01
PDF
Media Platforms Emerge: 2004 onward - The rise of Embeddability
PPT
1960s shortened
PPTX
Ingless
PPTX
God Is Holy
PDF
Threat intelligence at the cloud
PDF
Hack In The Box (Dubai) 04172008
PPTX
Mapas conceptuales de solci thieroldt ♥
PPTX
PPSX
Neo-noir: The Dark Side of Creative Writing
PDF
Zombies, Run! Transforming Fitness, Games & Story
PDF
Blue ocean strategy 3
PPTX
Train a Social Workforce: How AT&T Trained Thousands of Employee Advocates
PDF
Are you listening to your data? Chris Stanley Virtusa
PDF
Verilog-HDL Tutorial (6)
PPT
Work wants to be social (talk at Web 2 Expo 2010)
PPTX
Outline of How to Publish a Book
PPTX
QUEST/SmarterMeasure Learning Readiness Indicator Lunch & Learn Webinar Series
PDF
How we calculated the $ value of candidate experience and transformed the per...
Marama 3
Musicas cifradas bossa nova samba 01
Media Platforms Emerge: 2004 onward - The rise of Embeddability
1960s shortened
Ingless
God Is Holy
Threat intelligence at the cloud
Hack In The Box (Dubai) 04172008
Mapas conceptuales de solci thieroldt ♥
Neo-noir: The Dark Side of Creative Writing
Zombies, Run! Transforming Fitness, Games & Story
Blue ocean strategy 3
Train a Social Workforce: How AT&T Trained Thousands of Employee Advocates
Are you listening to your data? Chris Stanley Virtusa
Verilog-HDL Tutorial (6)
Work wants to be social (talk at Web 2 Expo 2010)
Outline of How to Publish a Book
QUEST/SmarterMeasure Learning Readiness Indicator Lunch & Learn Webinar Series
How we calculated the $ value of candidate experience and transformed the per...
Ad

Similar to The Modern Developer Toolbox (20)

PPTX
Learn you some Ansible for great good!
PDF
Evolution of deploy.sh
PDF
PHP Development Tools
PDF
Automated Deployment and Configuration Engines. Ansible
PDF
Modern web dev_taxonomy
PDF
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
PDF
Build & deploy PHP application (intro level)
PDF
infra-as-code
PDF
Puppet for Sys Admins
PDF
DevOps Bootcamp course resource (1)-1-99.pdf
PPTX
Warden @ Meet magento Romania 2021
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
Modernize Your Drupal Development
PDF
From Dev to DevOps
PPTX
Devops
PDF
Instant LAMP Stack with Vagrant and Puppet
PDF
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
KEY
From Dev to DevOps - ApacheCON NA 2011
PDF
Deploying PHP Applications with Ansible
Learn you some Ansible for great good!
Evolution of deploy.sh
PHP Development Tools
Automated Deployment and Configuration Engines. Ansible
Modern web dev_taxonomy
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
Build & deploy PHP application (intro level)
infra-as-code
Puppet for Sys Admins
DevOps Bootcamp course resource (1)-1-99.pdf
Warden @ Meet magento Romania 2021
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Modernize Your Drupal Development
From Dev to DevOps
Devops
Instant LAMP Stack with Vagrant and Puppet
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
From Dev to DevOps - ApacheCON NA 2011
Deploying PHP Applications with Ansible

More from Pablo Godel (20)

PDF
SymfonyCon Cluj 2017 - Symfony at OpenSky
PDF
Symfony Live San Francisco 2017 - Symfony @ OpenSky
PDF
DeSymfony 2017 - Symfony en OpenSky
PDF
La Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
PDF
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
PDF
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
PDF
Lone Star PHP 2013 - Sysadmin Skills for PHP Developers
PDF
Lone StarPHP 2013 - Building Web Apps from a New Angle
PDF
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
PDF
Creating Mobile Apps With PHP & Symfony2
PDF
Tek13 - Creating Mobile Apps with PHP and Symfony
PDF
Tek 2013 - Building Web Apps from a New Angle with AngularJS
PDF
Soflophp 2013 - SysAdmin skills for PHP developers
PDF
Symfony2 and MongoDB - MidwestPHP 2013
PDF
Rock Solid Deployment of Web Applications
PDF
Codeworks'12 Rock Solid Deployment of PHP Apps
PDF
PFCongres 2012 - Rock Solid Deployment of PHP Apps
PDF
Symfony2 y MongoDB - deSymfony 2012
PDF
Declare independence from your it department sysadmin skills for symfony dev...
PDF
Symfony2 and MongoDB
SymfonyCon Cluj 2017 - Symfony at OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSky
DeSymfony 2017 - Symfony en OpenSky
La Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
Lone Star PHP 2013 - Sysadmin Skills for PHP Developers
Lone StarPHP 2013 - Building Web Apps from a New Angle
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
Creating Mobile Apps With PHP & Symfony2
Tek13 - Creating Mobile Apps with PHP and Symfony
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Soflophp 2013 - SysAdmin skills for PHP developers
Symfony2 and MongoDB - MidwestPHP 2013
Rock Solid Deployment of Web Applications
Codeworks'12 Rock Solid Deployment of PHP Apps
PFCongres 2012 - Rock Solid Deployment of PHP Apps
Symfony2 y MongoDB - deSymfony 2012
Declare independence from your it department sysadmin skills for symfony dev...
Symfony2 and MongoDB

Recently uploaded (20)

PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
Digital Literacy And Online Safety on internet
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
DOCX
Unit-3 cyber security network security of internet system
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
innovation process that make everything different.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Funds Management Learning Material for Beg
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
artificial intelligence overview of it and more
Slides PDF The World Game (s) Eco Economic Epochs.pdf
QR Codes Qr codecodecodecodecocodedecodecode
Unit-1 introduction to cyber security discuss about how to secure a system
SAP Ariba Sourcing PPT for learning material
Digital Literacy And Online Safety on internet
Triggering QUIC, presented by Geoff Huston at IETF 123
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Decoding a Decade: 10 Years of Applied CTI Discipline
Unit-3 cyber security network security of internet system
SASE Traffic Flow - ZTNA Connector-1.pdf
RPKI Status Update, presented by Makito Lay at IDNOG 10
innovation process that make everything different.pptx
The Internet -By the Numbers, Sri Lanka Edition
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
international classification of diseases ICD-10 review PPT.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Funds Management Learning Material for Beg
PptxGenJS_Demo_Chart_20250317130215833.pptx
artificial intelligence overview of it and more

The Modern Developer Toolbox

  • 1. The Modern Developer Toolbox Photo by https://www.flickr.com/photos/zergev/ Pablo Godel @pgodel https://joined.in/11798
  • 2. Hi, I am Pablo.
  • 3. Hi, I am Pablo. ! @pgodel
  • 5. The Modern Developer Toolbox Modern?
  • 7. The Modern Developer Toolbox [root@prod] # vi index.php
  • 8. The Modern Developer Toolbox Never stop ! improving
  • 9. The Modern Developer Toolbox The Toolbox
  • 10. The Modern Developer Toolbox Development environment
  • 11. The Modern Developer Toolbox Development environment ! Testing
  • 12. The Modern Developer Toolbox Development environment ! Testing ! Debugging
  • 13. The Modern Developer Toolbox Development environment ! Testing ! Debugging ! Profiling
  • 14. The Modern Developer Toolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment
  • 15. The Modern Developer Toolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment ! Logging
  • 16. The Modern Developer Toolbox Development environment ! Testing ! Debugging ! Profiling ! Deployment ! Logging ! Monitoring
  • 17. The Modern Developer Toolbox Development Environment
  • 18. Development Environment Everything starts with a great development environment
  • 20. The Development Modern Developer Environment Toolbox Rule #1
  • 21. The Development Modern Developer Environment Toolbox Rule #1: Stay close to Production
  • 22. The Development Modern Developer Environment Toolbox Rule #2
  • 23. The Development Modern Developer Environment Toolbox Rule #2: Ditch Windows
  • 24. The Development Modern Developer Environment Toolbox Rule #3
  • 25. The Development Modern Developer Environment Toolbox Rule #3: Don’t forget Rule #2
  • 26. ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox
  • 27. The Development Modern Developer Environment Toolbox Automate your setup
  • 28. The Development Modern Developer Environment Toolbox Automate your setup ! #1 Store your dot-files in Git/GitHub
  • 29. 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
  • 30. The Development Modern Developer Environment Toolbox Automate your setup ! #2 Automate your software installation
  • 31. The Development Modern Developer Environment Toolbox Homebrew! ! • hhvm • wget • git • tmux • ssh-copy-id • brew-cask • ansible
  • 32. 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
  • 33. The Development Modern Developer Environment Toolbox Installing PHP Run Linux natively / locally ! • REMI repo for CentOS • PPAs for Ubuntu / Debian
  • 34. The Development Modern Developer Environment Toolbox Installing PHP Run Linux on VPS / remote ! • REMI repo for CentOS • PPAs for Ubuntu / Debian
  • 35. The Development Modern Developer Environment Toolbox Installing PHP Mac OSX ! • MAMP • Liip PHP installer
  • 36. The Development Modern Developer Environment Toolbox Installing PHP Virtual Machine • VirtualBox / Parallels / VMware • Vagrant • Docker
  • 37. The Development Modern Developer Environment Toolbox PHARS! ! • Composer • PHPUnit • behat • WP-CLI • versionscan
  • 38. The Development Modern Developer Environment Toolbox Vagrant! ! • PuPHPet • Phansible
  • 39. ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox Vagrant Host Vagrant VM VM VM Web DB Server Server App Server
  • 40. ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 41. ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 42. ThDe eMvoeldoeprmn eDnetv Eenlovpireorn Tmooelnbtox Docker Host Docker client C VM Web Server C C DB Server App Server
  • 43. 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
  • 44. 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
  • 45. The Development Modern Developer Environment Toolbox $ ansible-playbook -i inventories/dev playbook.yml -v -K https://github.com/pgodel/ansible-local-dev
  • 46. The Development Modern Developer Environment Toolbox Use the right Editor/IDE for you
  • 47. The Development Modern Developer Environment Toolbox Choose the right Editor/IDE for you! ! • PHPStorm • Zend Studio • TextMate • Vim
  • 48. The Development Modern Developer Environment Toolbox Choose the right Editor/IDE for you! ! • PHPStorm! • Zend Studio • TextMate • Vim
  • 49. 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! ! !
  • 50. 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
  • 51. 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
  • 52. 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
  • 53. The Modern Developer Toolbox 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 Developer Toolbox Debugging
  • 63. LadyBug <?php $var = array( array( Debugging 'name' => 'Raul', 'age' => 29 ), array( 'name' => 'John', 'age' => 27 ) ); ! ladybug_dump($var)
  • 65. Debugging XDebug + PHPStorm
  • 66. The Development Modern Developer Environment Toolbox Debug CLI commands with PHPStorm ! PRO TIP $ export XDEBUG_CONFIG=“idekey=PHPSTORM"
  • 68. Debugging Zend Studio + Zend Server + Z-Ray
  • 69. The Modern Developer Toolbox Profiling
  • 70. Profiling ! ! XDebug
  • 71. Profiling ! ! XHProf + XHProf.io
  • 72. Profiling ! Commercial options ! • Zend Server • SensioLabs Profiler (coming soon)
  • 73. The Modern Developer Toolbox Deployment
  • 74. Deployment • Capistrano (Ruby) / Capifony • Fabric (Python) • Idephix (PHP) • Magellanes (PHP) • Deployer (PHP) • Laravel / envoy (PHP) • Rocketeer (PHP) • Ansible (YAML)
  • 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
  • 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 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
  • 89. The Modern Developer Toolbox 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 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');
  • 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 } }
  • 97. The Modern Developer Toolbox Monitoring
  • 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);
  • 109. Monitoring Apache Requests <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .your_domain.com </Location> ! ExtendedStatus On
  • 111. Monitoring CPU / Memory / IO top
  • 113. The Modern Developer Toolbox https://www.flickr.com/photos/jaquiza
  • 114. The Modern Developer Toolbox Questions!
  • 115. The Modern Developer Toolbox ! ! ! Thank you! ! Rate me please! ! ! https://joind.in/11798 http://slideshare.net/pgodel @pgodel