diff --git a/man/pages/index.html b/man/pages/index.html index f3a78d4..664abf6 100644 --- a/man/pages/index.html +++ b/man/pages/index.html @@ -110,7 +110,7 @@

Installation

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:

- Raspberry Pi Imager Interface + Raspberry Pi Imager Interface

Select your Raspberry Pi device and the storage device connected to your computer.

@@ -118,17 +118,17 @@

Once you hit next, you should see the popup below:

- Raspberry Pi Imager Popup + Raspberry Pi Imager Popup

Click EDIT SETTINGS and Set username and password. This is the only setting you should 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.

- Raspberry Pi Settings Edit + Raspberry Pi Settings Edit

Now, wait until the installation is complete!

- Raspberry Pi Installation Progress + Raspberry Pi Installation Progress

SSH vs. Local

@@ -335,5 +335,358 @@ +

Permissions

+ +

sudo

+

sudo 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 sudo elevates your command to be run as the Administrator.

+

Related: su

+

Association: switch user and do || super user and do

+ + + + + + + + + + + + + + + + + + +
CommandDescription
sudo nvim /usr/local/bin/a-custom-scriptSince a regular user doesn’t have permission to edit a file in /usr/local/bin, switch to the root user to edit the file.
sudo apt install firefoxInstalling, updating, upgrading, and removing packages requires sudo (see Apps).
sudo cp new-script /usr/local/binCopy a new script to a globally accessible script location (see IV - Making your own CLI tools).
+ +

Apps

+ +

Package Manager == App Store

+

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.

+ + +

Raspberry Pi

+

For the Raspberry Pi, the package manager is Advanced Package Tool, commonly called apt. Packages are applications, with all dependencies and instructions already set up.

+

The install and upgrade sub-commands will typically require some input from you. This comes in the form of simple Y or N prompts typically.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandDescription
sudo apt updateCheck if any packages have a new version available.
sudo apt install firefoxInstall the Firefox web browser.
sudo apt remove firefoxUninstall the Firefox web browser.
sudo apt upgradeUpgrade every package installed with apt to the latest version.
apt search firefoxFind a package based upon search criteria.
+ +

Coding

+ +

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.

+ +

Text Editor

+ +

NeoVim

+

High-level, Neovim is a customizable and extensible text editor. You can either install a pre-configured Neovim distro (like LunarVim, AstroNvim, or LazyVim) 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.

+

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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandDescriptionCategory
nvimOpen a new file. The file is created with its contents once you save.Basic file creation
nvim file.txtOpen a file called file.txt.Open a file
nvim .Open the current directory in Neovim, using netrw.Enter netrw
nvim a-directoryOpen a directory from a path, using netrw.Enter netrw
+ +
Keybinds:
+

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. 50j in command mode translates to moving 50 lines down.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeybindDescriptionCategory
hMove the cursor left a column, but in the same row.Navigation
jMove the cursor down a row, and attempt to preserve the column.Navigation
kMove the cursor right a column, but in the same row.Navigation
lMove the cursor up a row, and attempt to preserve the column.Navigation
wMove the cursor to the start of the next word or special character, ignoring whitespace.Navigation
bMove the cursor to the start of the previous word or special character, ignoring whitespace.Navigation
iEnter insert mode, the primary typing mode.Insert Mode
IEnter insert mode at the start of the current line.Insert Mode
SEnter insert mode after clearing the current line.Insert Mode
AEnter insert mode at the end of the line.Insert Mode
vEnter visual mode (highlighting/selecting) at the cursor’s current location. Select text with navigation keys.Visual Mode
VEnter visual mode at the cursor’s current row. j and k are used to select more rows.Visual Mode
yCopy highlighted text to Neovim’s clipboard. NOTE: Neovim’s clipboard is separate from your system clipboard.Visual Mode
"*yCopy highlighted text to your system clipboard.Visual Mode
uUndo.Special Function
pPaste text from Neovim’s clipboard.Special Function
:ExEnter Neovim’s file explorer, netrw.Enter netrw
%Create a file inside the current directory.netrw keybinds
dCreate a new directory inside the current directory.netrw keybinds
DDelete a file or empty directory.netrw keybinds
:w {filename}Write (save) the current file. You can specify a filename as well.File Management
:qQuit (exit without saving) the current file.File Management
:wqWrite (save) and quit (exit) the current file.File Management
:%s/original/new/gThe most common command I use, a highly and easily configurable search and replace. The (optional) % means the entire file. By default, it’ll only apply to the current line. original is the current text and new is the replacement. The (optional) g means every instance on each line. By default, it’ll only apply to the first occurrence.Advanced Command
EscapeExit current mode.Exit mode
+ +

Nano - TODO

+ +

Setting Up Programming Languages

+

A broad overview on a handful of languages that you can use with the Raspberry Pi:

+

Python is the most commonly used language with the Raspberry Pi. Python is known for its syntactic simplicity for novice programmers...

+ +

Python

+
    +
  1. Run sudo apt install python.
  2. +
  3. Verify the installation was successful with python --version.
  4. +
  5. Verify that the python package manager was installed with pip --version.
  6. +
+ +

Git Essentials

+

Git is a critical component of modern software development...

+ +

git clone

+ + + + + + + + + + + + + +
CommandDescription
git clone https://github.com/<user>/<repo>Create a local copy of the remote repo owned by <user> called <repo>.
git clone <remote> <destination>Clone a remote repository and save it in a directory called <destination>.
+ +

git stage

+ + + + + + + + + + + + + +
CommandDescription
git stage -AInclude all changes in the commit.
git stage <file>Add a file you want to include in the commit.
+ +

git commit

+ + + + + + + + + + + + + + + + + +
CommandDescription
git commitOpen your default text editor to create the commit message. Once you save and quit, a new snapshot of your local repo is saved.
git commit -m “A commit message.”Create the snapshot with a commit message.
git commit --allThis option auto-stages your changes for the commit, so you do not need git stage.
+ +

git push

+

git push will attempt to upload your commit(s) to the remote repository.

+ +

git pull

+

git pull will download the latest changes from the remote repository.

+ +

Quality of Life Improvements

+ +

man

+

man is used to open instructional information about a particular command, application, or function. The man command is quite powerful, though a touch verbose. It’ll provide information on all possible parameters, uses, and idiosyncrasies.

+ + + + + + + + + +
CommandDescription
man <command>Open the manual for a command, application, or function. Press q to quit, and use j and k to move down and up respectively.
+ +

tldr

+

tldr is the concise version of man. Personally, I use tldr almost every day. It provides the most common few uses of a command, application, or function.

+ + + + + + + + + +
CommandDescription
tldr <command>Get quick information about a command, application, or function.
+ +

zsh

+

zsh is a shell, effectively the programming language your terminal uses. zsh has more customization options available, such as oh-my-zsh, starship, 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.

+ +

IV - How to unleash the Raspberry Pi’s Potential.

+ +

Making your own CLI tools

+

Scripts & automation

+

Code writing and text creation

+

Important rules (syntax)

+