Linux mini-computer (Raspberry Pi) specs
1. MicroUSB 5 V Power source (consumption between 0.5W and 1W)
2. HDMI video output
3 and 4. USB Ports (4)
5. Storage: MicroSD.
6. The GPIO header has grown to 40 pins, while retaining the same pinout for the first 26 pins as the Model A and B.
7. Network: 10/100Mbps Ethernet (or USB WiPi)
8. Video input: 15-pin MIPI camera interface (CSI) connector



Operating systems:
Raspbian (Debian Linux) image on two micro SDs
Fedora (Red Hat Linux) image on the other micro SD

Raspbian: To review network / internet connectivity use command: sudo nano /etc/network/interfaces



The ethernet connection is referenced with eth0. For a static IP address, iface eth0 inet static is used. For a dynamic IP address, the word static would be replaced with DHCP (dynamic host configuration protocol).

Though commented out (#) in the image, the wifi connection (wipi if using Raspberry Pi) is referenced with wlan0. The wifi network name ("wifinetwork") is set with wpa-ssid. The wifi network password "******" is set with wpa-psk.

(Ctrl+X, Y, Enter to return to command-line)

With network connectivity established, the command "ifconfig" on Raspbian or "ip addr" on Fedora displays the ip address to be used to remotely access the machine via SSH secure shell.

blacklist: modules can be disabled with blacklist command
cat: catenate reads data from files and outputs the contents, easy way to display contents of a file on the command line
dmesg: shows hardware log. dmesg -C clears log on connected hardware. Clear the hardware log (dmesg -C) and insert a USB drive. dmesg command will show USB was added.
dnf: is not abbreviation, just a project name for the yum package manager replacement
ifconfig (Raspbian-Debian): display and analyze network interface. To include ifconfig on Fedora, install with commands: "sudo yum provides ifconfig" and "sudo yum install net-tools"
ip addr (Fedora-Red Hat): display and analyze network interface
kill: kill a process by pid
ls: list files, folders (ls -Fal = F: File system indicator, a: all files including hidden, l: long-listing format)
lsusb (list usb devices)
lsblk (list block device)
lsmod (list loaded drivers: lsmod | grep sr_mod performs search for a specific driver)
modprobe: loads drivers and permits loading drivers with options (/sys/module/)
rpm: RedHat Package Manager
shutdown: command shuts down computer and can notify users (shutdown -r +10 "reboot in 10 minutes"), cancel a shutdown with shutdown -c
start: start a process by pid
tac: same as cat, sorts data in opposite direction
top: -p 1 will show the first command (init)
tty: teletypewriter, /sys/devices/virtual/tty/ is a folder containing the virtual terminals , multiple virtual terminals run inside the tty folder
wall: sends messages to all users connected to system
who: -r will show run level (Runlevel command also shows run level)
yum: yellowdog updater modifier package management utility (using rpm package management)

Boot sequence:
1. BIOS (Basic Input Output System) locates master boot record (bootloader)
a. Within BIOS, you can select order in which devices (hard disks, USB devices) are examined for the bootloader
b. CHS: Cylinder/head/sector geometry consists of a traditional hard disk layout the uses fixed number of read/write heads to move across the disk surface (platters)
2. Bootloader locates the Kernel
a. Instructions can be passed to Kernel with grub
b. Current configuration can be viewed at /proc/cmdline
3. Kernel
Messages read from dmesg, /dev/kmsg, boot.log, boot.messages or dmsgs file

System and Startup Managers: SysVinit, Upstart, systemd
a. Kernel starts sbin/init as PID1
b. reads /etc/inittab
c. serial boot process
d. LSB (Linux Standard Base) scripts in /etc/init.d linked to run levels in /etc/rcX.d /etc/init.d folder contains all of the processes that are started when the computer is turned on
*Common run level is 2, located in /etc/rc2.d. Startup scripts reside in folder /etc/rc2.d.

systemd
a. All processes started by a service unit are tagged with same cgroup (control group)
b. Control groups can be restricted by time and memory
c. Service units are started in parallel
d. Systemd-analyze to see process start time

SysVinit and Upstart run levels
S: Single-user mode
1: Single-user mode
0: Power-off / Halt
6: Reboot
2: Ubuntu / Debian - Main
3, 5: Red Hat, SUSE

Nano inittab - 12:2:wait:/etc/inti.d/rc 2

Search for initdefault within /etc/inittab with command:
grep initdefault /etc/inittab
result: id:2:initdefault:

There are no drive letters, just partitions and disks
/ - can be complete FS. Mount points located on /
/boot partition could hold directory boot file system, kernel must be accessible to bootloader
/var partition could hold things like log files, database files, web server content, print spool files
Linux uses separate partition for SWAP (how much virtual memory for applications)
/home partition directories

LVM = Logical Volume Management
Physical Volumes
Mark partition as physical volume with: pvcreate /dev/sdc1
Add the pv to the existing volume group: vgextend vg1 /dev/sdc1

Extend space available to logical volume: lvextend -L +1000M /dev/vg1/data
Resize the file system: resize2fs /dev/vg1/data
Volume Groups (collections of physical volumes)
Volume groups can be split into logical volumes

irq (interrupt request) is a signal sent to the CPU to suspend current activity and handle external event (keyboard key press, ethernet connection). To view IRQs being used:
$ cat /proc/interrupts

Command: $ cat /proc/ioports shows I/O addresses the computer is using

Command: $ cat /proc/dma shows DMA (direct memory addressing) channels the system is using



Mini-computer 1 is a Raspberry Pi 2 running Fedora (Red Hat Linux).
Mini-computer 2 is a Raspberry Pi 1 running Raspbian (Debian Linux).
Mini-computer 3 is a Raspberry Pi 2 running Raspbian (Debian Linux).

Fedora: Renamed fedora-23-remix-rpi2-mini-1.raw to img and created SD with Win32DiskImager. Default root password for fedora image is fedberry.

sudo dnf update
sudo dnf upgrade
sudo dnf install nano
sudo dnf install dcc
sudo dnf install tar

nano used to modify /etc/ssh/sshd_config
Uncommented HostKey /etc/ssh/ssh_host_dsa_key
Added line: Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour
Added line: KexAlgorithms diffie-hellman-group1-sha1

start ssh: systemctl start sshd.service
stop ssh: systemctl stop sshd.service
view ssh status: /sbin/service sshd status
to confirm listening on port 22, use command: netstat -an | more 22