all repos — NoPaste @ 3e3c433f026c49e04d0efa0f0f39fc688ed32bb1

Resurrected - The PussTheCat.org fork of NoPaste

scripts/CodeMirror/mode/shell/index.html (view raw)

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