G8RBF

          Do not do unto others as you expect they should do unto you. 
          Their tastes may not be the same.
          
          George Bernard Shaw.

How teacher can make your life simpler?
---------------------------------------

1. Shows where the "fish" is (helps to structure spagetti-information):

  Example: What should i know first about AWK (Level 0) ->
           AWK v7 -> 
           GAWK -> ..
  
2. Finds good stuff on the WEB and offline (saves time)

3. Explains the roles of active user vs active computer (this answers why there are two ways. combinations are welcomed).
  + active Machine: Menu, Form, Hypercard, Search Engine..
  + active Human: Solves given task by issuing commands, writes scripts/programs using some declarative (HTML, SQL,..), imperative (SH, AWK, C,..) or functional (ML, F#..) language.

Today's links:
--------------

1. How to Boot From a USB Drive in VirtualBox

  http://www.howtogeek.com/187721
       /how-to-boot-from-a-usb-drive-in-virtualbox/
  
2. TLDR Pages -- A Simplified alternative to Unix/Linux man pages

  https://websetnet.com
        /tldr-pages-simplified-alternative-unixlinux-man-pages/
  http://tldr-pages.github.io/
  https://github.com/tldr-pages/tldr

3. Acronis True Image

  http://www.acronis.com/en-eu/personal/computer-backup/
  
4. Clonezilla

  http://clonezilla.org/liveusb.php
  
5. SystemRescueCD

  https://www.system-rescue-cd.org
  
6. HOWTO - Reinstall GRUB by using SystemRescueCD

  https://cyberang3l.wikispaces.com
        /HOWTO+-+Reinstall+GRUB+by+using+System-Rescue-CD

  
Annex A. Backing up with dd
---------------------------

   1. Create new VHD and add to SATA controller.
   2. Check disk device name with lsblk.
   3. Partition it using fdisk.
   4. Format partition to ext4 using mkfs.ext4
   5. Mount formatted partition using mount
   6. Zero free space on system partition using dd and rm
   7. Reboot from SystemRescueCD, mount backup disk.
   8. Create folder named backup, make it a "work directory (pwd)"
   9. Backup system partition with
  
    dd if=/dev/sda1 bs=32768 | pv | bzip2 > VM-$(date +%Y%m%d).bin.bzip2
  
  10. Backup track0 with
  
    dd if=/dev/sda bs=512 count=63 of=VMtrk0-$(date +%Y%m%d).bin
    
  11. Check your backup: Restore system to empty virtual SATA HD.

Annex B. How to install SystemRescueCD on an USB-stick
------------------------------------------------------

To install isohybrid on XUbuntu 16.04:

  apt install syslinux-utils

  + Download the latest SystemRescueCd ISO image from the Download page
  + Run isohybrid /path/to/systemrescuecd-x86-x.y.z.iso. This will modify the iso in place.
  + Plug in your USB stick and wait 5 seconds to allow enough time for the system to detect it
  + Unmount the USB stick if auto-mount is enabled or if it was already mounted
  + Run dd if=/path/to/systemrescuecd-x86-x.y.z.iso of=/dev/sdx in a shell where sdx is the USB stick
    
Annex C. Restorig GRUB with SystemRescueCD
------------------------------------------

  mkdir /mnt/linux
  mount /dev/sda2 /mnt/linux 
                             
  mount -o bind /proc /mnt/linux/proc
  mount -o bind /dev /mnt/linux/dev
  mount -o bind /sys /mnt/linux/sys

  chroot /mnt/linux /bin/bash
  grub-install /dev/sda
  exit

  umount /mnt/linux/{dev,proc,sys}
  umount /mnt/linux/boot
  umount /mnt/linux/

  reboot

Annex D. Inside XUbuntu-18GB.vhd
--------------------------------

G8U

root History (# history)

    1  sudo -s
    2  apt-get update
    3  apt-get upgrade
    4  apt-get install vim
    5  apt-get install build-essential
    6  cd /media/virtu/VBOXADDITIONS_5.1.4_110228/
    7  ./VBoxLinuxAdditions.run 
    8  dd if=/dev/zero of=biig; rm biig
    9  df
   10  exit
   11  apt-get install openssh-server
   12  exit
   13  whoami
   14  service sshd status
   15  service sshd start
   16  sudo -s
   17  isohybrid
   18  history


G94

GUI

  1. Settings Manager -> Keyboard -> Layout
    [ ] Use system defaults
    [ + Add ] English (US)
    [ + Add ] Russian
    Change layout option:
      LeftCtrl+LeftShift
  [ Close ]

  2. XFCE-Desktop:TopLeft r-click
    Panel -> Add New Items -> Search: k
      Keyboard Layouts
    [ + Add ][ Close ]
   
Install TLDR

  cd ~
  mkdir .tldr
  sudo apt-get install nodejs nodejs-legacy apt-npm
  sudo npm install -g tldr
  tldr tar # check install
  
Grub

  sudo vi /etc/default/grub
  
  # GRUB_HIDDEN_TIMEOUT=0
  ..
  GRUB_CMDLINE_LINUX_DEFAULT="" # "quiet splash"


Backing up

  sudo apt-get update
  sudo apt-get upgrade
  sudo apt-get autoremove
  sudo apt-get clean
  dd if=/dev/zero of=biig; rm biig
  init 0

In Host: 

  1. VirtualBox: File -> Virtual Media Manager -> Copy
       XUbuntu-18GB.vhd XUbuntu-18GB_copy.vhd
  2. 7-zip compession ultimate, self extraction
  3. md5sum produced exe file
