SlideShare a Scribd company logo
1 of 32
Download to read offline
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

More Related Content

What's hot

Streams in node js
Streams in node jsStreams in node js
Streams in node js
Kushal Likhi
 

What's hot (20)

Am I Idempotent?
Am I Idempotent?Am I Idempotent?
Am I Idempotent?
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shell
 
Simple tricks to speed you up on the command line
Simple tricks to speed you up on the command lineSimple tricks to speed you up on the command line
Simple tricks to speed you up on the command line
 
Lies, Damn Lies, and Benchmarks
Lies, Damn Lies, and BenchmarksLies, Damn Lies, and Benchmarks
Lies, Damn Lies, and Benchmarks
 
Gogo shell
Gogo shellGogo shell
Gogo shell
 
Crystal Rocks
Crystal RocksCrystal Rocks
Crystal Rocks
 
Bash in theory and in practice - part two
Bash in theory and in practice - part twoBash in theory and in practice - part two
Bash in theory and in practice - part two
 
Laying Pipe with Transmogrifier
Laying Pipe with TransmogrifierLaying Pipe with Transmogrifier
Laying Pipe with Transmogrifier
 
Bash 4
Bash 4Bash 4
Bash 4
 
Bash in theory and in practice - part one
Bash in theory and in practice - part oneBash in theory and in practice - part one
Bash in theory and in practice - part one
 
Unix shell scripting
Unix shell scriptingUnix shell scripting
Unix shell scripting
 
zsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminarzsh for beginners WCTF 2019 Seminar
zsh for beginners WCTF 2019 Seminar
 
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
 
Ember.js Meetup Brussels 31/10/2013
Ember.js Meetup Brussels 31/10/2013Ember.js Meetup Brussels 31/10/2013
Ember.js Meetup Brussels 31/10/2013
 
5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code
 
Json(::PP) is a-changing
Json(::PP) is a-changingJson(::PP) is a-changing
Json(::PP) is a-changing
 
Git 201: A Deeper Look at Git (Nebraska.Code 2016)
Git 201: A Deeper Look at Git (Nebraska.Code 2016)Git 201: A Deeper Look at Git (Nebraska.Code 2016)
Git 201: A Deeper Look at Git (Nebraska.Code 2016)
 
LCA2014 - Introduction to Go
LCA2014 - Introduction to GoLCA2014 - Introduction to Go
LCA2014 - Introduction to Go
 
Os Secoske
Os SecoskeOs Secoske
Os Secoske
 
Streams in node js
Streams in node jsStreams in node js
Streams in node js
 

Viewers also liked

1c presentation-vh svs-beta
1c  presentation-vh svs-beta1c  presentation-vh svs-beta
1c presentation-vh svs-beta
Boris Cordero
 
2b apple story in picts
2b  apple story in picts2b  apple story in picts
2b apple story in picts
Boris Cordero
 
VHS vs Betamax - Listen to Customer
VHS vs Betamax - Listen to CustomerVHS vs Betamax - Listen to Customer
VHS vs Betamax - Listen to Customer
Murali Erraguntala
 
Unsuccessful products
Unsuccessful productsUnsuccessful products
Unsuccessful products
abhishek_g
 

Viewers also liked (14)

VHS or Betamax - Coca Cola, Adam Forde.
VHS or Betamax - Coca Cola, Adam Forde.VHS or Betamax - Coca Cola, Adam Forde.
VHS or Betamax - Coca Cola, Adam Forde.
 
1c presentation-vh svs-beta
1c  presentation-vh svs-beta1c  presentation-vh svs-beta
1c presentation-vh svs-beta
 
Betamax vs vhs
Betamax vs vhsBetamax vs vhs
Betamax vs vhs
 
Vhs
VhsVhs
Vhs
 
2b apple story in picts
2b  apple story in picts2b  apple story in picts
2b apple story in picts
 
Betamax
BetamaxBetamax
Betamax
 
Betamax failure
Betamax failureBetamax failure
Betamax failure
 
Sony betamax
Sony betamaxSony betamax
Sony betamax
 
VHS vs Betamax - Listen to Customer
VHS vs Betamax - Listen to CustomerVHS vs Betamax - Listen to Customer
VHS vs Betamax - Listen to Customer
 
Failed Marketing Strategies of Big Brand Like Unilever
Failed Marketing Strategies of Big Brand Like UnileverFailed Marketing Strategies of Big Brand Like Unilever
Failed Marketing Strategies of Big Brand Like Unilever
 
Product relaunch and rebranding power point
Product relaunch and rebranding power point Product relaunch and rebranding power point
Product relaunch and rebranding power point
 
failure products
failure productsfailure products
failure products
 
Unsuccessful products
Unsuccessful productsUnsuccessful products
Unsuccessful products
 
Big Brand Failures
Big Brand FailuresBig Brand Failures
Big Brand Failures
 

Similar to CRaSH the shell for the Java Virtual Machine

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
 

Similar to 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
 

More from GR8Conf

More from 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
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
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 🔝✔️✔️
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%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
 
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
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
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
 

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