index.html 1.3 KB

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