SlideShare a Scribd company logo
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

PDF
ZSH and RVM
PPTX
Bash script (mask off remix)
ODP
DevChatt 2010 - *nix Cmd Line Kung Foo
ODP
WebSockets with PHP: Mission impossible
PPTX
Socket programming with php
PPT
Rush, a shell that will yield to you
ODP
Perl dancer
PDF
Zsh shell-for-humans
ZSH and RVM
Bash script (mask off remix)
DevChatt 2010 - *nix Cmd Line Kung Foo
WebSockets with PHP: Mission impossible
Socket programming with php
Rush, a shell that will yield to you
Perl dancer
Zsh shell-for-humans

What's hot (20)

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

Viewers also liked (10)

PDF
Hands on iOS developments with Jenkins
PDF
CRaSH @ JUGSummerCamp 2012 - Quickie
PPTX
Interactive Java Support to your tool -- The JShell API and Architecture
PPTX
JShell: An Interactive Shell for the Java Platform
PDF
eXoer on the grill: eXo Add-ons factory using Docker and Codenvy
PPT
eXo Platform 4.4 Released: Work Better with More Context!
PDF
When Collaboration Drives Your Digital Transformation
PDF
Introduce Bootstrap 3 to Develop Responsive Design Application
PDF
Introduction to JShell: the Java REPL Tool #jjug_ccc #ccc_ab4
PDF
Modèles Business Open Source - Success story eXo
Hands on iOS developments with Jenkins
CRaSH @ JUGSummerCamp 2012 - Quickie
Interactive Java Support to your tool -- The JShell API and Architecture
JShell: An Interactive Shell for the Java Platform
eXoer on the grill: eXo Add-ons factory using Docker and Codenvy
eXo Platform 4.4 Released: Work Better with More Context!
When Collaboration Drives Your Digital Transformation
Introduce Bootstrap 3 to Develop Responsive Design Application
Introduction to JShell: the Java REPL Tool #jjug_ccc #ccc_ab4
Modèles Business Open Source - Success story eXo
Ad

Similar to CRaSH the shell for the Java Virtual Machine (20)

PPTX
CRaSH the shell for the JVM
PDF
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
PDF
Clojure web dev history
PDF
Counterclockwise past present future
PDF
Zero to scaleable in ten minutes
PPTX
Road to sbt 1.0: Paved with server (2015 Amsterdam)
PDF
Growing an ecosystem on the JVM
PDF
Writing Rust Command Line Applications
PDF
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
PDF
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
KEY
Crash reports pycodeconf
PPTX
Eduards Sizovs - Micro Service Architecture
PPTX
Take control. write a plugin. part II
PDF
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
PDF
Apache cordova
PDF
Groovy and Grails
PDF
Inside GitHub
 
PDF
Leveraging Android's Linux Heritage at AnDevCon3
PPTX
Deep dive - Concourse CI/CD and Pipelines
PDF
Vert.x introduction
CRaSH the shell for the JVM
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Clojure web dev history
Counterclockwise past present future
Zero to scaleable in ten minutes
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Growing an ecosystem on the JVM
Writing Rust Command Line Applications
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
Crash reports pycodeconf
Eduards Sizovs - Micro Service Architecture
Take control. write a plugin. part II
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Apache cordova
Groovy and Grails
Inside GitHub
 
Leveraging Android's Linux Heritage at AnDevCon3
Deep dive - Concourse CI/CD and Pipelines
Vert.x introduction

More from eXo Platform (12)

PPTX
Workshop blockchain au service de l engagement - 20-3-2019
PDF
Digitalisation RH –Avec ou sans les DRH
PDF
De l'Intranet institutionnel à la Digital Workplace : la démarche du groupe d...
PPTX
L’Intranet, socle de l’entreprise digitale !
PPTX
Un hub collaboratif unique et intégré : les pour et les contre
PPTX
Intranet Project: Roll-out Strategy & Pain Points to consider
PDF
How we migrate 350+ Maven CI jobs to Pipeline as Code with Jenkins 2 and Docker
PPT
Peut-on décider un changement de culture d'entreprise?
PPTX
Conférence sur la Digital Workplace au Salon Intranet & Collaboratif
PPT
eXo Platform - Votre plateforme de travail collaboratif
PDF
Solutions to your employee disengagement
PPT
Performance testing and_reporting_with_j_meter by Le Van Nghi
Workshop blockchain au service de l engagement - 20-3-2019
Digitalisation RH –Avec ou sans les DRH
De l'Intranet institutionnel à la Digital Workplace : la démarche du groupe d...
L’Intranet, socle de l’entreprise digitale !
Un hub collaboratif unique et intégré : les pour et les contre
Intranet Project: Roll-out Strategy & Pain Points to consider
How we migrate 350+ Maven CI jobs to Pipeline as Code with Jenkins 2 and Docker
Peut-on décider un changement de culture d'entreprise?
Conférence sur la Digital Workplace au Salon Intranet & Collaboratif
eXo Platform - Votre plateforme de travail collaboratif
Solutions to your employee disengagement
Performance testing and_reporting_with_j_meter by Le Van Nghi

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I

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