Download - Shell Revolution
![Page 1: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/1.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 1
SHELL REVOLUTION
https://joind.in/10644
![Page 2: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/2.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 2
WHO AM I?•President and Co-Founder of E-Moxie - www.emoxie.com •Baltimore, MD •PHP Developer, System Administrator, Tinkerer •Meetup Organizer - Baltimore PHP/Mobile/API •Trainer •Maximize efficiencies and make life easier (mainly mine) •I’ve seen things, and learned a bit on the way !
[email protected] Twitter : @cmstone
![Page 3: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/3.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 3
![Page 4: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/4.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 4
LOST ART
![Page 5: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/5.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 5
COULDN’T LIVE WITHOUT
ls mv cp ps
echo !
!
!
!
![Page 6: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/6.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 6
INDISPENSABLE TOOLS
Fish Screen Mosh
Vagrant
![Page 7: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/7.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 7
Fish
![Page 8: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/8.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 8
FISH“Finally, a command line shell for the 90s”
• Color • Web based Config • Auto suggest
![Page 9: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/9.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 9
SCREEN
![Page 10: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/10.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 10
SCREEN
•Terminal multiplexer •Window manager for the terminal •Has been around since the beginning of time •Ability to create additional “windows” or terminals within one terminal window and switch between them
![Page 11: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/11.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 11
QUICK START
•screen -R (Reattach a detached session if not already attached) •screen -ls (List current screen sockets and their state) •Ctrl+a D (Detach current screen session) •Ctrl+a C (Create a new window) •Ctrl+a # (Switch to window) •Ctrl+a * (List windows)
![Page 12: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/12.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 12
MOSH - The MObile SHell
![Page 13: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/13.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 13
QUICK START
•MIT Computer Science •Fairly new •Supports roaming •Intermittent Connectivity •Local Echo •SSH Replacement •Available for pretty much anything (even iOS and Android)
![Page 14: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/14.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 14
HOW DO I GET ITMac: brew install mobile-shell Linux: apt-get install mosh or yum install mosh Windows: Cygwin is experimental
![Page 15: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/15.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 15
DOWNFALLS OF MOSH
•Not installed by default in most installations •No terminal scrollback (use screen!) •Local echo
![Page 16: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/16.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 16
![Page 17: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/17.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 17
WHAT IS IT?•Awesome •Life changing •New kid on the block •The #1 tool you should have in your development arsenal •Development tool that every developer and project should be using •Manager for a virtualization provider (VirtualBox, VMWare, etc) •Automates your [development] environment (Puppet or Chef) •Support for Docker containers
![Page 18: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/18.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 18
WHY?•Gets rid of the “it works for me” •EASY and FAST •Everyone on the same page •Closely resembles a production environment •Keeps your computer clean •Low barrier to entry
![Page 19: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/19.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 19
THE HARD WAY1. Someone new joins your company or team 2. They need to get their development environment setup 3. It takes two days to one week to get up and running 4. Install an IDE 5. Install MAMP or XAMP or something else that can serve pages 6. Make sure the PHP version is the same 7. Make sure the PHP config is the same
![Page 20: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/20.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 20
THE HARD WAY1. Install additional extensions 2. Configure MAMP 3. Always tackle “it works for me” problems in the environment 4. Environment relies on the local machine. Screwed it up? Do it again. 5. Production environment got updated? Let’s make sure everyone updates to the right version, do it again. Sounds fun....
![Page 21: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/21.jpg)
![Page 22: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/22.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 22
THE EASY WAY1. Someone new joins your company or team and they need to get their development environment setup 2. Install IDE 3. Install VirtualBox 4. Install Vagrant 5. Clone git repository 6. Run ‘vagrant up’ 7. Make things
![Page 23: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/23.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 23
MY PROCESS1. New person shows 2. Install VirtualBox 3. Install Vagrant 4. Clone git repository 5. Run ‘vagrant up’ 6. Vagrant uses puppet to boostrap the system using a very similar config to production systems 7. Use IDE of choice
![Page 24: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/24.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 24
MY PROCESSZero Config for User 1. Apache is using dynamic virtual hosting 2. Local ~/development folder is mapped to /var/www in VM 3. *.dev.emoxie.com points to 192.168.1.50 4. Apache maps the * to /var/www/<*>
![Page 25: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/25.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 25
WHAT DO I NEED1. Vagrant - vagrantup.com 2. VirtualBox - virtualbox.org 3. PuPHPet - puphpet.com - GREAT Kickstarter to get you going 4. Not a PHP User? http://www.vagrantbox.es
![Page 26: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/26.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 26
PHP• Not just for the web • $argv[] • get_options()
![Page 27: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/27.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 27
PHP
<?php var_dump($argv); ?>
php script.php arg1 arg2 arg3
array(4) {! [0]=>! string(10) "script.php"! [1]=>! string(4) "arg1"! [2]=>! string(4) "arg2"! [3]=>! string(4) "arg3"!}
![Page 28: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/28.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 28
Additional Tools
![Page 29: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/29.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 29
SEDParses and transforms text !
sed 's/regexp/replacement/g' inputFile > outputFile sed 's/cat/dog/g' inputFile > outputFile
macbook:~ chris$ cat filecatmacbook:~ chris$ sed 's/cat/dog/g' file > dogmacbook:~ chris$ cat dogdog
![Page 30: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/30.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 30
AWK• Interpreted programming language used for text processing • Great for
!
• length($0) > 80
macbook:~ chris$ ps ax | grep Dropbox | awk '{print $1}'29835
![Page 31: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/31.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 31
NANO
![Page 32: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/32.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 32
ADDITIONAL RESOURCES1. edx.org - Linux Foundations - Courses Start - Aug 1 2. Local LUG 3. User Groups
![Page 33: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/33.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 33
QUESTIONS?
![Page 34: Shell Revolution](https://reader034.vdocuments.us/reader034/viewer/2022051323/549550d1ac7959092e8b4de8/html5/thumbnails/34.jpg)
Chris Stone | E-Moxie | @cmstone | php[tek] 2014 | Shell Revolution | https://joind.in/10644 34
THANKS!
Please reach out to me @cmstone or [email protected]
Please rate and give feedback!!https://joind.in/10644