SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
w w w . c r a s h u b . o r g
CRaSH
The shell for the JVM
w w w . c r a s h u b . o r g
Julien Viet
exoplatform
w w w . c r a s h u b . o r g
All semicolons characters appearing in this work
are fictitious. Any resemblance to real
characters, living or dead, is purely
coincidental.
Disclaimer
w w w . c r a s h u b . o r g
http://www.julienviet.com / @julienviet
10 years of portal development (you know
Portlets
)
Working at eXoPlatform delivering enterprise
social networks
> me --verbose
w w w . c r a s h u b . o r g
You can use @crashub or #crashub
Try it online try.crashub.org/gists/
e61cb08d93746e576209 (pro tip follow
@crashub)
About this talk
w w w . c r a s h u b . o r g
Once upon a time 

Why did I do that ? what is
CRaSH
w w w . c r a s h u b . o r g
Latest 1.2.9 / 1.3.0-cr5
Java 6+ / Groovy 1.7+
Base commands : jdbc, jmx, thread, jpa, log, etc..
Extensions: mail, cron
CRaSH
w w w . c r a s h u b . o r g
Modes
Standalone / attach (download / brew / gvm)
Embedded
Connectors
jvm (standalone & attach)
ssh, telnet
crash.js over websocket
Concepts
w w w . c r a s h u b . o r g
Standalone mode
w w w . c r a s h u b . o r g
Return "hello world"
Command script
w w w . c r a s h u b . o r g
class helloworld {
@Command
String main() {
return "Hello World"
}
}
Command class
w w w . c r a s h u b . o r g
class hello {
@Command
String world() {
return "Hello World"
}
}
Git style
w w w . c r a s h u b . o r g
Command pipelining
w w w . c r a s h u b . o r g
Write programs that do one thing and do it well.
Write programs to work together. Write
programs to handle text streams, because
that is a universal interface.
- Ken Thompson
Unix philosophy
w w w . c r a s h u b . o r g
% thread ls | thread dump | mail -s
"something you should look at"
julien@julienviet.com
Pipeline example
w w w . c r a s h u b . o r g
<Void, Thread> is a producer
<Thread, Object> is a pipe
<String, String> is a pipe
Pipeline example
w w w . c r a s h u b . o r g
class daemon {
@Command
Pipe<Thread, Thread> main() {
[provide: { 
if (it.daemon)
context.provide(it)
}] as Pipe<Thread, Thread>
}
}
Pipe command
w w w . c r a s h u b . o r g
#
log ls -f org.crsh.* | log send -m "hello"
#
system propls | filter -p NAME:java.* | sort -f
NAME
#
jmx query -p
java.lang:type=GarbageCollector,name=* | jmx
get -a Name -a CollectionCount -a
CollectionTime
Other examples
w w w . c r a s h u b . o r g
Read Eval Print Loop aka REPL
w w w . c r a s h u b . o r g
By default the script REPL parses CLI
familiar for most CLI users
Script REPL
w w w . c r a s h u b . o r g
very much like groovysh
evaluates Groovy expressions
DSL for creating CLI
compose pipes and closures
New Groovy REPL since 1.3
w w w . c r a s h u b . o r g
% (thread.ls | thread.dump | mail {
S="something you should look at”
"admin@domain.com"
})()
Our command pipeline in Groovy
w w w . c r a s h u b . o r g
More cool stuff
w w w . c r a s h u b . o r g
Completers
Renderers
Keyboard: interruption / events
Screen: streaming / styling
More cool stuff
w w w . c r a s h u b . o r g
Attach mode
w w w . c r a s h u b . o r g
Embedding CRaSH
w w w . c r a s h u b . o r g
Bootstrap: programmatic / Spring / Servlet
Designed for embedding
Lighweight : core jar about 600kb
Modular : pay for what you need
Virtual File System integration
Embedding
w w w . c r a s h u b . o r g
Ecosystem
w w w . c r a s h u b . o r g
Created in Nov 2012 by Stephan Jaetzold
Contributions by Burt Beckwith
Recently updated to CRaSH 1.3 with additional
features
Grails Plugin
w w w . c r a s h u b . o r g
And the story just begins
w w w . c r a s h u b . o r g
Multi facet, powerful and extensible tool for all of
us
Join the community
www.crashub.org
@crashub
crash-users@googlegroups.com
Wrap up
w w w . c r a s h u b . o r g
Extra slides
w w w . c r a s h u b . o r g
new UIBuilder().table {
header {
label("key")
label("value")
}
System.properties.each { k,v ->
row {
label(k).style(Color.red.fg());
label(v).style(Color.blue.fg())
}
}
}
Building more complex UI with a DSL

