Compare commits
10
Commits
d2634af6f4
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5baaa9e456 | ||
|
|
7db3961a79 | ||
|
|
45b01432b8 | ||
|
|
f4a8281bd9 | ||
|
|
4429a2f560 | ||
|
|
0d41bcf4d5 | ||
|
|
2bd6b7f44e | ||
|
|
f642cb12da | ||
|
|
e76e29d7c3 | ||
|
|
c1c6673dc3 |
@@ -1,3 +0,0 @@
|
|||||||
[submodule "services"]
|
|
||||||
path = services
|
|
||||||
url = https://github.com/quaxlyqueen/services
|
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Contributing to ras-pi
|
||||||
|
|
||||||
|
We welcome contributions to ras-pi! Whether you're fixing a bug, proposing a feature, or improving documentation, your help is appreciated.
|
||||||
|
|
||||||
|
## How to Contribute
|
||||||
|
|
||||||
|
1. **Fork the repository:** Click the "Fork" button at the top right of the page. This creates a copy of the repository in your GitHub account.
|
||||||
|
2. **Clone your fork:** Clone the repository to your local machine using Git:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone [https://github.com/YOUR_USERNAME/ras-pi
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Create a branch:** Create a new branch for your changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b feature/your-feature-name
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout -b fix/your-bug-fix
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Make your changes:** Implement your changes. Please try to follow the project's general vibe with lots of comments and documentation, particularly for new features.
|
||||||
|
5. **Commit your changes:** Commit your changes with clear and concise commit messages:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add .
|
||||||
|
git commit -m "Add your feature/fix description"
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **Push your changes:** Push your branch to your forked repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git push origin feature/your-feature-name
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **Create a pull request:** Go to SLCPL-CreativeLab/ras-pi repository on GitHub and click the "New Pull Request" button. Select your branch and provide a clear description of your changes.
|
||||||
|
|
||||||
|
## Guidelines
|
||||||
|
|
||||||
|
* **Coding Style:** Please adhere to the project's coding style. If there are no specific guidelines, follow common best practices.
|
||||||
|
* **Commit Messages:** Use clear and descriptive commit messages.
|
||||||
|
* **Documentation:** Update the documentation as needed to reflect your changes.
|
||||||
|
* **Issue Tracking:** If you're addressing an existing issue, please reference it in your pull request.
|
||||||
|
* **Respectful Communication:** Please be respectful and considerate of other contributors.
|
||||||
|
|
||||||
|
## Reporting Issues
|
||||||
|
|
||||||
|
If you find a bug or have a feature request, please open an issue on GitHub. Provide as much detail as possible, including steps to reproduce the issue.
|
||||||
|
|
||||||
|
## Getting Help
|
||||||
|
|
||||||
|
If you have any questions or need help, please open an issue or reach out to us through [email](mailto:jashton@slcpl.org).
|
||||||
|
|
||||||
|
Thank you for contributing to SLCPL-CreativeLab/ras-pi!
|
||||||
@@ -1,2 +1,53 @@
|
|||||||
# ras-pi
|
# Raspberry Pi, Linux, and Coding Introduction
|
||||||
A comprehensive, end-to-end guide to the fundamentals of coding, network protocols, Linux, and the Raspberry Pi.
|
A guide to the fundamentals of the Raspberry Pi through the exploration of coding, networking, and Linux. See the full guide at [vintagecoding.net](https://raspi.vintagecoding.net), or follow **Getting Started** to host a mirror of the manual directly on your Raspberry Pi.
|
||||||
|
|
||||||
|
The possibilities are endless, and support for more projects is coming soon!
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
Run the commands below in the terminal application on a fresh installation on a Raspberry Pi. To paste into a terminal, use Control+Shift+v. If you need help with installing the Operating System (OS) on your Pi, please see the [manual](https://raspi.vintagecoding.net#install-os).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install git;
|
||||||
|
git clone https://github.com/SLCPL-CreativeLab/ras-pi;
|
||||||
|
cd ras-pi/scripts;
|
||||||
|
./setup.sh;
|
||||||
|
|
||||||
|
# Optionally:
|
||||||
|
./setup-ai.sh # Installs Ollama (all supported Pi's) and Open WebUI (only on Pi 5 and higher).
|
||||||
|
./setup-manual.sh # Installs the manual.
|
||||||
|
./setup-jellyfin.sh # Installs Jellyfin.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Expose Services to the Internet
|
||||||
|
To use `cloudflared` to expose services to the internet, you must:
|
||||||
|
|
||||||
|
- Make a Cloudflare account & purchase a domain
|
||||||
|
- Run the command `cloudflared tunnel login`
|
||||||
|
- Run the command `./setup-cloudflared.sh` in ~/ras-pi/scripts
|
||||||
|
|
||||||
|
or:
|
||||||
|
|
||||||
|
- `cloudflared tunnel --url=http://localhost:PORT`
|
||||||
|
|
||||||
|
to alternatively temporarily expose a single service to the internet. PORT is the service you'd like to expose. The ports used with the standard services are below.
|
||||||
|
|
||||||
|
| PORT | SERVICE |
|
||||||
|
|--------------------|----------------------------------------------|
|
||||||
|
| 5090 | Mirror of raspi.vintagecoding.net |
|
||||||
|
| 5091 | Jellyfin |
|
||||||
|
| 5092 | Open WebUI |
|
||||||
|
|
||||||
|
For more information about `cloudflared`, particularly regarding the security of connecting a service to the internet, please read their [docs](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/).
|
||||||
|
|
||||||
|
## Contributions & Support
|
||||||
|
Feel free to contribute to the project! Please see **CONTRIBUTIONS.md** to start.
|
||||||
|
|
||||||
|
If you need any help with getting started, please email [me](mailto:jashton@slcpl.org).
|
||||||
|
|
||||||
|
## Projects/Software Used
|
||||||
|
|
||||||
|
- [ollama](https://github.com/ollama/ollama)
|
||||||
|
- [open-webui](https://github.com/open-webui/open-webui)
|
||||||
|
- [jellyfin](https://github.com/jellyfin/jellyfin)
|
||||||
|
- [cloudflared](https://github.com/cloudflare/cloudflared)
|
||||||
|
- [podman](https://github.com/containers/podman)
|
||||||
|
|||||||
Binary file not shown.
@@ -4,40 +4,56 @@ body {
|
|||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #f4f4f9;
|
background-color: #f4f4f9;
|
||||||
}
|
}
|
||||||
h1, h2, h3 {
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul li {
|
ul li {
|
||||||
|
margin-left: 30px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
table, th, td {
|
|
||||||
|
table,
|
||||||
|
th,
|
||||||
|
td {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
th, td {
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
background-color: #f4f4f4;
|
background-color: #f4f4f4;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@@ -45,11 +61,20 @@ pre {
|
|||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container {
|
.image-container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container img {
|
.image-container img {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
border: 2px solid #e0e0e0;
|
||||||
|
border-radius: 9px;
|
||||||
|
padding: 3px;
|
||||||
|
color: #091A19;
|
||||||
|
}
|
||||||
|
|||||||
+351
-69
@@ -1,11 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Raspberry Pi & Linux Guide</title>
|
<title>Raspberry Pi & Linux Guide</title>
|
||||||
<link rel="stylesheet" href="css/styles.css">
|
<link rel="stylesheet" href="css/styles.css">
|
||||||
|
<script src="js/script.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>Raspberry Pi & Linux Guide</h1>
|
<h1>Raspberry Pi & Linux Guide</h1>
|
||||||
@@ -15,57 +18,83 @@
|
|||||||
<h3>Raspberry Pi</h3>
|
<h3>Raspberry Pi</h3>
|
||||||
|
|
||||||
<h4>What is it?</h4>
|
<h4>What is it?</h4>
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Raspberry_Pi">The Raspberry Pi</a> is a series of small, affordable, single-board computers developed in the United Kingdom by the Raspberry Pi Foundation in collaboration with Broadcom. It’s designed to promote teaching basic computer science and to provide an accessible platform for hobbyists, educators, and students to explore computing, learn programming, and work on various digital projects.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Raspberry_Pi">The Raspberry Pi</a> is a series of small, affordable,
|
||||||
|
single-board computers developed in the United Kingdom by the Raspberry Pi Foundation in collaboration with
|
||||||
|
Broadcom. It’s designed to promote teaching basic computer science and to provide an accessible platform for
|
||||||
|
hobbyists, educators, and students to explore computing, learn programming, and work on various digital
|
||||||
|
projects.</p>
|
||||||
|
|
||||||
<h4>Raspberry Pi Projects</h4>
|
<h4>Raspberry Pi Projects</h4>
|
||||||
<p><a href="https://projects.raspberrypi.org/">Raspberry Pi projects</a> range from simple learning tools to complex systems. Some popular project ideas include:</p>
|
<p><a href="https://projects.raspberrypi.org/">Raspberry Pi projects</a> range from simple learning tools to complex
|
||||||
|
systems. Some popular project ideas include:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://projects.raspberrypi.org/">Coding and Computing</a>: Using Raspberry Pi to learn programming languages like Python and Scratch.</li>
|
<li><a href="https://projects.raspberrypi.org/">Coding and Computing</a>: Using Raspberry Pi to learn
|
||||||
<li>Home Automation: Creating smart home devices that can control lighting, temperature, or security systems.</li>
|
programming languages like Python and Scratch.</li>
|
||||||
|
<li>Home Automation: Creating smart home devices that can control lighting, temperature, or security systems.
|
||||||
|
</li>
|
||||||
<li>Retro Gaming: Building a retro gaming console to play classic games.</li>
|
<li>Retro Gaming: Building a retro gaming console to play classic games.</li>
|
||||||
<li><a href="https://www.tomshardware.com/features/best-raspberry-pi-projects">Robotics</a>: Designing robots that can perform various tasks or respond to the environment.</li>
|
<li><a href="https://www.tomshardware.com/features/best-raspberry-pi-projects">Robotics</a>: Designing robots
|
||||||
|
that can perform various tasks or respond to the environment.</li>
|
||||||
<li>Media Centers: Setting up a media server to stream videos and music throughout your home.</li>
|
<li>Media Centers: Setting up a media server to stream videos and music throughout your home.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>Raspberry Pi Documentation</h4>
|
<h4>Raspberry Pi Documentation</h4>
|
||||||
<p>To read more about the Raspberry Pi, you can visit the official Raspberry Pi website or explore its Wikipedia page for detailed information on its history, models, and specifications. Additionally, there are numerous online communities and forums where Raspberry Pi enthusiasts share their projects and offer support.</p>
|
<p>To read more about the Raspberry Pi, you can visit the official Raspberry Pi website or explore its Wikipedia
|
||||||
|
page for detailed information on its history, models, and specifications. Additionally, there are numerous
|
||||||
|
online communities and forums where Raspberry Pi enthusiasts share their projects and offer support.</p>
|
||||||
|
|
||||||
<h3>Linux</h3>
|
<h3>Linux</h3>
|
||||||
|
|
||||||
<h4>What is Linux?</h4>
|
<h4>What is Linux?</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Linux is an open-source operating system (OS) that has been around since the mid-1990s. It’s part of the Unix-like family of OSes.</li>
|
<li>Linux is an open-source operating system (OS) that has been around since the mid-1990s. It’s part of the
|
||||||
<li>Unlike proprietary systems like Windows or macOS, Linux is freely redistributable, which means anyone can create their own distribution (distro) for any purpose.</li>
|
Unix-like family of OSes.</li>
|
||||||
<li>The core of Linux is the Linux kernel, which manages the CPU, memory, and peripheral devices. However, when people refer to “Linux,” they often mean the entire OS, including additional software and tools.</li>
|
<li>Unlike proprietary systems like Windows or macOS, Linux is freely redistributable, which means anyone can
|
||||||
<li>Linux is everywhere: from smartphones and cars to supercomputers and home appliances. It powers most of the Internet, top supercomputers, and stock exchanges.</li>
|
create their own distribution (distro) for any purpose.</li>
|
||||||
|
<li>The core of Linux is the Linux kernel, which manages the CPU, memory, and peripheral devices. However, when
|
||||||
|
people refer to “Linux,” they often mean the entire OS, including additional software and tools.</li>
|
||||||
|
<li>Linux is everywhere: from smartphones and cars to supercomputers and home appliances. It powers most of the
|
||||||
|
Internet, top supercomputers, and stock exchanges.</li>
|
||||||
<li>Android, one of the most popular platforms globally, is also based on the Linux kernel.</li>
|
<li>Android, one of the most popular platforms globally, is also based on the Linux kernel.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>Why does the Pi use Linux?</h4>
|
<h4>Why does the Pi use Linux?</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The Raspberry Pi Foundation has a unique mission: to help young people learn how to use computers and improve their tech skills.</li>
|
<li>The Raspberry Pi Foundation has a unique mission: to help young people learn how to use computers and
|
||||||
<li>They created the Raspberry Pi, an affordable computer (costing less than $50) that can be used in schools. It helps students become more confident with computers and learn programming.</li>
|
improve their tech skills.</li>
|
||||||
<li>However, the Raspberry Pi is different from traditional computers, so a specialized OS was needed. That’s where Raspberry Pi OS (formerly Raspbian) comes in.</li>
|
<li>They created the Raspberry Pi, an affordable computer (costing less than $50) that can be used in schools.
|
||||||
<li>Raspberry Pi OS is a lightweight Linux distribution designed specifically for Raspberry Pi. It achieves the foundation’s goals by providing a compatible and user-friendly environment for learning and development.</li>
|
It helps students become more confident with computers and learn programming.</li>
|
||||||
|
<li>However, the Raspberry Pi is different from traditional computers, so a specialized OS was needed. That’s
|
||||||
|
where Raspberry Pi OS (formerly Raspbian) comes in.</li>
|
||||||
|
<li>Raspberry Pi OS is a lightweight Linux distribution designed specifically for Raspberry Pi. It achieves the
|
||||||
|
foundation’s goals by providing a compatible and user-friendly environment for learning and development.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>II - How to use Linux</h2>
|
<h2>II - How to use Linux</h2>
|
||||||
|
|
||||||
<h3>Installation</h3>
|
<h3>Installation</h3>
|
||||||
<p>Install the Raspberry Pi Imager on a computer. This is used to install a .iso file to an SD card or MicroSD card (depending on your Raspberry Pi model). Launch the application and you’ll see the following buttons:</p>
|
<p>Install the Raspberry Pi Imager on a computer. This is used to install a .iso file to an SD card or MicroSD card
|
||||||
|
(depending on your Raspberry Pi model). Launch the application and you’ll see the following buttons:</p>
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img src="img/image1.png" alt="Raspberry Pi Imager Interface">
|
<img src="img/image1.png" alt="Raspberry Pi Imager Interface">
|
||||||
</div>
|
</div>
|
||||||
<p>Select your Raspberry Pi device and the storage device connected to your computer.</p>
|
<p>Select your Raspberry Pi device and the storage device connected to your computer.</p>
|
||||||
|
|
||||||
<p>For the Operating System, if you have a Raspberry Pi 3 or newer, the top option should be OK. Anything older, and you should choose Raspberry Pi OS (Legacy, 32-bit) Lite. Note that this will not install a Desktop Environment (DE), which means everything you’ll do is through the terminal. That might sound scary, but don’t worry. This guide will go over everything you need to know to hit the ground running.</p>
|
<p>For the Operating System, if you have a Raspberry Pi 3 or newer, the top option should be OK. Anything older, and
|
||||||
|
you should choose Raspberry Pi OS (Legacy, 32-bit) Lite. Note that this will not install a Desktop Environment
|
||||||
|
(DE), which means everything you’ll do is through the terminal. That might sound scary, but don’t worry. This
|
||||||
|
guide will go over everything you need to know to hit the ground running.</p>
|
||||||
|
|
||||||
<p>Once you hit next, you should see the popup below:</p>
|
<p>Once you hit next, you should see the popup below:</p>
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img src="img/image2.png" alt="Raspberry Pi Imager Popup">
|
<img src="img/image2.png" alt="Raspberry Pi Imager Popup">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Click <strong>EDIT SETTINGS</strong> and <strong>Set username and password</strong>. This is the only setting you <em>should</em> set, but others are available, such as enabling SSH (Secure Shell protocol). For the time being, let’s skip those since they’re not strictly necessary.</p>
|
<p>Click <strong>EDIT SETTINGS</strong> and <strong>Set username and password</strong>. This is the only setting you
|
||||||
|
<em>should</em> set, but others are available, such as enabling SSH (Secure Shell protocol). For the time being,
|
||||||
|
let’s skip those since they’re not strictly necessary.
|
||||||
|
</p>
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img src="img/image3.png" alt="Raspberry Pi Settings Edit">
|
<img src="img/image3.png" alt="Raspberry Pi Settings Edit">
|
||||||
</div>
|
</div>
|
||||||
@@ -76,33 +105,48 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>SSH vs. Local</h3>
|
<h3>SSH vs. Local</h3>
|
||||||
<p>Using a Raspberry Pi with Linux can be experienced in two distinct ways: through SSH (Secure Shell) or locally by connecting a display directly to the Pi. Here’s a comparison of both methods:</p>
|
<p>Using a Raspberry Pi with Linux can be experienced in two distinct ways: through SSH (Secure Shell) or locally by
|
||||||
|
connecting a display directly to the Pi. Here’s a comparison of both methods:</p>
|
||||||
|
|
||||||
<h4>Using SSH:</h4>
|
<h4>Using SSH:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Remote Access</a>: SSH allows you to control your Raspberry Pi from another computer on the same network or even over the internet.</li>
|
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Remote Access</a>: SSH allows you to control
|
||||||
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Headless Operation</a>: Ideal for running the Raspberry Pi without a monitor, keyboard, or mouse—useful for servers or embedded projects.</li>
|
your Raspberry Pi from another computer on the same network or even over the internet.</li>
|
||||||
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Convenience</a>: Manage your Pi from the comfort of your main workstation, which is especially handy if the Pi is physically inaccessible.</li>
|
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Headless Operation</a>: Ideal for running the
|
||||||
<li><a href="https://randomnerdtutorials.com/raspberry-pi-remote-ssh-vs-code/">Development</a>: Tools like VS Code can connect to the Pi via SSH, enabling you to write and execute code remotely.</li>
|
Raspberry Pi without a monitor, keyboard, or mouse—useful for servers or embedded projects.</li>
|
||||||
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Security</a>: SSH provides encrypted communication, ensuring that your commands and data are secure during transmission.</li>
|
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Convenience</a>: Manage your Pi from the comfort
|
||||||
|
of your main workstation, which is especially handy if the Pi is physically inaccessible.</li>
|
||||||
|
<li><a href="https://randomnerdtutorials.com/raspberry-pi-remote-ssh-vs-code/">Development</a>: Tools like VS
|
||||||
|
Code can connect to the Pi via SSH, enabling you to write and execute code remotely.</li>
|
||||||
|
<li><a href="https://raspberrytips.com/ssh-guide-raspberry-pi/">Security</a>: SSH provides encrypted
|
||||||
|
communication, ensuring that your commands and data are secure during transmission.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>Using Locally:</h4>
|
<h4>Using Locally:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Full Desktop Experience: When a display is connected, you can use the Raspberry Pi’s graphical user interface (GUI) for a complete desktop experience.</li>
|
<li>Full Desktop Experience: When a display is connected, you can use the Raspberry Pi’s graphical user
|
||||||
<li>Peripheral Interaction: Directly interact with connected devices such as keyboards, mice, or other USB peripherals.</li>
|
interface (GUI) for a complete desktop experience.</li>
|
||||||
<li>Educational Use: For learning and teaching, having a monitor connected can be more engaging and easier for beginners.</li>
|
<li>Peripheral Interaction: Directly interact with connected devices such as keyboards, mice, or other USB
|
||||||
<li>No Network Required: Local use doesn’t depend on network connectivity, which can be beneficial in environments with poor or no network access.</li>
|
peripherals.</li>
|
||||||
|
<li>Educational Use: For learning and teaching, having a monitor connected can be more engaging and easier for
|
||||||
|
beginners.</li>
|
||||||
|
<li>No Network Required: Local use doesn’t depend on network connectivity, which can be beneficial in
|
||||||
|
environments with poor or no network access.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>If you are going to utilize SSH, please be sure to check that option in the settings page when you are installing, though this can be enabled in the future.</p>
|
<p>If you are going to utilize SSH, please be sure to check that option in the settings page when you are
|
||||||
|
installing, though this can be enabled in the future.</p>
|
||||||
|
|
||||||
<h2>III - The Power of the Linux Terminal</h2>
|
<h2>III - The Power of the Linux Terminal</h2>
|
||||||
|
|
||||||
<h3>Why use a terminal?</h3>
|
<h3>Why use a terminal?</h3>
|
||||||
<p>A command is just an application. Some commands open a window (a Graphical User Interface or GUI) while others remain in the terminal (referred to as Command-Line Interface or CLI). Many developers create applications that live in the terminal because, frankly, it’s a lot less work. What this means is that small, specialized tools are widely available on Linux since someone likely has already made it.</p>
|
<p>A command is just an application. Some commands open a window (a Graphical User Interface or GUI) while others
|
||||||
|
remain in the terminal (referred to as Command-Line Interface or CLI). Many developers create applications that
|
||||||
|
live in the terminal because, frankly, it’s a lot less work. What this means is that small, specialized tools
|
||||||
|
are widely available on Linux since someone likely has already made it.</p>
|
||||||
|
|
||||||
<p>While there are many, many more commands, this guide will stick to the essentials to get you up and running quickly. The essentials have been divided into the following categories:</p>
|
<p>While there are many, many more commands, this guide will stick to the essentials to get you up and running
|
||||||
|
quickly. The essentials have been divided into the following categories:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>File Operations</li>
|
<li>File Operations</li>
|
||||||
<li>Permissions</li>
|
<li>Permissions</li>
|
||||||
@@ -112,21 +156,35 @@
|
|||||||
<li>Miscellaneous</li>
|
<li>Miscellaneous</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>These commands can be accessed in the terminal and can have many different options (called parameters outside of a program, arguments inside a program). Google is your friend here, but an even better friend is <code>tldr</code>. It provides simple and concise explanations of commands with examples for the most common uses of those commands.</p>
|
<p>These commands can be accessed in the terminal and can have many different options (called parameters outside of
|
||||||
|
a program, arguments inside a program). Google is your friend here, but an even better friend is
|
||||||
|
<code>tldr</code>. It provides simple and concise explanations of commands with examples for the most common
|
||||||
|
uses of those commands.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>Learning these commands will take time. It will at times be frustrating. Like anything worthwhile, it takes time, practice, and patience.</p>
|
<p>Learning these commands will take time. It will at times be frustrating. Like anything worthwhile, it takes time,
|
||||||
|
practice, and patience.</p>
|
||||||
|
|
||||||
<h3>Essential Terminal Commands</h3>
|
<h3>Essential Terminal Commands</h3>
|
||||||
<p>Most commands have different parameters, some optional and some required. This guide will only cover the most common uses of the most common commands. Use <code>tldr</code> command to get more uses for a command. Use <code>man</code> command to get detailed information and all parameters for a command.</p>
|
<p>Most commands have different parameters, some optional and some required. This guide will only cover the most
|
||||||
|
common uses of the most common commands. Use <code>tldr</code> command to get more uses for a command. Use
|
||||||
|
<code>man</code> command to get detailed information and all parameters for a command.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>For most commands, either a full path or relative path may be used for input/output files and directories. Make sure to consider your user access to paths as well. For a command with input and/or output parameters, the input must be a file/directory that your user has access to read. The output must be a file/directory that your user has access to write to.</p>
|
<p>For most commands, either a full path or relative path may be used for input/output files and directories. Make
|
||||||
|
sure to consider your user access to paths as well. For a command with input and/or output parameters, the input
|
||||||
|
must be a file/directory that your user has access to read. The output must be a file/directory that your user
|
||||||
|
has access to write to.</p>
|
||||||
|
|
||||||
<p>Most commands also support wildcard characters. Once you’re familiar with commands, start experimenting with wildcards. Start by reading more <a href="https://www.fosslinux.com/44230/wildcards-in-linux-examples.htm">here</a>.</p>
|
<p>Most commands also support wildcard characters. Once you’re familiar with commands, start experimenting with
|
||||||
|
wildcards. Start by reading more <a
|
||||||
|
href="https://www.fosslinux.com/44230/wildcards-in-linux-examples.htm">here</a>.</p>
|
||||||
|
|
||||||
<h4>File Operations</h4>
|
<h4>File Operations</h4>
|
||||||
|
|
||||||
<h5>cd</h5>
|
<h5>cd</h5>
|
||||||
<p><code>cd</code> is by far the most commonly used command line utility. This changes what directory you are currently in.</p>
|
<p><code>cd</code> is by far the most commonly used command line utility. This changes what directory you are
|
||||||
|
currently in.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -152,7 +210,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>ls</h5>
|
<h5>ls</h5>
|
||||||
<p><code>ls</code> is the second most used command. This command will list files and directories in your current location by default, but there are multiple options.</p>
|
<p><code>ls</code> is the second most used command. This command will list files and directories in your current
|
||||||
|
location by default, but there are multiple options.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -196,7 +255,9 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>touch</h5>
|
<h5>touch</h5>
|
||||||
<p><code>touch</code> has multiple uses. The primary use is to create new file(s). The secondary use is to update the last-accessed timestamp of a file. Note that this command does not create directories, but will update the timestamp of a directory.</p>
|
<p><code>touch</code> has multiple uses. The primary use is to create new file(s). The secondary use is to update
|
||||||
|
the last-accessed timestamp of a file. Note that this command does not create directories, but will update the
|
||||||
|
timestamp of a directory.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -214,7 +275,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>cp</h5>
|
<h5>cp</h5>
|
||||||
<p><code>cp</code> copies a file(s)/directory(ies) to a destination directory. This copies the permissions as well as the file contents themselves. cp writes over any existing output file as well.</p>
|
<p><code>cp</code> copies a file(s)/directory(ies) to a destination directory. This copies the permissions as well
|
||||||
|
as the file contents themselves. cp writes over any existing output file as well.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -236,7 +298,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>mv</h5>
|
<h5>mv</h5>
|
||||||
<p><code>mv</code> moves a file(s)/directory(ies) to a target destination. This can be used to rename a file or directory, or move file(s)/directory(ies) into another location.</p>
|
<p><code>mv</code> moves a file(s)/directory(ies) to a target destination. This can be used to rename a file or
|
||||||
|
directory, or move file(s)/directory(ies) into another location.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -258,7 +321,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>rm</h5>
|
<h5>rm</h5>
|
||||||
<p><code>rm</code> is the delete command, and can remove one or more files at once, and can be used to delete directories as well.</p>
|
<p><code>rm</code> is the delete command, and can remove one or more files at once, and can be used to delete
|
||||||
|
directories as well.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -282,9 +346,14 @@
|
|||||||
<h2>Permissions</h2>
|
<h2>Permissions</h2>
|
||||||
|
|
||||||
<h3>sudo</h3>
|
<h3>sudo</h3>
|
||||||
<p><strong>sudo</strong> allows a command to be run as the root user (see II - How to use Linux). This is most commonly used in conjunction with your package manager (see Installing Applications), but there are many use cases where you’ll want to use it. From editing system configuration files to executing system commands, in Windows terms <code>sudo</code> elevates your command to be run as the Administrator.</p>
|
<p><strong>sudo</strong> allows a command to be run as the root user (see II - How to use Linux). This is most
|
||||||
|
commonly used in conjunction with your package manager (see Installing Applications), but there are many use
|
||||||
|
cases where you’ll want to use it. From editing system configuration files to executing system commands, in
|
||||||
|
Windows terms <code>sudo</code> elevates your command to be run as the Administrator.</p>
|
||||||
<p>Related: <code>su</code></p>
|
<p>Related: <code>su</code></p>
|
||||||
<p>Association: <strong>s</strong>witch <strong>u</strong>ser and <strong>do</strong> || <strong>s</strong>uper <strong>u</strong>ser and <strong>do</strong></p>
|
<p>Association: <strong>s</strong>witch <strong>u</strong>ser and <strong>do</strong> || <strong>s</strong>uper
|
||||||
|
<strong>u</strong>ser and <strong>do</strong>
|
||||||
|
</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -293,7 +362,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>sudo nvim /usr/local/bin/a-custom-script</code></td>
|
<td><code>sudo nvim /usr/local/bin/a-custom-script</code></td>
|
||||||
<td>Since a regular user doesn’t have permission to edit a file in <code>/usr/local/bin</code>, switch to the root user to edit the file.</td>
|
<td>Since a regular user doesn’t have permission to edit a file in <code>/usr/local/bin</code>, switch to
|
||||||
|
the root user to edit the file.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>sudo apt install firefox</code></td>
|
<td><code>sudo apt install firefox</code></td>
|
||||||
@@ -308,16 +378,25 @@
|
|||||||
<h2>Apps</h2>
|
<h2>Apps</h2>
|
||||||
|
|
||||||
<h3>Package Manager == App Store</h3>
|
<h3>Package Manager == App Store</h3>
|
||||||
<p>A package manager is an app store (in coding, the ‘==’ operation is a boolean expression meaning the left and right are the same value). There are a few important differences though.</p>
|
<p>A package manager is an app store (in coding, the ‘==’ operation is a boolean expression meaning the left and
|
||||||
|
right are the same value). There are a few important differences though.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A package manager is “distro-dependent”, meaning it is only available to and is designed for specific Linux distributions and families. A package manager can also be available and designed for use for a specific programming language as well (see Setting Up Programming Languages).</li>
|
<li>A package manager is “distro-dependent”, meaning it is only available to and is designed for specific Linux
|
||||||
<li>A package manager is usually a <strong>C</strong>ommand <strong>L</strong>ine <strong>I</strong>nterface, meaning that your interaction with it is limited to the terminal.</li>
|
distributions and families. A package manager can also be available and designed for use for a specific
|
||||||
<li>If an application is already installed and you attempt to re-install it, the exact behavior can vary but either the package manager aborts the operation or it re-installs the app.</li>
|
programming language as well (see Setting Up Programming Languages).</li>
|
||||||
|
<li>A package manager is usually a <strong>C</strong>ommand <strong>L</strong>ine <strong>I</strong>nterface,
|
||||||
|
meaning that your interaction with it is limited to the terminal.</li>
|
||||||
|
<li>If an application is already installed and you attempt to re-install it, the exact behavior can vary but
|
||||||
|
either the package manager aborts the operation or it re-installs the app.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>Raspberry Pi</h4>
|
<h4>Raspberry Pi</h4>
|
||||||
<p>For the Raspberry Pi, the package manager is <strong>A</strong>dvanced <strong>P</strong>ackage <strong>T</strong>ool, commonly called <code>apt</code>. Packages are applications, with all dependencies and instructions already set up.</p>
|
<p>For the Raspberry Pi, the package manager is <strong>A</strong>dvanced <strong>P</strong>ackage
|
||||||
<p>The <code>install</code> and <code>upgrade</code> sub-commands will typically require some input from you. This comes in the form of simple <code>Y</code> or <code>N</code> prompts typically.</p>
|
<strong>T</strong>ool, commonly called <code>apt</code>. Packages are applications, with all dependencies and
|
||||||
|
instructions already set up.
|
||||||
|
</p>
|
||||||
|
<p>The <code>install</code> and <code>upgrade</code> sub-commands will typically require some input from you. This
|
||||||
|
comes in the form of simple <code>Y</code> or <code>N</code> prompts typically.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -348,13 +427,24 @@
|
|||||||
|
|
||||||
<h2>Coding</h2>
|
<h2>Coding</h2>
|
||||||
|
|
||||||
<p>Linux is a programmer’s playground. Writing code that will modify your system, create applications, and CLI tools, are all easily accessible through Linux. This section will cover how you can write code in the terminal, and how you can run that code.</p>
|
<p>Linux is a programmer’s playground. Writing code that will modify your system, create applications, and CLI
|
||||||
|
tools, are all easily accessible through Linux. This section will cover how you can write code in the terminal,
|
||||||
|
and how you can run that code.</p>
|
||||||
|
|
||||||
<h3>Text Editor</h3>
|
<h3>Text Editor</h3>
|
||||||
|
|
||||||
<h4>NeoVim</h4>
|
<h4>NeoVim</h4>
|
||||||
<p>High-level, Neovim is a customizable and extensible text editor. You can either install a pre-configured Neovim distro (like <a href="https://www.lunarvim.org/">LunarVim</a>, <a href="https://astronvim.com/">AstroNvim</a>, or <a href="https://www.lazyvim.org/">LazyVim</a>) or start from scratch. While you’re learning, a pre-configured distro is going to smooth the learning curve and is the general recommendation for starting out with Neovim. It’ll include modern conveniences like auto-complete, GitHub Copilot, warnings and errors, and more.</p>
|
<p>High-level, Neovim is a customizable and extensible text editor. You can either install a pre-configured Neovim
|
||||||
<p>Eventually, creating a custom configuration is ideal but ultimately not necessary. The keybindings below are the same across distributions. Additionally, most servers will have at least Vi (an ancestor of Neovim) installed. Part of the power of Neovim (and its ancestors Vi and Vim) is the modal interface. Fancy words aside, this just means that you only operate within different modes. In different modes, the keybindings change. This will only cover the most common and necessary keybinds and commands.</p>
|
distro (like <a href="https://www.lunarvim.org/">LunarVim</a>, <a href="https://astronvim.com/">AstroNvim</a>,
|
||||||
|
or <a href="https://www.lazyvim.org/">LazyVim</a>) or start from scratch. While you’re learning, a
|
||||||
|
pre-configured distro is going to smooth the learning curve and is the general recommendation for starting out
|
||||||
|
with Neovim. It’ll include modern conveniences like auto-complete, GitHub Copilot, warnings and errors, and
|
||||||
|
more.</p>
|
||||||
|
<p>Eventually, creating a custom configuration is ideal but ultimately not necessary. The keybindings below are the
|
||||||
|
same across distributions. Additionally, most servers will have at least Vi (an ancestor of Neovim) installed.
|
||||||
|
Part of the power of Neovim (and its ancestors Vi and Vim) is the modal interface. Fancy words aside, this just
|
||||||
|
means that you only operate within different modes. In different modes, the keybindings change. This will only
|
||||||
|
cover the most common and necessary keybinds and commands.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -385,7 +475,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h5>Keybinds:</h5>
|
<h5>Keybinds:</h5>
|
||||||
<p>Part of the power of Neovim is repeatable commands. The commands below can have a number prefix to indicate how many times to perform that command. Eg. <code>50j</code> in command mode translates to moving 50 lines down.</p>
|
<p>Part of the power of Neovim is repeatable commands. The commands below can have a number prefix to indicate how
|
||||||
|
many times to perform that command. Eg. <code>50j</code> in command mode translates to moving 50 lines down.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -445,17 +536,20 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>v</code></td>
|
<td><code>v</code></td>
|
||||||
<td>Enter <code>visual mode</code> (highlighting/selecting) at the cursor’s current location. Select text with navigation keys.</td>
|
<td>Enter <code>visual mode</code> (highlighting/selecting) at the cursor’s current location. Select text
|
||||||
|
with navigation keys.</td>
|
||||||
<td>Visual Mode</td>
|
<td>Visual Mode</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>V</code></td>
|
<td><code>V</code></td>
|
||||||
<td>Enter <code>visual mode</code> at the cursor’s current row. <code>j</code> and <code>k</code> are used to select more rows.</td>
|
<td>Enter <code>visual mode</code> at the cursor’s current row. <code>j</code> and <code>k</code> are used
|
||||||
|
to select more rows.</td>
|
||||||
<td>Visual Mode</td>
|
<td>Visual Mode</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>y</code></td>
|
<td><code>y</code></td>
|
||||||
<td>Copy highlighted text to Neovim’s clipboard. <strong>NOTE:</strong> Neovim’s clipboard is separate from your system clipboard.</td>
|
<td>Copy highlighted text to Neovim’s clipboard. <strong>NOTE:</strong> Neovim’s clipboard is separate from
|
||||||
|
your system clipboard.</td>
|
||||||
<td>Visual Mode</td>
|
<td>Visual Mode</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -510,7 +604,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>:%s/original/new/g</code></td>
|
<td><code>:%s/original/new/g</code></td>
|
||||||
<td>The most common command I use, a highly and easily configurable search and replace. The (optional) <code>%</code> means the entire file. By default, it’ll only apply to the current line. <code>original</code> is the current text and <code>new</code> is the replacement. The (optional) <code>g</code> means every instance on each line. By default, it’ll only apply to the first occurrence.</td>
|
<td>The most common command I use, a highly and easily configurable search and replace. The (optional)
|
||||||
|
<code>%</code> means the entire file. By default, it’ll only apply to the current line.
|
||||||
|
<code>original</code> is the current text and <code>new</code> is the replacement. The (optional)
|
||||||
|
<code>g</code> means every instance on each line. By default, it’ll only apply to the first occurrence.
|
||||||
|
</td>
|
||||||
<td>Advanced Command</td>
|
<td>Advanced Command</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -524,7 +622,8 @@
|
|||||||
|
|
||||||
<h3>Setting Up Programming Languages</h3>
|
<h3>Setting Up Programming Languages</h3>
|
||||||
<p>A broad overview on a handful of languages that you can use with the Raspberry Pi:</p>
|
<p>A broad overview on a handful of languages that you can use with the Raspberry Pi:</p>
|
||||||
<p>Python is the most commonly used language with the Raspberry Pi. Python is known for its syntactic simplicity for novice programmers...</p>
|
<p>Python is the most commonly used language with the Raspberry Pi. Python is known for its syntactic simplicity for
|
||||||
|
novice programmers...</p>
|
||||||
|
|
||||||
<h4>Python</h4>
|
<h4>Python</h4>
|
||||||
<ol>
|
<ol>
|
||||||
@@ -544,7 +643,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>git clone https://github.com/<user>/<repo></code></td>
|
<td><code>git clone https://github.com/<user>/<repo></code></td>
|
||||||
<td>Create a local copy of the remote repo owned by <code><user></code> called <code><repo></code>.</td>
|
<td>Create a local copy of the remote repo owned by <code><user></code> called
|
||||||
|
<code><repo></code>.
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>git clone <remote> <destination></code></td>
|
<td><code>git clone <remote> <destination></code></td>
|
||||||
@@ -576,7 +677,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>git commit</code></td>
|
<td><code>git commit</code></td>
|
||||||
<td>Open your default text editor to create the commit message. Once you save and quit, a new snapshot of your local repo is saved.</td>
|
<td>Open your default text editor to create the commit message. Once you save and quit, a new snapshot of
|
||||||
|
your local repo is saved.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>git commit -m “A commit message.”</code></td>
|
<td><code>git commit -m “A commit message.”</code></td>
|
||||||
@@ -597,7 +699,9 @@
|
|||||||
<h2>Quality of Life Improvements</h2>
|
<h2>Quality of Life Improvements</h2>
|
||||||
|
|
||||||
<h3>man</h3>
|
<h3>man</h3>
|
||||||
<p><strong>man</strong> is used to open instructional information about a particular command, application, or function. The <code>man</code> command is quite powerful, though a touch verbose. It’ll provide information on all possible parameters, uses, and idiosyncrasies.</p>
|
<p><strong>man</strong> is used to open instructional information about a particular command, application, or
|
||||||
|
function. The <code>man</code> command is quite powerful, though a touch verbose. It’ll provide information on
|
||||||
|
all possible parameters, uses, and idiosyncrasies.</p>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Command</th>
|
<th>Command</th>
|
||||||
@@ -605,12 +709,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>man <command></code></td>
|
<td><code>man <command></code></td>
|
||||||
<td>Open the manual for a command, application, or function. Press <code>q</code> to quit, and use <code>j</code> and <code>k</code> to move down and up respectively.</td>
|
<td>Open the manual for a command, application, or function. Press <code>q</code> to quit, and use
|
||||||
|
<code>j</code> and <code>k</code> to move down and up respectively.
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>tldr</h3>
|
<h3>tldr</h3>
|
||||||
<p><strong>tldr</strong> is the concise version of <code>man</code>. Personally, I use <code>tldr</code> almost every day. It provides the most common few uses of a command, application, or function.</p>
|
<p><strong>tldr</strong> is the concise version of <code>man</code>. Personally, I use <code>tldr</code> almost
|
||||||
|
every day. It provides the most common few uses of a command, application, or function.</p>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Command</th>
|
<th>Command</th>
|
||||||
@@ -623,14 +730,189 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>zsh</h3>
|
<h3>zsh</h3>
|
||||||
<p><strong>zsh</strong> is a shell, effectively the programming language your terminal uses. <code>zsh</code> has more customization options available, such as <code>oh-my-zsh</code>, <code>starship</code>, and much more. Using your programming skills to customize your operating system is a deep rabbit-hole that you should at least be aware of.</p>
|
<p><strong>zsh</strong> is a shell, effectively the programming language your terminal uses. <code>zsh</code> has
|
||||||
|
more customization options available, such as <code>oh-my-zsh</code>, <code>starship</code>, and much more.
|
||||||
|
Using your programming skills to customize your operating system is a deep rabbit-hole that you should at least
|
||||||
|
be aware of.</p>
|
||||||
|
|
||||||
<h1>IV - How to unleash the Raspberry Pi’s Potential.</h1>
|
<h1>IV - How to unleash the Raspberry Pi’s Potential.</h1>
|
||||||
|
|
||||||
<h2>Making your own CLI tools</h2>
|
<p><strong>Here is an example script (found <a href="https://github.com/SLCPL-CreativeLab/ras-pi/scripts">here</a>)
|
||||||
<h3>Scripts & automation</h3>
|
which gets your Raspberry Pi setup with some common services.</strong></p>
|
||||||
<h3>Code writing and text creation</h3>
|
<pre class="code">
|
||||||
<h3>Important rules (syntax)</h3>
|
<code>
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script gets a Raspberry Pi setup with essential applications.
|
||||||
|
#
|
||||||
|
# For explanations of commands, visit raspi.vintagecoding.net
|
||||||
|
|
||||||
|
# GLOBAL VARIABLES
|
||||||
|
DOMAIN=""
|
||||||
|
MANUAL_PORT=5090
|
||||||
|
JELLYFIN_PORT=5091
|
||||||
|
OLLAMA_PORT=5092
|
||||||
|
|
||||||
|
# This function initializes core services and packages for getting started.
|
||||||
|
init() {
|
||||||
|
# Update repositories and upgrade installed packages.
|
||||||
|
sudo apt update && sudo apt upgrade;
|
||||||
|
|
||||||
|
# Install requisite packages for cloudflared.
|
||||||
|
sudo apt install curl lsb-release;
|
||||||
|
|
||||||
|
# Add cloudflare gpg key
|
||||||
|
sudo mkdir -p --mode=0755 /usr/share/keyrings
|
||||||
|
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg > /dev/null
|
||||||
|
|
||||||
|
# Add this repo to your apt repositories
|
||||||
|
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' | sudo tee /etc/apt/sources.list.d/cloudflared.list
|
||||||
|
|
||||||
|
# install cloudflared
|
||||||
|
sudo apt-get update && sudo apt-get install cloudflared
|
||||||
|
|
||||||
|
# Install cloudflared.
|
||||||
|
# Install podman, a container technology for easily deploying projects.
|
||||||
|
# Install golang, a server-side programming language.
|
||||||
|
# Install tools for the user
|
||||||
|
sudo apt update;
|
||||||
|
sudo apt install cloudflared podman golang tldr neovim;
|
||||||
|
|
||||||
|
# Get user input for some default applications to get started.
|
||||||
|
read -p "Do you want a mirror of the manual from raspi.vintagecoding.net on this device? (y/N): " MANUAL;
|
||||||
|
MANUAL=$(echo "$MANUAL" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$MANUAL" || "$MANUAL" == "n" ]]; then
|
||||||
|
MANUAL="n"
|
||||||
|
else
|
||||||
|
init_manual;
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -p "Do you want to setup Jellyfin, a personal Netflix alternative? (y/N): " JELLYFIN;
|
||||||
|
JELLYFIN=$(echo "$JELLYFIN" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$JELLYFIN" || "$JELLYFIN" == "n" ]]; then
|
||||||
|
JELLYFIN="n"
|
||||||
|
else
|
||||||
|
init_jellyfin;
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -p "Do you want to setup Ollama, a personal ChatGPT alternative? (y/N): " OLLAMA;
|
||||||
|
OLLAMA=$(echo "$OLLAMA" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$OLLAMA" || "$OLLAMA" == "n" ]]; then
|
||||||
|
OLLAMA="n"
|
||||||
|
else
|
||||||
|
init_ollama;
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function initializes the manual mirror of raspi.vintagecoding.net
|
||||||
|
init_manual() {
|
||||||
|
cd ~/ras-pi/man/pages;
|
||||||
|
|
||||||
|
# This creates what's called a systemd service. These are processes that you create which can start after a reboot.
|
||||||
|
echo "[Unit]
|
||||||
|
Description=Raspberry Pi Manual Mirror
|
||||||
|
After=network.target
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
User=$(whoami)
|
||||||
|
WorkingDirectory=$(pwd)
|
||||||
|
ExecStartPre=/usr/bin/git pull
|
||||||
|
ExecStart=/usr/bin/python3 -m http.server $MANUAL_PORT
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/manual.service;
|
||||||
|
|
||||||
|
sudo systemctl enable manual.service;
|
||||||
|
sudo systemctl start manual.service;
|
||||||
|
sudo systemctl daemon-reload;
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function initializes Jellyfin.
|
||||||
|
init_jellyfin() {
|
||||||
|
# Get the official image of Jellyfin software
|
||||||
|
podman pull ghcr.io/jellyfin/jellyfin;
|
||||||
|
|
||||||
|
echo "Making media directories where Jellyfin will retrieve content.";
|
||||||
|
echo "It is up to you to provide supported files and build a library.";
|
||||||
|
|
||||||
|
cd;
|
||||||
|
mkdir media;
|
||||||
|
|
||||||
|
podman run \
|
||||||
|
--detach \
|
||||||
|
--label "io.containers.autoupdate=registry" \
|
||||||
|
--name myjellyfin \
|
||||||
|
--publish $JELLYFIN_PORT:8096/tcp \
|
||||||
|
--user $(id -u):$(id -g) \
|
||||||
|
--volume jellyfin-cache:/cache:Z \
|
||||||
|
--volume jellyfin-config:/config:Z \
|
||||||
|
--mount type=bind,source=/$HOME/media,destination=/media,ro=true,relabel=private \
|
||||||
|
--restart always \
|
||||||
|
ghcr.io/jellyfin/jellyfin;
|
||||||
|
|
||||||
|
echo "Finished creating the Jellyfin container! It is now live on";
|
||||||
|
echo "http://localhost:$JELLYFIN_PORT. If you enabled it, it'll also be";
|
||||||
|
echo "available at media.yourdomain.com.";
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function initializes Ollama.
|
||||||
|
init_ollama() {
|
||||||
|
echo "This will take a while...";
|
||||||
|
|
||||||
|
cd;
|
||||||
|
curl -fsSL https://ollama.com/install.sh | sh;
|
||||||
|
export OLLAMA_BASE_URL=http://localhost:11434;
|
||||||
|
|
||||||
|
read -p "Do you want to require a login for your AI? (n/Y): " REQUIRE_LOGIN;
|
||||||
|
REQUIRE_LOGIN=$(echo "$REQUIRE_LOGIN" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$REQUIRE_LOGIN" || "$REQUIRE_LOGIN" == "n" ]]; then
|
||||||
|
export WEBUI_AUTH=False;
|
||||||
|
fi
|
||||||
|
|
||||||
|
source $HOME/.bashrc
|
||||||
|
|
||||||
|
# TODO: Write a script so this can be daemonized.
|
||||||
|
python -m venv open-webui-env;
|
||||||
|
source open-webui-env/bin/activate
|
||||||
|
pip install open-webui;
|
||||||
|
|
||||||
|
echo "server {
|
||||||
|
listen 80; #or whatever port your open-webui backend is running on.
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:$OLLAMA_PORT/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection 'upgrade';
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
}
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://localhost:$OLLAMA_PORT/api/; # Ensure the trailing slash is present
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection 'upgrade';
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
}
|
||||||
|
}" | sudo tee/etc/nginx/sites-available/open-webui;
|
||||||
|
sudo ln -s /etc/nginx/sites-available/open-webui /etc/nginx/sites-enabled
|
||||||
|
sudo systemctl enable nginx;
|
||||||
|
sudo systemctl start nginx;
|
||||||
|
|
||||||
|
open-webui serve --port $OLLAMA_PORT &
|
||||||
|
}
|
||||||
|
|
||||||
|
init;
|
||||||
|
</code>
|
||||||
|
</pre>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
var acc = document.getElementsByClassName("accordion");
|
||||||
|
var i;
|
||||||
|
|
||||||
|
for (i = 0; i < acc.length; i++) {
|
||||||
|
acc[i].addEventListener("click", function() {
|
||||||
|
/* Toggle between adding and removing the "active" class,
|
||||||
|
to highlight the button that controls the panel */
|
||||||
|
this.classList.toggle("active");
|
||||||
|
|
||||||
|
/* Toggle between hiding and showing the active panel */
|
||||||
|
var panel = this.nextElementSibling;
|
||||||
|
if (panel.style.display === "block") {
|
||||||
|
panel.style.display = "none";
|
||||||
|
} else {
|
||||||
|
panel.style.display = "block";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Executable
+82
@@ -0,0 +1,82 @@
|
|||||||
|
OPEN_WEBUI_PORT=5092
|
||||||
|
OLLAMA_PORT=11434
|
||||||
|
|
||||||
|
echo "Running `curl -fsSL https://ollama.com/install.sh | sh`";
|
||||||
|
echo "This will take about 5-10 minutes...";
|
||||||
|
curl -fsSL https://ollama.com/install.sh | sh;
|
||||||
|
echo "Ollama has been installed!"
|
||||||
|
|
||||||
|
read -p "Are you using a Raspberry Pi 5 or newer? (y/N)" PI_VERSION
|
||||||
|
PI_VERSION=$(echo "$PI_VERSION" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$PI_VERSION" || "$PI_VERSION" == "n" ]]; then
|
||||||
|
echo "You can still use AI, but it's only available directly on your Raspberry Pi for now.";
|
||||||
|
echo "For more information, see raspi.vintagecoding.net#ollama";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running `python -m venv open-webui-env`. This creates a Python virtual environment, where";
|
||||||
|
echo "we can install applications in an isolated manner from the rest of our Operating System (OS).";
|
||||||
|
python -m venv open-webui-env;
|
||||||
|
source open-webui-env/bin/activate
|
||||||
|
|
||||||
|
echo "Running `pip install open-webui`. This is Python's package manager.";
|
||||||
|
pip install open-webui;
|
||||||
|
|
||||||
|
echo "Setting up Nginx. For more information, visit raspi.vintagecoding.net#nginx";
|
||||||
|
echo "server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:$OPEN_WEBUI_PORT/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection 'upgrade';
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://localhost:$OPEN_WEBUI_PORT/api/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection 'upgrade';
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
}
|
||||||
|
}" | sudo tee /etc/nginx/sites-available/open-webui;
|
||||||
|
|
||||||
|
sudo ln -s /etc/nginx/sites-available/open-webui /etc/nginx/sites-enabled
|
||||||
|
sudo systemctl enable nginx;
|
||||||
|
|
||||||
|
echo "Creating a SystemD service file. These are commands (applications) that you can set to start as soon as you turn on the Pi.";
|
||||||
|
echo "This file is located at `/etc/systemd/system/open-webui.service`.";
|
||||||
|
echo "For more information, see raspi.vintagecoding.net#systemd";
|
||||||
|
|
||||||
|
echo "[Unit]
|
||||||
|
Description=Open WebUI
|
||||||
|
After=network.target
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
User=$(whoami)
|
||||||
|
Environment=WEBUI_AUTH=True
|
||||||
|
Environment=WEBUI_BASE_URL=https://TMP_URL
|
||||||
|
Environment=OLLAMA_BASE_URL=http://localhost:11434
|
||||||
|
WorkingDirectory=$HOME
|
||||||
|
ExecStartPre=/bin/bash -c "source /home/$(whoami)/open-webui-env/bin/activate"
|
||||||
|
ExecStart=/home/$(whoami)/open-webui/open-webui-env/bin/open-webui serve --port $OLLAMA_PORT
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/open-webui.service;
|
||||||
|
|
||||||
|
read -p "Do you want to require login to your AI? (n/Y)" REQUIRE_LOGIN
|
||||||
|
REQUIRE_LOGIN=$(echo "$REQUIRE_LOGIN" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ -z "$REQUIRE_LOGIN" || "$REQUIRE_LOGIN" == "n" ]]; then
|
||||||
|
sudo sed -i -e 's/WEBUI_AUTH=True/WEBUI_AUTH=False/' /etc/systemd/system/open-webui.service;
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload && sudo systemctl enable open-webui.service && sudo systemctl start open-webui.service;
|
||||||
Executable
+65
@@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DOMAIN=""
|
||||||
|
MANUAL_PORT=5090
|
||||||
|
JELLYFIN_PORT=5091
|
||||||
|
OLLAMA_PORT=5092
|
||||||
|
|
||||||
|
read -p "Has the command 'cloudflared tunnel login' been executed? (y/N): " LOGGED_IN
|
||||||
|
LOGGED_IN=$(echo "$LOGGED_IN" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
if [[ -z "$LOGGED_IN" || "$LOGGED_IN" == "n" ]]; then
|
||||||
|
echo "You can still use Cloudflare for free, by generating random URLs."
|
||||||
|
echo "Enter the following into a terminal:";
|
||||||
|
echo " cloudflared tunnel --url=http://localhost:PORT";
|
||||||
|
echo "to get a URL a process, for example. Replace PORT with one of the following:";
|
||||||
|
echo " $MANUAL_PORT (The manual mirror's port.)";
|
||||||
|
echo " $JELLYFIN_PORT (The Jellyfin port.)";
|
||||||
|
echo " $OLLAMA_PORT (The Ollama & Open Web-UI port.)";
|
||||||
|
echo "For more information, visit raspi.vintagecoding.net#cloudflared";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -p "What is your domain name? e.g., vintagecoding.net: " DOMAIN;
|
||||||
|
|
||||||
|
echo "export TUNNEL_ORIGIN_CERT=$HOME/.cloudflared/cert.pem" >> $HOME/.bashrc;
|
||||||
|
source $HOME/.bashrc;
|
||||||
|
|
||||||
|
cloudflared tunnel create raspi;
|
||||||
|
TUNNEL_ID=$(cloudflared tunnel list | awk '/raspi/ {print $1}');
|
||||||
|
|
||||||
|
cd;
|
||||||
|
echo "tunnel: $TUNNEL_ID
|
||||||
|
credentials-file: $(pwd)/.cloudflared/$TUNNEL_ID.json
|
||||||
|
ingress:
|
||||||
|
- hostname: raspi.$DOMAIN
|
||||||
|
service: http://localhost:$MANUAL_PORT
|
||||||
|
- hostname: media.$DOMAIN
|
||||||
|
service: http://localhost:$JELLYFIN_PORT
|
||||||
|
- hostname: ai.$DOMAIN
|
||||||
|
service: http://localhost:$OLLAMA_PORT
|
||||||
|
- service: http_status:404" | tee $HOME/.cloudflared/config.yaml;
|
||||||
|
|
||||||
|
cloudflared tunnel route dns $TUNNEL_ID raspi.$DOMAIN;
|
||||||
|
cloudflared tunnel route dns $TUNNEL_ID media.$DOMAIN;
|
||||||
|
cloudflared tunnel route dns $TUNNEL_ID ai.$DOMAIN;
|
||||||
|
|
||||||
|
echo "[Unit]
|
||||||
|
Description=Cloudflare Tunnel Daemon
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=$(whoami)
|
||||||
|
ExecStart=/usr/bin/cloudflared tunnel run raspi
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cloudflared.service;
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload && sudo systemctl enable cloudflared.service && sudo systemctl start cloudflared.service;
|
||||||
|
|
||||||
|
sudo sed -i -e 's/server_name localhost/servername ai.$DOMAIN/' /etc/nginx/sites-available/open-webui;
|
||||||
|
sudo sed -i -e 's/WEBUI_BASE_URL=localhost/WEBUI_BASE_URL=https://ai.$DOMAIN/' /etc/systemd/system/open-webui.service;
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload && sudo systemctl restart open-webui.service;
|
||||||
Executable
+63
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
JELLYFIN_PORT=5091;
|
||||||
|
|
||||||
|
# Get the official image of Jellyfin software.
|
||||||
|
echo "Running `podman pull ghcr.io/jellyfin/jellyfin`";
|
||||||
|
podman pull ghcr.io/jellyfin/jellyfin &;
|
||||||
|
echo "`podman` is a container technology that allows for easy distribution of software that is platform-agnostic.";
|
||||||
|
echo "Please see raspi.vintagecoding.net#podman for more information.";
|
||||||
|
|
||||||
|
echo "Running `cd && mkdir media;`. This is changing the current directory and MaKing a DIRectory called media.";
|
||||||
|
echo "This is where your movies and TV shows should go.";
|
||||||
|
cd && mkdir media;
|
||||||
|
|
||||||
|
echo "Running
|
||||||
|
`podman run \
|
||||||
|
--detach \
|
||||||
|
--label "io.containers.autoupdate=registry" \
|
||||||
|
--name myjellyfin \
|
||||||
|
--publish $JELLYFIN_PORT:8096/tcp \
|
||||||
|
--user $(id -u):$(id -g) \
|
||||||
|
--volume jellyfin-cache:/cache:Z \
|
||||||
|
--volume jellyfin-config:/config:Z \
|
||||||
|
--mount type=bind,source=$HOME/media,destination=/media,ro=true,relabel=private \
|
||||||
|
--restart always \
|
||||||
|
ghcr.io/jellyfin/jellyfin;`
|
||||||
|
|
||||||
|
Please see raspi.vintagecoding.net#podman for more information about this command.";
|
||||||
|
|
||||||
|
podman run \
|
||||||
|
--detach \
|
||||||
|
--label "io.containers.autoupdate=registry" \
|
||||||
|
--name myjellyfin \
|
||||||
|
--publish $JELLYFIN_PORT:8096/tcp \
|
||||||
|
--user $(id -u):$(id -g) \
|
||||||
|
--volume jellyfin-cache:/cache:Z \
|
||||||
|
--volume jellyfin-config:/config:Z \
|
||||||
|
--mount type=bind,source=$HOME/media,destination=/media,ro=true,relabel=private \
|
||||||
|
--restart always \
|
||||||
|
ghcr.io/jellyfin/jellyfin;
|
||||||
|
|
||||||
|
echo "Creating a SystemD service file. These are commands (applications) that you can set to start as soon as you turn on the Pi.";
|
||||||
|
echo "This file is located at `/etc/systemd/system/jellyfin.service`.";
|
||||||
|
echo "For more information, see raspi.vintagecoding.net#systemd";
|
||||||
|
|
||||||
|
echo "[Unit]
|
||||||
|
Description=Jellyfin
|
||||||
|
After=network.target
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
User=$(whoami)
|
||||||
|
ExecStart=/usr/bin/podman start myjellyfin
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/jellyfin.service;
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload && sudo systemctl enable jellyfin.service && sudo systemctl start jellyfin.service;
|
||||||
|
|
||||||
|
echo "For now, please visit jellyfin.org/docs for information about setting up Jellyfin. We'll have a more comprehensive guide soon.";
|
||||||
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MANUAL_PORT=5090;
|
||||||
|
|
||||||
|
echo "Creating a SystemD service file. These are commands (applications) that you can set to start as soon as you turn on the Pi.";
|
||||||
|
echo "This file is located at `/etc/systemd/system/manual.service`.";
|
||||||
|
echo "For more information, see raspi.vintagecoding.net#systemd";
|
||||||
|
|
||||||
|
echo "[Unit]
|
||||||
|
Description=Raspberry Pi Manual Mirror
|
||||||
|
After=network.target
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
User=$(whoami)
|
||||||
|
WorkingDirectory=$HOME/ras-pi/man/pages
|
||||||
|
ExecStartPre=/usr/bin/git pull
|
||||||
|
ExecStart=/usr/bin/python3 -m http.server $MANUAL_PORT
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/manual.service;
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload && sudo systemctl enable manual.service && sudo systemctl start manual.service;
|
||||||
|
|
||||||
|
echo "For now, this uses the command `python -m http.server 5090` to serve the man/pages on port 5090.";
|
||||||
|
echo "For more information, see raspi.vintagecoding.net#web-servers";
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script gets a Raspberry Pi setup with essential tools.
|
||||||
|
# For explanations of commands, please visit raspi.vintagecoding.net
|
||||||
|
|
||||||
|
# Update repositories and upgrade installed packages.
|
||||||
|
sudo apt update && sudo apt upgrade;
|
||||||
|
|
||||||
|
# Install requisite packages for cloudflared.
|
||||||
|
sudo apt install curl lsb-release;
|
||||||
|
|
||||||
|
# Add cloudflare gpg key
|
||||||
|
sudo mkdir -p --mode=0755 /usr/share/keyrings;
|
||||||
|
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg > /dev/null;
|
||||||
|
|
||||||
|
# Add this repo to your apt repositories
|
||||||
|
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' | sudo tee /etc/apt/sources.list.d/cloudflared.list;
|
||||||
|
|
||||||
|
echo "Installing nginx, cloudflared, podman, golang, tldr, and neovim to get you started. Run `sudo apt install package` to install other applications. Please see";
|
||||||
|
echo "raspi.vintagecoding.net#package-manager for more information.";
|
||||||
|
sudo apt update && sudo apt install nginx cloudflared podman golang tldr neovim;
|
||||||
-1
Submodule services deleted from 75945484ed
@@ -1,7 +0,0 @@
|
|||||||
apt-get update
|
|
||||||
apt-get install go
|
|
||||||
apt-get install cloudflared
|
|
||||||
./services/install.sh
|
|
||||||
serve_page --path ./man/pages --destination / --port 8888
|
|
||||||
echo "Visit http://localhost:8888 to get started!"
|
|
||||||
echo "To temporarily expose a webpage to the internet, use:\n `cloudflared tunnel --url http://localhost:8888"
|
|
||||||
Reference in New Issue
Block a user