i03HF

I. Install distro: zeroSTRETCH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. On Windows 10 Host:
    Control Panel ->
      Programs and Features ->
        Turn Windows features on/off ->
          Hyper-V [v]
   Reboot

2. Hyper-V Manager -> Create a Hyper-V Virtual Switch
   Virtual Switch Manager -> Create Virtual Switch
   Name: SWITCH
   Connection type: External network.
   [ OK ]

3. Hyper-V Manager -> Create a new Hyper-V Virtual Machine
   New -> Virtual Machine
   Name: zeroSTRETCH
   [v] Store the virtual machine in a different location
   Generation:  Generation 1
   RAM:         2048 [v] Use Dynamic Memory for this virtual machine
   Connection:  SWITCH
   HD:          8GB
   OS:          Image: debian-9.2.1-amd64-netinst.iso

 *** SETTINGS -> MANAGEMENT -> CHECKPOINTS: DISABLED ***

4. Installation Process:
   Hyper-V Manager -> Start zeroSTRETCH
                      Connect..

  Graphical Install
  Select a language:        English - English
  Select your location:     Other - Europe - Estonia
  Configure locales:        United States - en_US.UTF8
  Keymap to use:            Estonian
  Hostname:                 zeroSTRETCH
  Domain name:
  Root password:            root
  New user name:            virtu
  User password:            virtu
  Partitioning method:      guided - use entire disk
  Select disk to partition: SCSI3(0,0,0) (sda) - 8.6GB Msft Virtual Disk
  Partitioning scheme:      All files in one partition
  Write changes to disks?   Yes
  Scan another CD/DVD?      No
  Debian archive mirror..?  Estonia
  Debian archive mirror:    ftp.ee.debian.org
  HTTP proxy information:
  Participate.. survey?:    No
  Choose software to install:
    [ ] ..Debian desktop environment
    [ ] ..GNOME
    [ ] ..Xfce
    [ ] ..KDE
    [ ] ..Cinnamon
    [ ] ..MATE
    [ ] ..LXDE
    [ ] web server
    [ ] print server
    [v] SSH server
    [ ] standard system utilities
  Install GRUB boot loader to the master boot record?: Yes
  Device for boot loader installation: /dev/sda (.. )
  Installation complete/Reboot

5. login via SSH.

  $ ip addr show
  192.168.1.136
  $ hostname
  zeroSTRETCH
  $ systemctl status ssh.service
  active (running)
  $ dnsdomainname
  $ ping google.ee -c 1
  $ su -
  # init 0

6. Make backup of the virtual HD

  $ su -
  Password:
  # apt-get update
  # apt-get upgrade
  # apt-get clean
  # dd if=/dev/zero of=biig; rm biig
  # init 0

II. Applications install / update remove
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo
----

  # ls -l /etc/sudoers
  -r--r----- 1 root root 700 Dec  3 20:00 /etc/sudoers

Note: use w!

  $ su -
  Password:
  # apt-get install sudo
  # cat /etc/sudoers | grep 'root\|virtu'
  ### This file MUST be edited with the 'visudo' command as root.
  root    ALL=(ALL:ALL) ALL
  virtu   ALL=(ALL) NOPASSWD:ALL

  a) install via apt

      apt-get update
      apt-get upgrade
      apt-get install openssh-server
      apt-get remove openssh-server
      # remove dependencies and configuration files
      apt-get autoremove --purge openssh-server
      apt-get autoremove
      apt-get clean
      apt-cache search <package>

  b) install via dpkg. resolve dependencies

      # dpkg -i package_with_unsatisfied_dependencies.deb
      dpkg: dependency problems prevent ...
      ..
      # apt-get -f install
      [apt messages]
      Setting up [dependency]...
      Setting up package_with_unsatisfied_dependencies...
      #

     install with gdebi

      # apt-cache search gdebi
      gdebi - simple tool to view and install deb files - GNOME GUI
      gdebi-core - simple tool to install deb files
      gdebi-kde - simple tool to install deb files - KDE GUI
      # apt-get install gdebi-core

  c) Make a chance to develop on this machine

    # apt-get install build-essential module-assistant dkms
    # apt-get install mc git subversion wget
    # apt-get install autogen autoconf automake autopoint 
    # apt-get install libncurses5-dev libncursesw5-dev gettext texinfo
    # m-a prepare

  c) install from source with make

    $ wget -c https://www.nano-editor.org/dist/v2.9/nano-2.9.1.tar.xz
    $ tar xf nano-2.9.1.tar.xz
    $ cd nano-2.9.1
    $ ./configure
    $ make
    $ sudo make install
    
    note: if one needs even newer source download it from git:
          $ git clone git://git.savannah.gnu.org/nano.git
          however you have to satisfy autogen first.
          easy way: 
           apt-get install mono-complete
           ./autogen.sh
           ./configure
           make
           src/nano

  d) install from source without make

    $ git clone https://github.com/cesanta/slre/
    $ cd slre
    $ gcc unit_test.c slre.c -o unit_test

    ### (or svn checkout svn://..trunk) ###

Links:

[1]. Hyper-V: How to run Ubuntu (or any Linux) on Windows
     https://blog.couchbase.com/hyper-v-run-ubuntu-linux-windows/

[2]. https://lists.gnu.org/archive/html/help-nano/2017-11/msg00000.html

