| 776 |
lars |
1 |
<!doctype html>
|
|
|
2 |
<title>CodeMirror: Shell mode</title>
|
|
|
3 |
<meta charset="utf-8" />
|
|
|
4 |
<link rel=stylesheet href="../../doc/docs.css">
|
|
|
5 |
<link rel=stylesheet href=../../lib/codemirror.css>
|
|
|
6 |
<script src=../../lib/codemirror.js></script>
|
|
|
7 |
<script src="../../addon/edit/matchbrackets.js"></script>
|
|
|
8 |
<script src=shell.js></script>
|
|
|
9 |
<style type=text/css>
|
|
|
10 |
.CodeMirror {
|
|
|
11 |
border-top: 1px solid black;
|
|
|
12 |
border-bottom: 1px solid black;
|
|
|
13 |
}
|
|
|
14 |
</style>
|
|
|
15 |
<div id=nav>
|
|
|
16 |
<a href="http://codemirror.net">
|
|
|
17 |
<h1>CodeMirror</h1>
|
|
|
18 |
<img id=logo src="../../doc/logo.png">
|
|
|
19 |
</a>
|
|
|
20 |
<ul>
|
|
|
21 |
<li>
|
|
|
22 |
<a href="../../index.html">Home</a>
|
|
|
23 |
<li>
|
|
|
24 |
<a href="../../doc/manual.html">Manual</a>
|
|
|
25 |
<li>
|
|
|
26 |
<a href="https://github.com/codemirror/codemirror">Code</a>
|
|
|
27 |
</ul>
|
|
|
28 |
<ul>
|
|
|
29 |
<li>
|
|
|
30 |
<a href="../index.html">Language modes</a>
|
|
|
31 |
<li>
|
|
|
32 |
<a class=active href="#">Shell</a>
|
|
|
33 |
</ul>
|
|
|
34 |
</div>
|
|
|
35 |
<article>
|
|
|
36 |
<h2>Shell mode</h2>
|
|
|
37 |
<textarea id=code> #!/bin/bash # clone the repository git clone http://github.com/garden/tree # generate HTTPS credentials cd tree openssl genrsa -aes256 -out https.key 1024 openssl req -new -nodes -key https.key -out https.csr openssl x509 -req -days 365 -in https.csr
|
|
|
38 |
-signkey https.key -out https.crt cp https.key{,.orig} openssl rsa -in https.key.orig -out https.key # start the server in HTTPS mode cd web sudo node ../server.js 443 'yes' >> ../node.log & # here is how to stop the server for pid in
|
|
|
39 |
`ps aux | grep 'node ../server.js' | awk '{print $2}'` ; do sudo kill -9 $pid 2> /dev/null done exit 0</textarea>
|
|
|
40 |
<script>
|
|
|
41 |
var editor = CodeMirror.fromTextArea(document.getElementById('code'),
|
|
|
42 |
{
|
|
|
43 |
mode: 'shell',
|
|
|
44 |
lineNumbers: true,
|
|
|
45 |
matchBrackets: true
|
|
|
46 |
});
|
|
|
47 |
</script>
|
|
|
48 |
<p>
|
|
|
49 |
<strong>MIME types defined:</strong> <code>text/x-sh</code>.</p>
|
|
|
50 |
</article>
|