12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Create An Easy to Use Bash Script Repository Using GitHub</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="How To,Tutorial,i12bretro,Linux,Bash,Script Repository,Github,IT Toolbox">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Create An Easy to Use Bash Script Repository Using GitHub">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Create An Easy to Use Bash Script Repository Using GitHub</h1>
- </div>
- <div></div>
- <div id="content">
- <p><em>In this example I'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>
- <h2>Create the GitHub Repository</h2>
- <ol>
- <li>Create or log into your existing GitHub account</li>
- <li>Click the New button in the top left to create a new repository</li>
- <li>Give the repository a name > Click the Create Repository button</li>
- </ol>
- <h2>Creating a Sample Bash Script</h2>
- <ol>
- <li>Open a text editor</li>
- <li>Paste the following script into a new text document
- <p>#!/bin/bash<br />
- echo "hello, today is $(date '+%A'). You are running me as $(whoami)."</p>
- </li>
- <li>Save the file as whoami.sh</li>
- <li>Back in the browser, click the uploading an existing file link</li>
- <li>Upload the whoami.sh file and give a brief description > Click the Commit changes button</li>
- <li>Click on the newly uploaded file</li>
- <li>Click the Raw tab at the top right of the code</li>
- <li>Copy the URL for the raw code</li>
- <li>Open another browser tab and navigate to https://git.io</li>
- <li>Paste in the raw code URL from the clipboard > Click Shorten</li>
- <li>Copy the shortened URL</li>
- </ol>
- <h2>Executing the Sample Bash Script</h2>
- <ol>
- <li>Launch terminal and execute the bash file from GitHub by running the following command
- <div class="codeBlock">curl -L PastedShortenedURL | bash</div>
- </li>
- </ol>
- </div>
- </div>
- </body>
- </html>
-
|