Linux-in-the-House.svg


Linux in the House

The amazing things you can do with computer software in your home, ya GNU?


By:

  • Don Cohoon

Website:

RSS:

Feedback:

Book Last Updated: 29-March-2024

Version: 2.280

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


Tux Image By lewing@isc.tamu.edu Larry Ewing and The GIMP, Attribution, https://commons.wikimedia.org/w/index.php?curid=574842

Created with:


Preface

Everyone with some computer skills should take control of your data and programs in your house, with a few minutes work every day to gain knowledge, security, and improve your life.

This guide will walk through from beginner level to intermediate. You should be able to find something useful to you no matter what your current level of experience, even the most advanced. This book will explore mostly the software side (programs) of a home computer, while briefly looking at what hardware will support it.

Advanced users might want to jump ahead at this point to The Most Import Feature of All.

Build Your Own PC at MicroCenter

BuildYourOwnPC.jpg

Reference: https://www.microcenter.com/site/content/howtochooseyourpcparts.aspx


Table of Contents


Not just pieces and parts

It is possible to build a computer from parts, and just as satisfying to have someone else build it. A pre-built PC is like working with a house builder or selecting a new car from the factory. Discovering options available and only pay for what you need will make ownership of the hardware and software more satisfying.

For example, I like small form factor systems that consume less power. Partly to save electrical costs and enable longer run-time on a battery backup (UPS) system. That's why I chose the Intel NUC [1] and BeagleBone [2] Small Board Computer (SBC) systems for light duty jobs like e-mail and cloud, and larger ATX [3] motherboards in a server case for Network Attached Storage (NAS) [4], housing up to five SATA disk drives.

  1. https://www.intel.com/content/www/us/en/products/details/nuc.htm
  2. https://beagleboard.org/bone
  3. https://en.wikipedia.org/wiki/ATX
  4. https://www.truenas.com/truenas-scale/

How to decide

The first thing to think about is what do you want to do. What computing feature of my life would you like to learn about and have control over.

Next consider having a backup plan. Like when bad weather hits, where would you go? Same thing with building your computer system(s). I generally have two pieces of hardware for each task, then document and backup the software. Backup systems can be hand-me-downs or replaced systems and parts to save money.

Finally you have to choose how much time and money you want to invest. Usually time equals money. Some things you may not be comfortable doing just now, and change your mind later when you have more experience.

Why Open Source

After investing your time and money it is a shame to find out that company you bought something from has discontinued your product or gone out of business. This can also occur in Open Source environments if the developers retire, move on or just get tired of working on it.

With Open Source you can obtain the source code and keep it going yourself or find someone you can. Using your skill and knowledge while building your system will provide confidence and know how. Plus there are many resources on the Internet to ask questions, and answer along the way.

Running your services on your own system can provide better security as hackers like to go for bigger targets. Your data is not on someone else's disk (cloud), but your own that only you provide access to. System administrators have access to everything on the computer so be your own Sys Admin over your own data.

Advanced experience affords you the ability to change what you do not like or fix a problem the original owner does not. You have the source code, you can make the change.

Evaluating a Project

Open Source projects will post lots of information about themselves that you can use to decide if it is worth your time to use it.

  1. Does it do what you want
  2. Does it have an active community
  3. When was the last release
  4. Do they care about security
  5. What language does it use
  6. How does it fit on your existing hardware

First I ask myself, "self", "What are you trying to do?" My answers were: e-mail, cloud storage, private contacts and calendar, read the news, monitor the house when I'm out, listen to music, watch a movie or TV, and save my notes where I can find them.

Then search the Internet for Open Source software that seems to do that. Sites like:

are good starters. Avoid sites with lots of advertising, binary downloads and non-secure web servers. Do not download packages unless the Linux package manager cannot find it. Just look to see if the things you want are available, what the name is, then do

$ sudo apt search <name>

to see if it is already packaged for you. This way you get secure software and it will be updated automatically.

Linux packages are a sign of active development and the distributions

should have origination support website links back to each project. Remember once you pick a Linux distribution, you need to stick with it's packages.

Smaller products can be found on github.com [1] and gitlab.com [2] and are generally compatible with any distribution.

  1. https://github.com/search
  2. https://gitlab.com/explore/projects

Be Curious, Just Try

Take some time to read the use-case and security pages. Passwords should be encrypted, network access should be none or limited, test cases should be extensive and developer participant counts made available. If you open this to the internet, expect hackers to come at it, so error logging is a must.

Find out what programming language(s) they use, because you should have a quick look at it to decide if it is readable and something you might tackle if needed. Otherwise be prepared to discard it if a big problem arises. When you get some time, try learning bash [1], Python [2], C [3], C++ [4], and Rust [5]. That will have you covered for most projects, and open up new doors of fun.

Lastly think about what computer will run it, does it have enough disk, memory, cpu and backup methodologies.

  1. https://linuxconfig.org/bash-scripting-tutorial-for-beginners
  2. https://www.learnpython.org/
  3. https://www.cprogramming.com/
  4. https://www.codecademy.com/learn/learn-c-plus-plus
  5. https://google.github.io/comprehensive-rust/welcome.html

Ok, Jump in the Water, it's Just Fine

Now you obtain the hardware, load up an operating system, and start installing packages to do something useful.

  • Buy or find hardware
  • Pick and install a Linux distribution on it
  • Install packages 😃

For me I chose Ubuntu because it's been around a long time, supports all my hardware, has good package support and I've used it for years. BeagleBone SBC comes with Debian, which Ubuntu is built from, so I stick with it. My laptop is Linux Mint, which has a nice user interface.

