0494.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Create An Easy to Use Bash Script Repository Using GitHub</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="How To,Tutorial,i12bretro,Linux,Bash,Script Repository,Github,IT Toolbox">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Create An Easy to Use Bash Script Repository Using GitHub">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  12. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  13. <script type="text/javascript" src="includes/js/steps.js"></script>
  14. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  15. </head>
  16. <body>
  17. <div id="gridContainer">
  18. <div class="topMargin"></div>
  19. <div id="listName" class="topMargin">
  20. <h1>Create An Easy to Use Bash Script Repository Using GitHub</h1>
  21. </div>
  22. <div></div>
  23. <div id="content">
  24. <p><em>In this example I&#39;ll be setting up a GitHub repository to host bash files, using the GitHub URL Shortener to simplify the URLs and then running the scripts locally on a Debian based virtual machine</em></p>
  25. <h2>Create the GitHub Repository</h2>
  26. <ol>
  27. <li>Create or log into your existing GitHub account</li>
  28. <li>Click the New button in the top left to create a new repository</li>
  29. <li>Give the repository a name &gt; Click the Create Repository button</li>
  30. </ol>
  31. <h2>Creating a Sample Bash Script</h2>
  32. <ol>
  33. <li>Open a text editor</li>
  34. <li>Paste the following script into a new text document
  35. <p>#!/bin/bash<br />
  36. echo &quot;hello, today is $(date &#39;+%A&#39;). You are running me as $(whoami).&quot;</p>
  37. </li>
  38. <li>Save the file as whoami.sh</li>
  39. <li>Back in the browser, click the uploading an existing file link</li>
  40. <li>Upload the whoami.sh file and give a brief description &gt; Click the Commit changes button</li>
  41. <li>Click on the newly uploaded file</li>
  42. <li>Click the Raw tab at the top right of the code</li>
  43. <li>Copy the URL for the raw code</li>
  44. <li>Open another browser tab and navigate to https://git.io</li>
  45. <li>Paste in the raw code URL from the clipboard &gt; Click Shorten</li>
  46. <li>Copy the shortened URL</li>
  47. </ol>
  48. <h2>Executing the Sample Bash Script</h2>
  49. <ol>
  50. <li>Launch terminal and execute the bash file from GitHub by running the following command
  51. <div class="codeBlock">curl -L PastedShortenedURL | bash</div>
  52. </li>
  53. </ol>
  54. </div>
  55. </div>
  56. </body>
  57. </html>