Saturday, April 28, 2018

Week 7: Chapter 14: Installing Software

John George Bauer-Buis
2018-04-28
NET-140-001N

This first section is a synopsis of the chapters using the headings and subheadings from the textbook, with descriptions in my own words.
 

Chapter 14: Installing Software
    •    On GNU/Linux systems, software is normally ultimately installed using a package manager, whether it is controlled directly through the command line or indirectly through a graphical user interface.  Package managers will install dependencies, other packages required to use a package, if they are not already present.  Package managers keep track of what versions of what packages are actually installed, along with which files belong to which package.  You need to have administrator privileges to install, upgrade or remove software.  This is normally accomplished with the su or sudo commands, which require typing retyping your password if you have the appropriate privileges first, for security reasons.
    •    RPM-Based Distributions (Red Hat Derived), such as Red Hat Enterprise Linux, Fedora, Yellow Dog (https://distrowatch.com/table.php?distribution=yellowdog), etc. use rpm or yum to manage packages. 
    •    DEB-Based Distributions, such as Debian (which originated this package format), Ubuntu  and its variants, and many other distributions, including some Puppy Linux variants, use the Advanced Packaging Tool, or APT, as well as aptitude, which is designed to be more user friendly (https://askubuntu.com/questions/347898/whats-difference-of-apt-get-and-aptitude).  These distributions also can access the package manager directly through dpkg. 
    •    Both yum and apt use a similar, more human-readable and user-friendly syntax for commands, while rpm and dpkg are more terse and opaque. 


Observations:
I have manually installed things using apt or aptitude before, such as Spotify, rEFInd (a boot manager for EFI systems) and the official Google Chrome, as well as Steam.  I believe dpkg also has a GUI, although so far I don’t think I’ve used it more than once or twice.  I usually use the *Ubuntu store to install things if possible, since it is easy to search for software in it.

https://www.syncfusion.com/ebooks/linux

I may add to this post at a later date if I discover more useful information that I think I should feature here.

Sunday, April 15, 2018

Week 6: Chapter 10 and 11

John George Bauer-Buis
2018-04-15
NET-140-001N

This first section is a synopsis of the chapters using the headings and subheadings from the textbook, with descriptions in my own words.

Chapter 10: I/O Redirection
There are three standardized streams for input and output (I/O): standard input (stdin), standard output (stdout), and standard error (stderr, which is a special output stream).  (They are also used in C/C++ programming, so they are familiar to Windows programmers from there.) Streams are assigned file descriptors: input is 0, output is one, and error is 2.  They each represent open files to make it possible to interact with them in the same way as files, reading from them and writing to them.  They can be redirected to be used as input or output for each other in as well, just like other programs.
Control d or Ctrl-d is the command to produce an End-Of-FIle (EOF) marker, if one is not present. This is important when ending something sourced from stdin, which doesn’t normally add one by default.
Chapter 11: Additional Command Line Concepts
    •    Aliases can be used to shorten repeated commands, or make more memorable names for commands.  An alias is only temporary unless it is added to a user’s personal initialization files.
    •    Personal Initialization Files can be used to customize the shell when logging in, and are placed in ~/.bashrc or ~/.bash_profile. They are obtained by the shell using the source command, which both reads and executes them.
    •    Shell History will save previous commands, which are written to the file ~/.bash_history, with a default size of 500.  The history command will display the commands saved in the shell history, and giving it a number (history N) as an argument will repeat the command from that line in the file, I have found that if the value is too large it is ignored. The command !! will repeat the previous command, the command !N with N being a numerical argument can be substituted for history N as well.  The command !characters or history characters will run the last command with those characters in the shell history.  The shell history can be searched with control r (Ctrl-r), which lets the user search through commands by typing some characters.  As is usual in the *NIX CLI, pressing Enter runs the command, and Control c (Ctrl-c) is used to quit without doing anything.
    •    Tab Completion is somewhat obvious, in that pressing the Tab key attempts to complete an incomplete command (not order a carbonated drink for you as Homer Simpson thinks).  In the case of multiple possibilities, pressing the tab key again will show them all.  This also works for the names of files and directories, which is quite convenient.
    •    Line Continuation is achieved by using the backslash (\) at the end of the line to extend it onwards.  The greater than symbol (>) is used to show this in the CLI so the user is aware that the line is being continued.

I may add to this post at a later date if I discover more useful information that I think I should feature here.

Sunday, March 25, 2018

Week 5

John George Bauer-Buis
2018-03-25
NET-140-001N

This first section is a synopsis of this chapter using the headings and subheadings from the textbook, with descriptions in my own words.

    •    Synopsis: Chapter 8 Deleting, Moving, and Renaming Files and Directories
    ⁃    The rm command removes files, and can remove directories as well when applied recursively with the -r option.  It can also be forced with the -f option.
    ⁃    Asterisks (*) can be used to match directories and files as a wildcard character when searching for or removing files.  Since hidden files and directories on *NIX systems begin with a period character (.), it is necessary to include that when searching for them.
    ⁃    The copy command, cp, creates duplicates, and works in a similar way to the move command, mv.  Both the move and copy commands can require a source and destination, like this:  cp existingFileLocation newFileLocation and mv originalFileLocation newFileLocation.  Likewise, both move and copy can be used interactively, which allows the user to avoid overwriting any existing data at the new location.  The copy command can also be used recursively, either copying it into the existing directory if that is the destination, or creating it if it does not exist.

    •    Synopsis: Chapter 9 Finding, Sorting, and Comparing Files and Directories
    ⁃    The find command can be used to search for items, especially grouping or showing only some of them by different criteria, such as then name (-name something, and case-insensatively with -iname something), by age (-mtime ageInDays), size (-size theActualSize), etc. 
    ⁃    The locate command is extremely similar to the find command, but it searches a database instead. Since the database is only updated daily, if it’s configured at all, it is not perfect, either.
    ⁃    Sorting inside files can be done with the sort command.
    ⁃    Comparing files can be done with the diff, sdiff, and vimdiff (which uses Vim) to compare files.  They are used the same way as the the copy and move commands, with the names of the two files after the command, although in this case the order does not necessarily make a difference.

I may add to this post at a later date if I discover more useful information that I think I should feature here.

Sunday, March 11, 2018

Week 4

John George Bauer-Buis
2018-03-11
NET-140-001N

Synopsis: Chapter 7  Viewing and Editing Files

  • Editing Files
    • Nano is a basic editor that can meet basic raw text editing needs.  It’s not so good for dealing with fonts and things of that nature, not being a word processor.  It has become my go-to editor for editing simple text files on *NIX systems from a CLI, in part due to its discoverability.
  • The Vim Editor
    • Vi and its successor, Vim, have three modes. On GNU systems, Vi is normally an alias of Vim, and redirects to it when it is run.
    • In Command Mode, Vim accepts commands from the user to do different things.  There are quite a few different commands that can be input, and distinctly, there are multiple modes for commands.
    • In Insert Mode, the user can enter or delete text from a file.  If the user is writing a document, they will spend a lot of time in this mode.
    • Line Mode is a more advanced command mode, (which it is sometimes called,) that offers additional features.  Typing a colon (:) in Command Mode enters it.
    • Commands can be Repeated by using a number as a prefix, such as 5i to insert 5 lines.
  • Emacs
    • Emacs is both a command-line and graphical editor, it can be used in either way.
  • Graphical Editors
    • Besides the graphical version of Emacs, there is also a graphical version of Vim, which is called gVim.  Additionally, there also exist gedit, geany, and the well known word-processor LibreOffice, to name a few other programs with graphical text-editing capabilities.  I have used geany on at least a few occasions, and have found it to not be resource-hungry, unlike some development tools and office suites.

Other Observations:
LibreOffice was developed from OpenOffice.

I may add to this post at a later date if I discover more useful information that I think I should feature here.

Sunday, February 25, 2018

Week 3

John George Bauer-Buis
2018-02-24
NET-140-001N

Synopsis: Chapter 6 Permissions
This first section is a synopsis of this chapter using the headings and subheadings from the textbook, with descriptions in my own words.
  • Intro and Decoding Permissions
    • There are different categories for files.  Various different characters or symbols are used to represent them, such as a - (hyphen/dash) for regular files such as text files and binaries, b for block files, c for character files
    • There are three types of permissions that can be granted for a file or directory/folder: read (r), write (w), and execute/run (x).
  • Changing Permissions
    • Changing permissions is actually fairly simple. There are two methods:  Symbolic (letter based) permissions and Numeric Based Permissions.  Both methods use the change mode command, chmod, to apply them.
    • Symbolic permissions are the rwx as already described.  They are applied or removed with the chmod command and the +,-, and = operator to add, remove or set as equivalent, respectively, the read, write, and execute bits of the underlying binary permissions settings.  
    • Numeric Based Permissions are the underlying method that permissions are applied with.  To use them directly, they are applied in 3 digit (owner, group, and everyone) codes.  Each digit has multiple possible values with specific meanings. 7 grants all permissions (read, write, execute), 6 grants read and write, 5 read and execute, 4 read only
    • Commonly Used Permissions include:  rwx------ or 700, allowing the owner full permissions and none for their group nor everyone else; rw-rw-r-- or 664, which allows the user and their group to read and write but not execute the file
    • Working with Groups
      • As I’d mentioned, groups are users that share the same permissions for a file.  Groups can be used to control permissions for shared computers, such as file servers or workstations.  The chgrp command is used to change the group a file is shared with.
    • Directory Permissions
      • Directories can have permissions set the same way as files can, although directories need their permission set carefully or it may be impossible to run files within them.
    • Default Permissions and the File Creation Mask
      • Adding or subtracting permissions allows the setting of different permissions for files than the directory they are located in.
    • Special Modes
      • It is possible to run files as other users, so the umask (user mask) will return a fourth digit when the command umask is run by itself, to display the actual umask.

Observations and questions:
I notice that odd digits of permissions are always executable, although even numbers can be read, write, or both.  It can often be easier to add permissions for a user or group than to change the entire permissions settings.  I tend towards adding permissions as needed rather than just granting all permissions to everyone if I can’t do something with a file that I need to do, usually writing to a directory or editing a file, sometimes running a file without moving it to some obscure spot.  This is definitely a chapter that I will refer back to as needed, since numerical commands are not terribly memorable, at least for me, although I already remember that 7 is all permissions for a given user, group or for all users depending on position, and 6 just read and write.

This article on umask (user mask) might be useful:  https://www.linuxnix.com/umask-define-linuxunix/

I may add to this post at a later date if I discover more useful information that I think I should feature here.

Sunday, February 11, 2018

Week 2

Synopsis: Chapter 2 Linux Directory Structure
This first section is a synopsis of the chapter using the headings and subheadings from the textbook, with descriptions in my own words.

  • Common Top-Level Directories

    • / The Root Directory
      • Everything else is located below the root directory.
      • Full access to root is usually restricted, especially on multi-user systems like servers.
    • /bin Binaries
      • Programs are stored in the directory for binaries, since they normally are in that format to run.
      • The directory /usr/bin is home to user installed binaries.
      • A convention that I am aware of is that normally, binaries need to be placed in a directory named bin to run, although it usually can be any directory named bin.
    • /etc System Configuration Files
      • The Et Cetera directory is used to store system configuration files, such as screen resolution, other X Window System settings, and network settings, to name a few..
    • /home Home Directories
      • The Home directory is a user’s primary directory to use.  The user’s own files are kept here.
    • /opt Optional or Third-Party Software
      • Most user-installed programs are located here, such as Spotify or Chrome.
    • /tmp Temporary Space
      • Files that are only needed temporarily are normally stored in a temporary space directory, such as caches and compressed software downloads.
    • /usr User-Related Data, Read-Only
      • This is where user installed software and its documentation is located.
    • /var Variable Data
      • Logs and such are normally stored in variable data directories.
  • Application Directory Structures
    • There isn’t much I can say about this, other than that the paths typically are either usr/local/applicationName or opt/applicationName.  Also, sometimes libraries or logs used by a program are located in places like /var/opt/applicationName as well.
  • Organizational Directory Structures
    • Sometimes directories are named after teams or organizations, such as /MCC or /Romanov.

Questions and Observations
I am not sure what is the practical difference, besides the name and location, between usr/local and usr/bin.  Is it that usr/bin contains only binaries while usr/local can contain other types of files as well?  I’m also unsure as to what the practical difference between usr/local and /opt, .  It’s worth noting that the file system root is not exactly analogous to C:/ on Windows, because other drives are not mounted below C:/ on Windows, rather they have their own drive letters.  On GNU/Linux and UNIX systems, root is the directory that is at the root of the directory tree, hence the name root.  

Here is a link (https://youtu.be/vjMZssWMweA) to an interesting Documentary about GNU/Linux.

Saturday, January 27, 2018

Week 1

I am already quite familiar with Linux, in particular Ubuntu variants.  
A good question, although I already understand what the answer is: just what is UNIX?  
I know that UNIX is one of the oldest operating systems still widely in use today, 
and I know that it was originally a product of Bell Labs developed from 1969 onwards.

I am already familiar with the abbreviation ‘distro’ for distribution.  
I have actually used most of the variants found on the list, 
primarily to install in virtual machines to find out what the user experience is like.  
Of the distros on the list, I have used Linux Mint, Ubuntu (and other non-Mint variants, such as Lubuntu,)  
Debian, Fedora, openSUSE, and I think CentOS.  
I did use Red Hat Linux before it was enterprise-only for a little while before migrating to Fedora.  
I have only installed Ubuntu (including variants) and Red Hat/Fedora on actual physical hardware.  

I am not ashamed to admit that I learned much of what I know about the history, present, 
and future of computing from reading articles on Ars Technica, Macrumors, Wikipedia, and ZDNet.

I’m glad that I already am familiar with this topic, and since there are no labs in this chapter, 
I cannot comment on that.