7 lines
11 KiB
JavaScript
7 lines
11 KiB
JavaScript
import{_ as o,c as t,o as a,ah as n,ar as s,as as r,at as i,au as d,av as h,aw as p,ax as l}from"./chunks/framework.j4Nev8bF.js";const k=JSON.parse('{"title":"Intro to Terminal","description":"","frontmatter":{},"headers":[],"relativePath":"rebel_coding/termintro.md","filePath":"rebel_coding/termintro.md"}'),c={name:"rebel_coding/termintro.md"};function m(u,e,w,g,y,b){return a(),t("div",null,[...e[0]||(e[0]=[n(`<h1 id="intro-to-terminal" tabindex="-1">Intro to Terminal <a class="header-anchor" href="#intro-to-terminal" aria-label="Permalink to “Intro to Terminal”"></a></h1><hr><p>If you are using a Mac, use Spotlight to search for the Terminal program. Open it up and begin following along; all of these instructions will work the same for you. If you are using Windows, I’m sorry, but we won’t delve into the differences Powershell employs. Rather I recommend you purchase a one month subscription to Rebel Labs, where you can use the Linux terminal provided.</p><p><code>whoami</code> & <code>pwd</code> are two of the first commands one ought learn. Type each command into the terminal and press Enter.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span> $ whoami</span></span>
|
||
<span class="line"><span> Username</span></span>
|
||
<span class="line"><span> $ pwd</span></span>
|
||
<span class="line"><span> /home/Username</span></span></code></pre></div><p>The first command provides an obvious answer, and the second is obvious enough once you know that it stands for “print work directory”.</p><p>Though for a long time, I thought it meant “present working directory”, because that just seems so much more descriptive to me.</p><p>Nonetheless, we answer the question, “Where am I?”</p><p>In all likelihood, you should be in your “home/{username}” directory.</p><p>And if you’re in Rebel Labs (RL), that’s where you will start!</p><p>Next, let’s take a look around ~ by typing the command <code>ls</code> and pressing Enter.</p><p>The <code>ls</code> command lists the items in our <em>present working directory</em>.</p><p>Cool, if we are in the RL we should see a notebooks folder. But let’s back up one moment ~</p><p>I want to tell you about <strong>command flags</strong>.</p><p>We just used three commands, <code>whoami</code>, <code>pwd</code>, and <code>ls</code>. The last of which has some other capabilities that can be accessed using command properties, indicated by <em>flags</em>.</p><p>Instead of just typing <code>ls</code> into the terminal, type <code>ls -l</code> and press Enter!</p><p>Huzzah ~ more details.</p><p>What do they all mean?!? We’re not going to cover that now, peep the appendix.</p><p>We’re gonna keep movin’ along. The important thing to note is that this is how command flags work, they need at least one-dash, sometimes two, to precede them.</p><p>Next command: <code>cd</code></p><p>If you just typed that in and pressed Enter, nothing will happen.</p><p>We need to add a destination, as <code>cd</code> stands for <em>change directory</em> … type <code>cd notebooks</code> and press Enter.</p><p>Let’s use <code>ls</code> or <code>ls -l</code> again, to take a look at what we got …</p><p>If you’re in the RL, then you ought to see nothing. And if you’re following along on your own computer … from your home directory lets first use the <code>mkdir</code> to make a new directory called RCNotebooks, or whatever name you like.</p><p><code>mkdir RCNotebooks</code> and press Enter.</p><p>Just like <code>cd</code> we needed to provide a name for the directory to be made.</p><p>Then we can <code>cd</code> into RCNotebooks as shown above, and onward we continue.</p><p><img src="`+s+'" alt="alt text"></p><h1 id="ssh-hidden-folders" tabindex="-1">SSH & Hidden Folders <a class="header-anchor" href="#ssh-hidden-folders" aria-label="Permalink to “SSH & Hidden Folders”"></a></h1><hr><p>I made a funny, we need to reverse … which is a great chance to learn how we do this in the command line??</p><p>Though first off, let’s make a mental model.</p><p>I like to consider the file system like chutes and ladders; up and down.</p><p>We often start right in the middle. in our home directory /home/user. And everything we initially access is <em>down</em> the file system from this location: /home/user/notebooks. /home/user/Desktop, /home/user/Downloads, etc.</p><p>Reversing directions would mean to travel back <em>up</em> the file stack. We use double-dots to do this, as follows:</p><p><code>cd ..</code> and press Enter.</p><p>Don’t forget <em>both dots</em>!</p><p>And we should now be back in our home directory, if we use the command <code>ls</code> we should see our Notebooks directory; or use the <code>pwd</code> command to confirm your location.</p><p>Now we make an SSH key, but what does that even mean?</p><p><img src="'+r+'" alt="alt text"></p><p><strong>SSH - Secure Shell</strong></p><p>Right now we’re using the terminal, or command line interface, and your account is considered a <em>shell</em> account; while you have <em>shell</em> access. Shell being another word for the <em>terminal</em>.</p><p>Presumably your account is protected by a password; and it’s a really good one, or it isn’t; that’s not immediately the point.</p><p>The point is that every single time you want to get or send project files to a repository; you don’t want to have to retype a password. Plus now you will actually have a super super-secure password!</p><h1 id="how-to-make-an-ssh-key" tabindex="-1">How to make an SSH key <a class="header-anchor" href="#how-to-make-an-ssh-key" aria-label="Permalink to “How to make an SSH key”"></a></h1><hr><p>Last things first, we will be making an ssh key <em>pair</em>; one file will remain on your computer, and another file will have a ‘.pub’ extension, to be shared.</p><p>The security comes through the “handshake” these two files make when connecting between two systems.</p><p>We’ve got our terminal open, and we’re in our home directory. Make sure to double check that!</p><p>First command: <code>ssh-keygen</code></p><p>We will be asked where we want to save the file … look at the file address, what seems weird?</p><p>Take note, press Enter and continue.</p><p>Next we are asked if we want to attach a passphrase to our SSH key; I humbly suggest it is not necessary at this juncture of your development; and is precisely what we’re trying to avoid, having to type in password.</p><p>Leave it blank and press Enter. Then press Enter again to confirm.</p><p>Now you will be presented with ‘randomart’. I dunno ...</p><p><img src="'+i+'" alt="alt text"></p><p>So where are our keys !?</p><p>Type in the command <code>ls -la</code> and press Enter.</p><p>See what I did there? I combined command flags!!!</p><p>What’s that folder with the dot in front of it?</p><p>That’s a <em>hidden</em> folder, were we viewing this location with a GUI (Graphical User Interface) we might be able to <em>see</em> the .ssh folder.</p><p>Yup, the single dot is what denotes a hidden folder … let’s cd into the hidden .ssh folder, <code>cd .ssh</code>; followed by <code>ls -l</code>. What do we see?</p><p>There ought to be at least two files, one called id_rsa, and another called id_rsa.pub. And it is this file that we will share with others who wish to grant us access to their systems.</p><p>You can type <code>cat id_rsa.pub</code> to view the files contents.</p><h1 id="have-you-made-a-github-account-yet" tabindex="-1">Have you made a GitHub account yet? <a class="header-anchor" href="#have-you-made-a-github-account-yet" aria-label="Permalink to “Have you made a GitHub account yet?”"></a></h1><hr><p>In order to most seamlessly complete the next step, we need to make sure you have a GitHub account <em>with</em> an SSH key set-up.</p><p>I’m going to presume you have figured out how to make an GitHub account, though the following screenshots show you how to register your newly created SSH key!</p><p>Once you’re in your GitHub account, click on your profile picture in the upper right-hand corner, and menu will drop down.</p><p>Choose the Settings option.</p><p><img src="'+d+'" alt="alt_text"></p><p>Now that we’re in the Settings menu, we have a set of Settings Categories available to us on the left side of the screen.</p><p>Choose the SSH and GPG keys Category.</p><p><img src="'+h+'" alt="alt_text"></p><p>Remember how we used the <code>cat id_rsa.pub</code> to view the contents of our public key earlier?</p><p>We did that so we can copy the contents, by highlighting the output, and using a right mouse click to open up an options menu, then choosing copy.</p><p>And we will paste that content right into the field, as shown below.</p><p>Make sure to give your key a memorable, and descriptive name as well.</p><p><img src="'+p+`" alt="alt_text"></p><p>Now we’re ready to continue!</p><h1 id="cloning-the-basics" tabindex="-1">Cloning the Basics <a class="header-anchor" href="#cloning-the-basics" aria-label="Permalink to “Cloning the Basics”"></a></h1><hr><p>Alright, now that we’ve got all of that taken care of; let’s get our starting materials.</p><p>Open up a browser and navigate to <a href="https://www.github.com/rebelcoding/Classwork/" target="_blank" rel="noreferrer">https://www.github.com/rebelcoding/Classwork</a> .</p><p>There is a green button near the upper-right corner of the display which reads “Clone or download’. Click this button; if you are signed in and have shared your SSH key with Github choose ‘Use SSH’, otherwise use HTTPS.</p><p>Copy the code that is provided for you, and return to the terminal; here we will change directories, back into our notebooks directory:</p><p><code>cd notebooks</code>.</p><p>Now we will use a <em>git</em> command:</p><pre><code>git clone git@github.com:rebelcoding/Classwork.git
|
||
</code></pre><p>Last command, make sure to use your GitHub username:</p><pre><code>cp -r Classwork/username.github.io {username}.github.io
|
||
</code></pre><p>Can you tell what you just did?</p><p><img src="`+l+'" alt="alt_text"></p><h1 id="additional-support" tabindex="-1">Additional Support <a class="header-anchor" href="#additional-support" aria-label="Permalink to “Additional Support”"></a></h1><hr><p>The remainder of this book builds off of the material in this repository. If you are having ANY trouble, please reach out to <a href="mailto:canin@dreamfreely.org" target="_blank" rel="noreferrer">canin@dreamfreely.org</a> ~</p><p>The last command we ran copied template files for your HTML website. If you’re using GitHub.com you can publish your website to a github.io address that uses your username.</p><p>We'll cover this process after we've been introduced to HTML & CSS.</p>',98)])])}const v=o(c,[["render",m]]);export{k as __pageData,v as default};
|