Weitere Àhnliche Inhalte

Was ist angesagt?

Ansible
AnsibleAnsible
Ansible
gnosek
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
Takayuki Miyauchi
 
Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013
Jan Gehring
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
Marcelo Pinheiro
 

Was ist angesagt? (20)

Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Vagrant
VagrantVagrant
Vagrant
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
Ansible
AnsibleAnsible
Ansible
 
[MeetUp][2nd] ì»­oní„ș
[MeetUp][2nd] ì»­oní„ș[MeetUp][2nd] ì»­oní„ș
[MeetUp][2nd] ì»­oní„ș
 
Messaging with the Docker
Messaging with the DockerMessaging with the Docker
Messaging with the Docker
 
BitTorrent on iOS
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
Vagrant and CentOS 7
Vagrant and CentOS 7Vagrant and CentOS 7
Vagrant and CentOS 7
 
Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottle
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41
 
Vagrant
VagrantVagrant
Vagrant
 
Vagrant presentation
Vagrant presentationVagrant presentation
Vagrant presentation
 
Vagrant
VagrantVagrant
Vagrant
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 

Ähnlich wie CRaSH the shell for the Java Virtual Machine

What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
Guillaume Laforge
 
Build your website with awestruct and publish it on the cloud with git
Build your website with awestruct and publish it on the cloud with gitBuild your website with awestruct and publish it on the cloud with git
Build your website with awestruct and publish it on the cloud with git
Xavier Coulon
 

Ähnlich wie CRaSH the shell for the Java Virtual Machine (20)

Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced Basics
 
Sling pipes
Sling pipesSling pipes
Sling pipes
 
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of LaptopsBoxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 
life with posh
life with poshlife with posh
life with posh
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
Voxxed Banff 2018 : Containers & Integration tests
Voxxed Banff 2018 : Containers & Integration testsVoxxed Banff 2018 : Containers & Integration tests
Voxxed Banff 2018 : Containers & Integration tests
 
Angular js掻甚äș‹äŸ‹ïŒšfilydoc
Angular js掻甚äș‹äŸ‹ïŒšfilydocAngular js掻甚äș‹äŸ‹ïŒšfilydoc
Angular js掻甚äș‹äŸ‹ïŒšfilydoc
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
 
Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.io
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Build your website with awestruct and publish it on the cloud with git
Build your website with awestruct and publish it on the cloud with gitBuild your website with awestruct and publish it on the cloud with git
Build your website with awestruct and publish it on the cloud with git
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails Introduction
 
Modernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerModernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & Bower
 
Building a Desktop Streaming console with Node.js and WebKit
Building a Desktop Streaming console with Node.js and WebKitBuilding a Desktop Streaming console with Node.js and WebKit
Building a Desktop Streaming console with Node.js and WebKit
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Let's Take A Look At The Boost Libraries
Let's Take A Look At The Boost LibrariesLet's Take A Look At The Boost Libraries
Let's Take A Look At The Boost Libraries
 

Mehr von GR8Conf

Mehr von GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

KĂŒrzlich hochgeladen

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

KĂŒrzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Chinsurah Escorts ☎8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎8617697112 Starting From 5K to 15K High Profile Escorts ...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 

