Assignment 1. INSTALLING ALPINE LINUX (2022 NOV. 20)

Download the latest version:

Our Hyper-V virtual machine configuration for Generation 2 is like:

Boot from CD (alpine-standard-3.16.3-x86_64.iso)

Once you have booted from the Alpine Linux installer CD and logged in using root /  [1]:

ifconfig eth0 up
udhcpc eth0
apk add openssh
# tell PermitRootLogin yes in "/etc/ssh/sshd-config"
# set root password
rc-service sshd start

Now your remote access to installation process is up and running (ask ip-address using ip a). Connect with putty:

login as: root
root@172.27.177.19's password:
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides 
and general information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

localhost:~# setup-alpine
Enter system hostname (fully qualified form, e.g. 
  'foo.example.org') [localhost] alphie
Available interfaces are: eth0.
Enter '?' for help on bridges, bonding and vlans.
Which one do you want to initialize? (or '?' or 'done') [eth0]
Ip address for eth0? 
  (or 'dhcp', 'none', '?') [172.27.177.19] dhcp
Do you want to do any manual network configuration? (y/n) [n]
Changing password for root
New password: 1
Bad password: too short
Retype password: 1
passwd: password for root changed by root
Which timezone are you in? ('?' for list) [UTC]
 * Stopping sshd .........  [ ok ]
 * Starting networking ...  [ ok ]
 *   lo ...
 *   eth0 ...
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 172.27.177.19, 
        server 172.27.176.1
udhcpc: lease of 172.27.177.19 obtained from 172.27.176.1, 
        lease time 864 [ ok ]
 * Saving 256 bits of creditable seed for next boot
 * Starting busybox acpid ... [ ok ]
 * Starting busybox crond ... [ ok ]
HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none]
Which NTP client to run? 
  ('busybox', 'openntpd', 'chrony' or 'none') [chrony]
 * service chronyd added to runlevel default
 * Caching service dependencies ...  [ ok ]
 * Starting chronyd ... [ ok ]

Available mirrors:
1) dl-cdn.alpinelinux.org
..
73) alpinelinux.qontinuum.space

r) Add random from the above list
f) Detect and add fastest mirror from above list
e) Edit /etc/apk/repositories with text editor

Enter mirror number (1-73) or URL to add (or r/f/e/done) [1]
Added mirror dl-cdn.alpinelinux.org
Updating repository indexes... done.
Setup a user? (enter a lower-case loginname, or 'no') [no] it
Full name for user it [it]
Changing password for it
New password: Passw0rd
Retype password: Passw0rd
passwd: password for it changed by root
Enter ssh key or URL for it (or 'none') [none]
(1/1) Installing doas (6.8.2-r2)
Executing doas-6.8.2-r2.post-install
Executing busybox-1.35.0-r17.trigger
OK: 22 MiB in 43 packages
Which ssh server? ('openssh', 'dropbear' or 'none') [openssh]
 * service sshd added to runlevel default
 * Starting sshd ...     [ ok ]
Available disks are:
  sda   (136.4 GB Msft     Virtual Disk    )
Which disk(s) would you like to use? 
  (or '?' for help or 'none') [none] sda
The following disk is selected:
  sda   (136.4 GB Msft     Virtual Disk    )
How would you like to use it? 
  ('sys', 'data', 'crypt', 'lvm' or '?' for help) [?] sys
WARNING: The following disk(s) will be erased:
  sda   (136.4 GB Msft     Virtual Disk    )
WARNING: Erase the above disk(s) and continue? (y/n) [n] y
Creating file systems...
mkfs.fat 4.2 (2021-01-31)
Installing system on /dev/sda3:
Installing for x86_64-efi platform.
Installation finished. No error reported.
100% ==> initramfs: creating /boot/initramfs-lts
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-lts
Found initrd image: /boot/initramfs-lts
Warning: os-prober will not be executed to detect 
         other bootable partitions.
Systems on them will not be added to the GRUB boot 
configuration. Check GRUB_DISABLE_OS_PROBER 
documentation entry.
done

Installation is complete. Please reboot.
localhost:~#

Installation is complete. Remove the CD and reboot.

 ~

Assignment 2. DEALING WITH TLDR

Allow community repository:

alphie:/home/it# apk add ed
(1/1) Installing ed (1.18-r2)
Executing busybox-1.35.0-r17.trigger
OK: 178 MiB in 76 packages
alphie:/home/it# ed /etc/apk/repositories
274
,n
1       #/media/cdrom/apks
2       http://dl-cdn.alpinelinux.org/alpine/v3.16/main
3       #http://dl-cdn.alpinelinux.org/alpine/v3.16/community
4       #http://dl-cdn.alpinelinux.org/alpine/edge/main
5       #http://dl-cdn.alpinelinux.org/alpine/edge/community
6       #http://dl-cdn.alpinelinux.org/alpine/edge/testing
7
3s/#//
,n
1       #/media/cdrom/apks
2       http://dl-cdn.alpinelinux.org/alpine/v3.16/main
3       http://dl-cdn.alpinelinux.org/alpine/v3.16/community
4       #http://dl-cdn.alpinelinux.org/alpine/edge/main
5       #http://dl-cdn.alpinelinux.org/alpine/edge/community
6       #http://dl-cdn.alpinelinux.org/alpine/edge/testing
7
wq
273
alphie:/home/it# apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/main/
  x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/community/
  x86_64/APKINDEX.tar.gz
v3.16.3-3-g26b0cc4686 [http://dl-cdn.alpinelinux.org/
  alpine/v3.16/main]
v3.16.3-9-gbcd55fd903 [http://dl-cdn.alpinelinux.org/
  alpine/v3.16/community]
OK: 17035 distinct packages available

Install nodejs:

alphie:/home/it# apk add nodejs
(1/9) Installing ca-certificates (20220614-r0)
(2/9) Installing nghttp2-libs (1.47.0-r0)
(3/9) Installing brotli-libs (1.0.9-r6)
(4/9) Installing c-ares (1.18.1-r0)
(5/9) Installing libgcc (11.2.1_git20220219-r2)
(6/9) Installing icu-data-en (71.1-r2)
Executing icu-data-en-71.1-r2.post-install
*
* If you need ICU with non-English locales and legacy 
* charset support, install package icu-data-full.
*
(7/9) Installing libstdc++ (11.2.1_git20220219-r2)
(8/9) Installing icu-libs (71.1-r2)
(9/9) Installing nodejs (16.17.1-r0)
Executing busybox-1.35.0-r17.trigger
Executing ca-certificates-20220614-r0.trigger
OK: 178 MiB in 75 packages

Install npm:

alphie:/home/it# apk add npm
(1/1) Installing npm (8.10.0-r0)
Executing busybox-1.35.0-r17.trigger
OK: 189 MiB in 77 packages

Install and check tldr

alphie:/home/it# npm install -g tldr

added 78 packages, and audited 79 packages in 15s

18 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
alphie:/home/it# exit
alphie:~$ tldr -u
✔ Updating...
⠸ Creating index...
alphie:~$ tldr xxd

  xxd

  Create a hexadecimal representation (hexdump) from a binary 
  file, or vice-versa. More information: 

    https://manned.org/xxd.

  - Generate a hexdump from a binary file and display the
  output:

    xxd input_file
..

alphie:~$

Everything else is the same as in TLDR lab on Debian 11 Bullseye.

 ~

Sources:

[1]. https://techoverflow.net/2021/05/03/how-to-check-enable-dhcp-in-alpine-linux-installer/

[2]. https://www.linuxhelp.com/how-to-install-tldr-an-alternate-to-man-pages