My hardware is three levels:

  1. Small: BeagleBone AI and AI-64 single board computers (SBC) [1]. Applications: News, Music
  2. Medium: Intel NUC [2] boxes with SSD and NVME storage, and about 16~32MB of memory. The included one ethernet and graphics built onto the motherboard seem to work just fine for my usage. Also consider a laptop, Dell XPS-13 [3] is a good one, as well as System76 [4]. Applications: E-Mail, Cloud, Home Automation
  3. Large: Gigabyte ATX motherboard [5] with SATA disk drive connections for NAS. Seagate Ironwolf 2TB disk drives, and 64GB of memory. Applications: NAS

Try to install applications on suitable boxes, and don't forget battery backup to save the life of your computers from dropouts, surges, and spikes in electrical power. APC has a nice 865w back-ups [6] with an extention battery pack [7] that will run several systems for several hours. With less power demand, the longer a battery backup will last. One nice thing about laptops; built-in battery backup.

  1. https://beagleboard.org/bone
  2. https://www.intel.com/content/www/us/en/products/details/nuc.htm
  3. https://www.dell.com/en-us/shop/dell-laptops/xps-13-laptop/spd/xps-13-9315-laptop
  4. https://system76.com/laptops
  5. https://www.microcenter.com/site/content/howtochooseyourpcparts.aspx
  6. https://www.apc.com/us/en/product/BR1500G/apc-backups-pro-1500va-865w-tower-120v-10x-nema-515r-outlets-avr-lcd-user-replaceable-battery/
  7. https://www.apc.com/us/en/product/BR24BPG/apc-backups-pro-external-battery-pack-for-1500va-backups-pro-models-formerly-backups-rs-1500/

Distribution Install

This is documented well, and may change slightly from release to release so I will not waste time or space here, just list the common websites.

Common Linux Distributions:

Download and installation for Ubuntu can be found here:

https://ubuntu.com/tutorials/install-ubuntu-desktop

Get Familiar with the Command Line

Linux command line for beginners: https://ubuntu.com/tutorials/command-line-for-beginners#1-overview

Bash Guide for Beginners: https://tldp.org/LDP/Bash-Beginners-Guide/html/index.html

Advanced Bash-Scripting Guide: https://tldp.org/LDP/abs/html/index.html

Command line handbook: https://linuxhandbook.com/a-to-z-linux-commands/

Use man <command> to read the man page at the comand line for any Linux command.

Example:

  • <space> or CTRL-F to go forward
  • CTRL-B to go back
  • /<word> to search the page for <word>
  • q to quit
$ man rsync
rsync(1)                          User Commands                         rsync(1)

NAME
       rsync - a fast, versatile, remote (and local) file-copying tool

SYNOPSIS
       Local:
           rsync [OPTION...] SRC... [DEST]

       Access via remote shell:
           Pull:
               rsync [OPTION...] [USER@]HOST:SRC... [DEST]
           Push:
               rsync [OPTION...] SRC... [USER@]HOST:DEST

       Access via rsync daemon:
           Pull:
               rsync [OPTION...] [USER@]HOST::SRC... [DEST]
               rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
           Push:
 Manual page rsync(1) line 1 (press h for help or q to quit)
Edit Files

Learn how to edit files with vi here [1] (thanks to the University of Tennessee)

  1. https://www.jics.utk.edu/files/images/csure-reu/PDF-DOC/VI-TUTORIAL.pdf
Tilde - text editor from the 1990's 🤔

Or edit with a simple text editor, tilde [1]. Hint: to open the file menu use ESC+F, Edit menu is ESC+E.

$ sudo apt-get install tilde
$ tilde

tilde-text-editor.png

  1. https://github.com/gphalkes/tilde

Most Important Feature of All

SECURITY of course!

Do not skimp on security. If you think it is hard, try recovering from Identity Theft or Ransomware. Lock the windows and doors to your computer.

Security Tips:

  • Start with your router.

    • Change the administrative password BEFORE connecting to the Internet.
    • Make sure all ports are closed for incoming access.
    • Read => RouterSecurity.org [1] <= for excellent advice.
  • Use a password manager.

    • KeePassXC [2] is a multi platform, offine database. It works on Linux, Phone, Windows, and Mac.
    • Sync your password database with your own service. Nextcloud is excellent and easy.
  • Set your passwords.

    • Do not keep the default password for any application.
    • Use different passwords for EVERY app.
  • Look at your log files and e-mail alerts.

    • The next steps will have services like Logwatch and Fail2ban. Read the messages filtered out by them.

Remember the old saying; An ounce of prevention is worth a pound of cure.

  1. https://routersecurity.org/
  2. https://keepassxc.org/

Go to => Setup a New Server

Proceed in the order presented, some things are depending on prior setups.

Conventions used in this book

Text in code block format, like this -> code block, are meant to be executed on the Linux command line, or text to be copied into a configuration file.

Commands like $ sudo ..., shoud not type in the dollar sign ($). Just start with sudo .... The dollar sign is a common Linux prompt.

All files have their code blocks preceeded by -> File: .

Anything surrounded by angle brackets, like , is meant to be substituted by your particular name without the angle brackets.

Hyperlinks in the document will open in the current web browser page. To open in a new tab/window use right-click and select 'open in new tab' from the on screen menu.

All host names are given as example.com. You are expected substitute your domain name. Also check the hostname, as www and mail hosts may not exist on your network.

RedHat and Debian differ in some commands, usually system administration. To show these alternatives without cluttering up the page, collapsable blue bars will be shown, like this:

Debian

Hi from Debian!

RedHat

Hi from RedHat!

Book Last Updated: 29-March-2024



Introduction - Linux in the House - https://linux-in-the-house.org Creative Commons License