CRaSH the shell for the Java Virtual Machine

  • 1. w w w . c r a s h u b . o r g CRaSH The shell for the JVM w w w . c r a s h u b . o r g Julien Viet exoplatform
  • 2. w w w . c r a s h u b . o r g All semicolons characters appearing in this work are fictitious. Any resemblance to real characters, living or dead, is purely coincidental. Disclaimer
  • 3. w w w . c r a s h u b . o r g http://www.julienviet.com / @julienviet 10 years of portal development (you know Portlets
) Working at eXoPlatform delivering enterprise social networks > me --verbose
  • 4. w w w . c r a s h u b . o r g You can use @crashub or #crashub Try it online try.crashub.org/gists/ e61cb08d93746e576209 (pro tip follow @crashub) About this talk
  • 5. w w w . c r a s h u b . o r g Once upon a time 
 Why did I do that ? what is CRaSH
  • 6. w w w . c r a s h u b . o r g Latest 1.2.9 / 1.3.0-cr5 Java 6+ / Groovy 1.7+ Base commands : jdbc, jmx, thread, jpa, log, etc.. Extensions: mail, cron CRaSH
  • 7. w w w . c r a s h u b . o r g Modes Standalone / attach (download / brew / gvm) Embedded Connectors jvm (standalone & attach) ssh, telnet crash.js over websocket Concepts
  • 8. w w w . c r a s h u b . o r g Standalone mode
  • 9. w w w . c r a s h u b . o r g Return "hello world" Command script
  • 10. w w w . c r a s h u b . o r g class helloworld { @Command String main() { return "Hello World" } } Command class
  • 11. w w w . c r a s h u b . o r g class hello { @Command String world() { return "Hello World" } } Git style
  • 12. w w w . c r a s h u b . o r g Command pipelining
  • 13. w w w . c r a s h u b . o r g Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface. - Ken Thompson Unix philosophy
  • 14. w w w . c r a s h u b . o r g % thread ls | thread dump | mail -s "something you should look at" julien@julienviet.com Pipeline example
  • 15. w w w . c r a s h u b . o r g <Void, Thread> is a producer <Thread, Object> is a pipe <String, String> is a pipe Pipeline example
  • 16. w w w . c r a s h u b . o r g class daemon { @Command Pipe<Thread, Thread> main() { [provide: { if (it.daemon) context.provide(it) }] as Pipe<Thread, Thread> } } Pipe command
  • 17. w w w . c r a s h u b . o r g # log ls -f org.crsh.* | log send -m "hello" # system propls | filter -p NAME:java.* | sort -f NAME # jmx query -p java.lang:type=GarbageCollector,name=* | jmx get -a Name -a CollectionCount -a CollectionTime Other examples
  • 18. w w w . c r a s h u b . o r g Read Eval Print Loop aka REPL
  • 19. w w w . c r a s h u b . o r g By default the script REPL parses CLI familiar for most CLI users Script REPL
  • 20. w w w . c r a s h u b . o r g very much like groovysh evaluates Groovy expressions DSL for creating CLI compose pipes and closures New Groovy REPL since 1.3
  • 21. w w w . c r a s h u b . o r g % (thread.ls | thread.dump | mail { S="something you should look at” "admin@domain.com" })() Our command pipeline in Groovy
  • 22. w w w . c r a s h u b . o r g More cool stuff
  • 23. w w w . c r a s h u b . o r g Completers Renderers Keyboard: interruption / events Screen: streaming / styling More cool stuff
  • 24. w w w . c r a s h u b . o r g Attach mode
  • 25. w w w . c r a s h u b . o r g Embedding CRaSH
  • 26. w w w . c r a s h u b . o r g Bootstrap: programmatic / Spring / Servlet Designed for embedding Lighweight : core jar about 600kb Modular : pay for what you need Virtual File System integration Embedding
  • 27. w w w . c r a s h u b . o r g Ecosystem
  • 28. w w w . c r a s h u b . o r g Created in Nov 2012 by Stephan Jaetzold Contributions by Burt Beckwith Recently updated to CRaSH 1.3 with additional features Grails Plugin
  • 29. w w w . c r a s h u b . o r g And the story just begins
  • 30. w w w . c r a s h u b . o r g Multi facet, powerful and extensible tool for all of us Join the community www.crashub.org @crashub crash-users@googlegroups.com Wrap up
  • 31. w w w . c r a s h u b . o r g Extra slides
  • 32. w w w . c r a s h u b . o r g new UIBuilder().table { header { label("key") label("value") } System.properties.each { k,v -> row { label(k).style(Color.red.fg()); label(v).style(Color.blue.fg()) } } } Building more complex UI with a DSL