tmux presentation for code school

G
Full Stack tmux
with Tony Narlock
for use with Fullstack Academy
We all use different tools
• Some use an full fledge IDE like Visual Studio and rarely touch the
command line (even do version control via UI)
• Some people use Atom / Visual Studio Code and iTerm2
• Some people use gedit and Gnome Terminal
• Some incorporate tmux purely for SSH (debugging cloud services
on AWS, DigitalOcean, Rackspace)
• Some people, use tmux in a way that power of an IDE
• Number one rule: use what helps you ship! You don’t have to use it.
But today, you’ll know what its for
What this course covers
• Rehash of terminal facilities
• What tmux is and what its comprised of (internals)
• How we see the internals of stuff like tmux (event
systems)
• Usage
• Breeze through the topics discussed at length in The
Tao of tmux book (leanpub.com/the-tao-of-tmux/read)
About me
• Open source programmer (wake early to check Bugzilla / GH issues / help on
irc, get to work at 9-10AM. Do more at night, some during the day)
• Google Summer of Code 2008 student, 2009 mentor
• Worked at a Y Combinator company (Boostable W14), an acquihire (Social
Amp -> Merkle) at NYU Poly Incubator, Varick Street
• Done a lot of node.js in production, as well as Python, Ruby and PHP
• Done a ton of front end with ES5, jQuery, Backbone.js, Knockout
• Open minded, into technical excellence
• Above all: love collaborating and working on teams with people of all
experience levels
Some notes about the terminal
• All operating systems have a default shell (Bash on MacOS on many linux distros, tcsh on
FreeBSD)
• Shells also have a scripting dialect, with the basic functionality overlapping with POSIX shell
scripting. So they look similar, but their are incompatibilities in there!
• Shell frameworks. e.g. oh-my-zsh, presto
• Oddities exist due to word of mouth and viral behavior:
• For instance, Zsh gained popularity thanks to oh-my-zsh which adds a lot of cozy
features. Normal Zsh is about is boring as being dropped in a plain shell without
customization
• Many people just say “Bash scripting”, when sometimes they mean any shell scripting
• “Shell” could refer to scripting, the full terminal application and the PTY within it, the
PTY, the PTY in conjunction with the shell (Zsh, Bash). You have to read into the context.
What’s that status line in my coworkers
terminal? How can I try tmux?
• Right, top image: no tmux
• Right, bottom image: inside tmux
• To get in, use package manager
to install the ‘tmux’ package. e.g.
• brew install tmux
• sudo apt-get install tmux
A terminal using tmux will have a status line at the bottom
Why do people use it? It does
two things really well.
• Tabs and pane splitting (like in GUI terminals)
• Advantage: no gui needed for tmux, can be
used via SSH and plain TTY’s
• Spawning a lite background daemon to keep
workflow running (similar to fg(1))
• Advantage: detaching and reattaching
sessions
From the top down
Server
• Automatically forked to
background when starting
tmux the first time
• Allows detaching and
reattaching the tmux
session
• No configuration required
• Holds sessions
Sessions
• Sessions hold windows
• Organize individual
projects
• Are launched automatically
on initialization
• Can be detached and
reattached
Windows
• Hold a collection of
panes (PTY’s)
• Common setups: Vim,
Gulp / Grunt watchers,
SSH sessions,
deployment via fabric,
heroku, elastic
beanstalk, git
Panes (PTY's)
• A terminal within a
terminal
• PTY holding Zsh, Bash, etc.
• Vim/emacs/nano/pico
• File watching / linters /
gulp / grunt / dev servers
(./manage.py runserver)
Inside tmux (advanced stuff)
• tmux is built upon libevent, a library which
abstracts system events via callbacks
• allows tmux to keep the users PTY processes
daemon-ized
• This event system also is used in Chromium
(Google Chrome). Node.js uses a similar
system, libuv.
Command Pattern
• tmux abstracts out behavior into a system of commands
• Patterns like these are often given examples of in OOP,
but they can exist in C as well.
• Due to the lack of OOP patterns, helper macros are used
to create lists of objects (BSD’s queue.h is vendor’d in)
• tmux separates all behavior into cmd, via both data
structures and files (cmd_*.c)
• they are declared in the source as cmd_entry.
Portability
• Since tmux is written in C, it must use compatibility
measures to work across POSIX-like systems (Unlike languages like
node.js, which provide standard libraries that already did the work of abstracting subtle
differences in OS)
• tmux uses autotools to check for compiler features, scan for
headers (.h files) signature definitions for libraries as well as
the built .so libs themselves, so tmux can link against them
• The process of using build systems like autotools assures
any user can clone the codebase and build on any system
which have the libraries themselves
Be thankful to be in JS, Python
and Ruby
• It abstracts out a lot of the banality of C
• Unlike JS and Python, it’s harder to say who’s an expert
C/C++ programmer. (Do you go by who writes the
popular books on “best practices”, e.g. Herb Sutter,
Scott Meyers, software actually ships e.g. Nicholas
Marriott, John Carmack?)
• Learning more about C is a great extracurricular
because we learn more about how like Node (C++),
Python (C), and Ruby (C) is brought to us.
What we covered
• A peek at tmux via its objects (the server,
sessions, windows and panes) and some of its
internals (events, compatibility, patterns).
• Go back to coding and pick the tools you can ship
with!
• Check out my section of The Tao of tmux where I
cover Terminal Fundamentals for a more detailed
overview of the responsibilities of the shell.
1 of 17

Recommended

ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
25.3K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
6K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
6.5K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.2K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.4K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides

More Related Content

Recently uploaded

Marketing and Community Building in Web3 by
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3Federico Ast
14 views64 slides
The Dark Web : Hidden Services by
The Dark Web : Hidden ServicesThe Dark Web : Hidden Services
The Dark Web : Hidden ServicesAnshu Singh
14 views24 slides
hamro digital logics.pptx by
hamro digital logics.pptxhamro digital logics.pptx
hamro digital logics.pptxtupeshghimire
10 views36 slides
Affiliate Marketing by
Affiliate MarketingAffiliate Marketing
Affiliate MarketingNavin Dhanuka
17 views30 slides
ATPMOUSE_융합2조.pptx by
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptxkts120898
35 views70 slides
How to think like a threat actor for Kubernetes.pptx by
How to think like a threat actor for Kubernetes.pptxHow to think like a threat actor for Kubernetes.pptx
How to think like a threat actor for Kubernetes.pptxLibbySchulze1
5 views33 slides

Recently uploaded(6)

Marketing and Community Building in Web3 by Federico Ast
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3
Federico Ast14 views
The Dark Web : Hidden Services by Anshu Singh
The Dark Web : Hidden ServicesThe Dark Web : Hidden Services
The Dark Web : Hidden Services
Anshu Singh14 views
ATPMOUSE_융합2조.pptx by kts120898
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptx
kts12089835 views
How to think like a threat actor for Kubernetes.pptx by LibbySchulze1
How to think like a threat actor for Kubernetes.pptxHow to think like a threat actor for Kubernetes.pptx
How to think like a threat actor for Kubernetes.pptx
LibbySchulze15 views

Featured

Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
55.5K views138 slides
12 Ways to Increase Your Influence at Work by
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
401.7K views64 slides
ChatGPT webinar slides by
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slidesAlireza Esmikhani
30.4K views36 slides
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
3.6K views12 slides
Barbie - Brand Strategy Presentation by
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
25.1K views46 slides

Featured(20)

Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -... by AccuraCast
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast3.4K views
Exploring ChatGPT for Effective Teaching and Learning.pptx by Stan Skrabut, Ed.D.
Exploring ChatGPT for Effective Teaching and Learning.pptxExploring ChatGPT for Effective Teaching and Learning.pptx
Exploring ChatGPT for Effective Teaching and Learning.pptx
Stan Skrabut, Ed.D.57.7K views
How to train your robot (with Deep Reinforcement Learning) by Lucas García, PhD
How to train your robot (with Deep Reinforcement Learning)How to train your robot (with Deep Reinforcement Learning)
How to train your robot (with Deep Reinforcement Learning)
Lucas García, PhD42.5K views
4 Strategies to Renew Your Career Passion by Daniel Goleman
4 Strategies to Renew Your Career Passion4 Strategies to Renew Your Career Passion
4 Strategies to Renew Your Career Passion
Daniel Goleman122K views
The Student's Guide to LinkedIn by LinkedIn
The Student's Guide to LinkedInThe Student's Guide to LinkedIn
The Student's Guide to LinkedIn
LinkedIn88K views
Different Roles in Machine Learning Career by Intellipaat
Different Roles in Machine Learning CareerDifferent Roles in Machine Learning Career
Different Roles in Machine Learning Career
Intellipaat12.4K views
Defining a Tech Project Vision in Eight Quick Steps pdf by TechSoup
Defining a Tech Project Vision in Eight Quick Steps pdfDefining a Tech Project Vision in Eight Quick Steps pdf
Defining a Tech Project Vision in Eight Quick Steps pdf
TechSoup 9.7K views

tmux presentation for code school

  • 1. Full Stack tmux with Tony Narlock for use with Fullstack Academy
  • 2. We all use different tools • Some use an full fledge IDE like Visual Studio and rarely touch the command line (even do version control via UI) • Some people use Atom / Visual Studio Code and iTerm2 • Some people use gedit and Gnome Terminal • Some incorporate tmux purely for SSH (debugging cloud services on AWS, DigitalOcean, Rackspace) • Some people, use tmux in a way that power of an IDE • Number one rule: use what helps you ship! You don’t have to use it. But today, you’ll know what its for
  • 3. What this course covers • Rehash of terminal facilities • What tmux is and what its comprised of (internals) • How we see the internals of stuff like tmux (event systems) • Usage • Breeze through the topics discussed at length in The Tao of tmux book (leanpub.com/the-tao-of-tmux/read)
  • 4. About me • Open source programmer (wake early to check Bugzilla / GH issues / help on irc, get to work at 9-10AM. Do more at night, some during the day) • Google Summer of Code 2008 student, 2009 mentor • Worked at a Y Combinator company (Boostable W14), an acquihire (Social Amp -> Merkle) at NYU Poly Incubator, Varick Street • Done a lot of node.js in production, as well as Python, Ruby and PHP • Done a ton of front end with ES5, jQuery, Backbone.js, Knockout • Open minded, into technical excellence • Above all: love collaborating and working on teams with people of all experience levels
  • 5. Some notes about the terminal • All operating systems have a default shell (Bash on MacOS on many linux distros, tcsh on FreeBSD) • Shells also have a scripting dialect, with the basic functionality overlapping with POSIX shell scripting. So they look similar, but their are incompatibilities in there! • Shell frameworks. e.g. oh-my-zsh, presto • Oddities exist due to word of mouth and viral behavior: • For instance, Zsh gained popularity thanks to oh-my-zsh which adds a lot of cozy features. Normal Zsh is about is boring as being dropped in a plain shell without customization • Many people just say “Bash scripting”, when sometimes they mean any shell scripting • “Shell” could refer to scripting, the full terminal application and the PTY within it, the PTY, the PTY in conjunction with the shell (Zsh, Bash). You have to read into the context.
  • 6. What’s that status line in my coworkers terminal? How can I try tmux? • Right, top image: no tmux • Right, bottom image: inside tmux • To get in, use package manager to install the ‘tmux’ package. e.g. • brew install tmux • sudo apt-get install tmux A terminal using tmux will have a status line at the bottom
  • 7. Why do people use it? It does two things really well. • Tabs and pane splitting (like in GUI terminals) • Advantage: no gui needed for tmux, can be used via SSH and plain TTY’s • Spawning a lite background daemon to keep workflow running (similar to fg(1)) • Advantage: detaching and reattaching sessions
  • 9. Server • Automatically forked to background when starting tmux the first time • Allows detaching and reattaching the tmux session • No configuration required • Holds sessions
  • 10. Sessions • Sessions hold windows • Organize individual projects • Are launched automatically on initialization • Can be detached and reattached
  • 11. Windows • Hold a collection of panes (PTY’s) • Common setups: Vim, Gulp / Grunt watchers, SSH sessions, deployment via fabric, heroku, elastic beanstalk, git
  • 12. Panes (PTY's) • A terminal within a terminal • PTY holding Zsh, Bash, etc. • Vim/emacs/nano/pico • File watching / linters / gulp / grunt / dev servers (./manage.py runserver)
  • 13. Inside tmux (advanced stuff) • tmux is built upon libevent, a library which abstracts system events via callbacks • allows tmux to keep the users PTY processes daemon-ized • This event system also is used in Chromium (Google Chrome). Node.js uses a similar system, libuv.
  • 14. Command Pattern • tmux abstracts out behavior into a system of commands • Patterns like these are often given examples of in OOP, but they can exist in C as well. • Due to the lack of OOP patterns, helper macros are used to create lists of objects (BSD’s queue.h is vendor’d in) • tmux separates all behavior into cmd, via both data structures and files (cmd_*.c) • they are declared in the source as cmd_entry.
  • 15. Portability • Since tmux is written in C, it must use compatibility measures to work across POSIX-like systems (Unlike languages like node.js, which provide standard libraries that already did the work of abstracting subtle differences in OS) • tmux uses autotools to check for compiler features, scan for headers (.h files) signature definitions for libraries as well as the built .so libs themselves, so tmux can link against them • The process of using build systems like autotools assures any user can clone the codebase and build on any system which have the libraries themselves
  • 16. Be thankful to be in JS, Python and Ruby • It abstracts out a lot of the banality of C • Unlike JS and Python, it’s harder to say who’s an expert C/C++ programmer. (Do you go by who writes the popular books on “best practices”, e.g. Herb Sutter, Scott Meyers, software actually ships e.g. Nicholas Marriott, John Carmack?) • Learning more about C is a great extracurricular because we learn more about how like Node (C++), Python (C), and Ruby (C) is brought to us.
  • 17. What we covered • A peek at tmux via its objects (the server, sessions, windows and panes) and some of its internals (events, compatibility, patterns). • Go back to coding and pick the tools you can ship with! • Check out my section of The Tao of tmux where I cover Terminal Fundamentals for a more detailed overview of the responsibilities of the shell.