596 lines
18 KiB
HTML
596 lines
18 KiB
HTML
|
|
||
|
<!DOCTYPE HTML>
|
||
|
<html lang="" >
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||
|
<title>terminal · hello world! bluesky</title>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
|
<meta name="description" content="">
|
||
|
<meta name="generator" content="@gitbook-ng/gitbook 3.3.6">
|
||
|
<meta name="author" content="syui">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/style.css">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-codeblock-filename/block.css">
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<meta name="HandheldFriendly" content="true"/>
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
|
||
|
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
|
||
|
|
||
|
|
||
|
<link rel="next" href="3.html" />
|
||
|
|
||
|
|
||
|
<link rel="prev" href="1.html" />
|
||
|
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<div class="book">
|
||
|
<div class="book-summary">
|
||
|
|
||
|
|
||
|
<div id="book-search-input" role="search">
|
||
|
<input type="text" placeholder="Type to search" />
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<nav role="navigation">
|
||
|
|
||
|
|
||
|
|
||
|
<ul class="summary">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<li class="chapter " data-level="1.1" data-path="../">
|
||
|
|
||
|
<a href="../">
|
||
|
|
||
|
|
||
|
hello world! bluesky
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.2" data-path="../c1/">
|
||
|
|
||
|
<a href="../c1/">
|
||
|
|
||
|
|
||
|
part 1
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<ul class="articles">
|
||
|
|
||
|
|
||
|
<li class="chapter " data-level="1.2.1" data-path="../c1/1.html">
|
||
|
|
||
|
<a href="../c1/1.html">
|
||
|
|
||
|
|
||
|
quick start
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.2.2" data-path="../c1/2.html">
|
||
|
|
||
|
<a href="../c1/2.html">
|
||
|
|
||
|
|
||
|
example
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.3" data-path="./">
|
||
|
|
||
|
<a href="./">
|
||
|
|
||
|
|
||
|
part 2
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<ul class="articles">
|
||
|
|
||
|
|
||
|
<li class="chapter " data-level="1.3.1" data-path="1.html">
|
||
|
|
||
|
<a href="1.html">
|
||
|
|
||
|
|
||
|
bluesky
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter active" data-level="1.3.2" data-path="2.html">
|
||
|
|
||
|
<a href="2.html">
|
||
|
|
||
|
|
||
|
terminal
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.3.3" data-path="3.html">
|
||
|
|
||
|
<a href="3.html">
|
||
|
|
||
|
|
||
|
shell
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.3.4" data-path="4.html">
|
||
|
|
||
|
<a href="4.html">
|
||
|
|
||
|
|
||
|
rust
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.4" data-path="../c3/">
|
||
|
|
||
|
<a href="../c3/">
|
||
|
|
||
|
|
||
|
part 3
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<ul class="articles">
|
||
|
|
||
|
|
||
|
<li class="chapter " data-level="1.4.1" data-path="../c3/1.html">
|
||
|
|
||
|
<a href="../c3/1.html">
|
||
|
|
||
|
|
||
|
hello world
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.4.2" data-path="../c3/2.html">
|
||
|
|
||
|
<a href="../c3/2.html">
|
||
|
|
||
|
|
||
|
seahorse
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.4.3" data-path="../c3/3.html">
|
||
|
|
||
|
<a href="../c3/3.html">
|
||
|
|
||
|
|
||
|
reqwest
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.5" data-path="../c4/">
|
||
|
|
||
|
<a href="../c4/">
|
||
|
|
||
|
|
||
|
part 4
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
<ul class="articles">
|
||
|
|
||
|
|
||
|
<li class="chapter " data-level="1.5.1" data-path="../c4/0.html">
|
||
|
|
||
|
<a href="../c4/0.html">
|
||
|
|
||
|
|
||
|
ai
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.5.2" data-path="../c4/1.html">
|
||
|
|
||
|
<a href="../c4/1.html">
|
||
|
|
||
|
|
||
|
config
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.5.3" data-path="../c4/2.html">
|
||
|
|
||
|
<a href="../c4/2.html">
|
||
|
|
||
|
|
||
|
mention
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.5.4" data-path="../c4/3.html">
|
||
|
|
||
|
<a href="../c4/3.html">
|
||
|
|
||
|
|
||
|
base64
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li class="chapter " data-level="1.6" data-path="../end/">
|
||
|
|
||
|
<a href="../end/">
|
||
|
|
||
|
|
||
|
end
|
||
|
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
|
||
|
</nav>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="book-body">
|
||
|
|
||
|
<div class="body-inner">
|
||
|
|
||
|
|
||
|
|
||
|
<div class="book-header" role="navigation">
|
||
|
|
||
|
|
||
|
<!-- Title -->
|
||
|
<h1>
|
||
|
<i class="fa fa-circle-o-notch fa-spin"></i>
|
||
|
<a href=".." >terminal</a>
|
||
|
</h1>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div class="page-wrapper" tabindex="-1" role="main">
|
||
|
<div class="page-inner">
|
||
|
|
||
|
<div id="book-search-results">
|
||
|
<div class="search-noresults">
|
||
|
|
||
|
<section class="normal markdown-section">
|
||
|
|
||
|
<h3 id="terminal">terminal</h3>
|
||
|
<p>The goal here is to provide the necessary commands and environment for each OS.</p>
|
||
|
<p>The <code>terminal</code> is the famous cmd (command prompt) in windows. In simple terms, it refers to a black screen. It is also called <code>terminal</code> or `term.</p>
|
||
|
<p>There are various terminals, or applications (software) in `terminal'.</p>
|
||
|
<p>Personally, I recommend <a href="https://wezfurlong.org/wezterm/installation.html" target="_blank">wezterm</a>, but here we will use an os-specific one.</p>
|
||
|
<h4 id="package-manager">package manager</h4>
|
||
|
<p>First, we will explain <code>package manager</code>.</p>
|
||
|
<p>In this case, you need to install a package manager for each OS.</p>
|
||
|
<p>Note that packages and programs here can also be referred to as apps.</p>
|
||
|
<p>Think of a package manager as something that simplifies the installation of an app.</p>
|
||
|
<p>Usually, an app works by building or compiling a source (source) and executing the binary that is created.</p>
|
||
|
<p>In the case of windows, <code>.exe</code> is a binary.</p>
|
||
|
<p>Binaries differ depending on the operating system.</p>
|
||
|
<p>Incidentally, source is often abbreviated to <code>src</code> and binary is often abbreviated to <code>bin</code>.</p>
|
||
|
<p>To return to the topic, the package manager automatically handles which packages (binaries) are downloaded from where and where they are placed.</p>
|
||
|
<p>The reason why this is done is that it takes time to build a source.</p>
|
||
|
<p>Therefore, most packages are simply downloaded from the server (server) as binaries that have already been built on the OS in question.</p>
|
||
|
<p>Most of them are called package managers.</p>
|
||
|
<p>From now on, you will install this package manager and use it from the <code>terminal</code>.</p>
|
||
|
<h4 id="windows">windows</h4>
|
||
|
<p>This section describes the required environment for windows users.</p>
|
||
|
<ul>
|
||
|
<li><p>winget</p>
|
||
|
</li>
|
||
|
<li><p>scoop</p>
|
||
|
</li>
|
||
|
<li><p>windows terminal</p>
|
||
|
</li>
|
||
|
<li><p>wsl</p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p>Be careful with the windows environment; remember that windows basically does not work as per the docs.</p>
|
||
|
<p>For example, most of the commands in <a href="https://github.com/microsoft" target="_blank">github/microsoft</a> will not work. It may not work.</p>
|
||
|
<p>Therefore, you will need to configure and read them according to your environment.</p>
|
||
|
<p>First, install <a href="https://github.com/microsoft/winget-cli" target="_blank">winget</a> as a windows package manager.</p>
|
||
|
<p>Press <code>win+r</code> and type <code>powershell</code> to start <a href="https://github.com/PowerShell/PowerShell/releases/" target="_blank">powershell</a>. powershell will henceforth be abbreviated as <code>pwsh</code>.</p>
|
||
|
<p>Execute the following command.</p>
|
||
|
<div><p class="code-filename">pwsh</p></div>
|
||
|
<pre><code class="lang-sh">Install-Module -Name Microsoft.W<span class="hljs-keyword">in</span>Get.Client
|
||
|
</code></pre>
|
||
|
<pre><code class="lang-sh">Untrusted repository
|
||
|
You are installing the modules from an untrusted repository. If you trust this repository, change its
|
||
|
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
|
||
|
<span class="hljs-string">'PSGallery'</span>?
|
||
|
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is <span class="hljs-string">"N"</span>): A
|
||
|
</code></pre>
|
||
|
<p>Next, install <a href="https://github.com/microsoft/terminal" target="_blank">windows terminal</a>.</p>
|
||
|
<div><p class="code-filename">search package</p></div>
|
||
|
<pre><code class="lang-sh">winget search <span class="hljs-string">"windows terminal"</span>
|
||
|
</code></pre>
|
||
|
<pre><code> Name Id Version Source
|
||
|
--------------------------------------------------------------------------------
|
||
|
Windows Terminal 9N0DX20HK701 Unknown msstore
|
||
|
Windows Terminal Preview 9N8G5RFZ9XK3 Unknown msstore
|
||
|
Windows Terminal Microsoft.WindowsTerminal 1.16.10261.0 winget
|
||
|
Windows Terminal Preview Microsoft.WindowsTerminal.Preview 1.17.10234.0 winget
|
||
|
</code></pre><div><p class="code-filename">install terminal</p></div>
|
||
|
<pre><code class="lang-sh">winget install 9N0DX20HK701
|
||
|
or
|
||
|
winget install Microsoft.WindowsTerminal
|
||
|
</code></pre>
|
||
|
<p>Since windows is very unwieldy with shell, we will run linux (ubuntu) with wsl. Basically, rust and shell are explained assuming a linux environment.</p>
|
||
|
<div><p class="code-filename">setting wsl</p></div>
|
||
|
<pre><code class="lang-sh">wsl --install
|
||
|
wsl --install <span class="hljs-_">-d</span> Ubuntu
|
||
|
</code></pre>
|
||
|
<p>If you prefer a windows environment instead of linux, you can install <code>curl</code> etc. from <a href="https://scoop.sh/" target="_blank">scoop</a> or other package managers.</p>
|
||
|
<div><p class="code-filename">install scoop</p></div>
|
||
|
<pre><code class="lang-sh">Set-ExecutionPolicy RemoteSigned -Scope CurrentUser <span class="hljs-comment"># Optional: Needed to run a remote script the first time</span>
|
||
|
irm get.scoop.sh | iex
|
||
|
</code></pre>
|
||
|
<div><p class="code-filename">pwsh</p></div>
|
||
|
<pre><code class="lang-sh">scoop install curl git rust
|
||
|
</code></pre>
|
||
|
<p>Install and update <code>pwsh</code>.</p>
|
||
|
<pre><code class="lang-sh">winget install Microsoft.PowerShell
|
||
|
winget upgrade --all
|
||
|
</code></pre>
|
||
|
<h4 id="mac">mac</h4>
|
||
|
<ul>
|
||
|
<li><p>terminal</p>
|
||
|
</li>
|
||
|
<li><p>homebrew</p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p>For <code>mac</code>, use the default terminal.</p>
|
||
|
<p>Open <code>finder</code> and press <code>cmd+shift+u</code>. You will find `terminal(terminal.app)' in it.</p>
|
||
|
<p>First install the package manager <a href="https://brew.sh" target="_blank">homebrew</a>.</p>
|
||
|
<div><p class="code-filename">install brew</p></div>
|
||
|
<pre><code class="lang-sh">/bin/bash -c <span class="hljs-string">"<span class="hljs-variable">$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)</span>"</span>
|
||
|
</code></pre>
|
||
|
<pre><code class="lang-sh">brew install curl git zsh rust
|
||
|
</code></pre>
|
||
|
<h4 id="linux">linux</h4>
|
||
|
<p>I will omit the description for linux users as it needs no explanation.</p>
|
||
|
<p>I will use <a href="https://www.archlinux.org/" target="_blank">archlinux</a>.</p>
|
||
|
<pre><code class="lang-sh">pacman -Syu curl git zsh rust
|
||
|
</code></pre>
|
||
|
<pre><code class="lang-sh">$ cargo version
|
||
|
cargo 1.70.0
|
||
|
</code></pre>
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
</div>
|
||
|
<div class="search-results">
|
||
|
<div class="has-results">
|
||
|
|
||
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||
|
<ul class="search-results-list"></ul>
|
||
|
|
||
|
</div>
|
||
|
<div class="no-results">
|
||
|
|
||
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<a href="1.html" class="navigation navigation-prev " aria-label="Previous page: bluesky">
|
||
|
<i class="fa fa-angle-left"></i>
|
||
|
</a>
|
||
|
|
||
|
|
||
|
<a href="3.html" class="navigation navigation-next " aria-label="Next page: shell">
|
||
|
<i class="fa fa-angle-right"></i>
|
||
|
</a>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
var gitbook = gitbook || [];
|
||
|
gitbook.push(function() {
|
||
|
gitbook.page.hasChanged({"page":{"title":"terminal","level":"1.3.2","depth":2,"next":{"title":"shell","level":"1.3.3","depth":2,"path":"c2/3.md","ref":"c2/3.md","articles":[]},"previous":{"title":"bluesky","level":"1.3.1","depth":2,"path":"c2/1.md","ref":"c2/1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","codeblock-filename","mermaid-gb3","diff"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"codeblock-filename":{},"mermaid-gb3":{},"diff":{"type":"markdown","method":"diffChars","options":{}},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"syui","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"hello world! bluesky","gitbook":"*","description":"This is a bluesky ai-card example, and first rust"},"file":{"path":"c2/2.md","mtime":"2023-07-31T06:47:31.511Z","type":"markdown"},"gitbook":{"version":"3.3.6","time":"2023-07-31T07:16:09.509Z"},"basePath":"..","book":{"language":""}});
|
||
|
});
|
||
|
</script>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook.js"></script>
|
||
|
<script src="../gitbook/theme.js"></script>
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|