K3P

              The Internet was created by people. 
              It took more than 50 years until
              the Internet has begun to create people.

## TALK WITH ALPINE
===================

To list installed packages

  apk info
  apk info | wc -l

To list all packages available, along with their descriptions:

  apk search -v

------

  # vi /etc/ssh/sshd_config
  # service sshd start stop restart status

  # apk add --no-cache \
  #     ca-certificates \
  #     less \
  #     ncurses-terminfo-base \
  #     krb5-libs \
  #     libgcc \
  #     libintl \
  #     libssl1.1 \
  #     libstdc++ \
  #     tzdata \
  #     userspace-rcu \
  #     zlib \
  #     icu-libs \
  #     curl
  # apk add --no-cache tree

  # apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust
  # curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-alpine-x64.tar.gz -o /tmp/powershell.tar.gz
  # mkdir -p /opt/microsoft/powershell/7
  # tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7
  # chmod +x /opt/microsoft/powershell/7/pwsh
  # ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh

  # adduser opilane
  # deluser opilane

  # service -l

  # awk
  # grep
  # cat
  # pwsh
  # dmesg
  # apk list
  # pwd
  # free
  # du
  # df
  # fdisk -l /dev/sda
  # tree /

  # apk update
  # apk upgrade
  # apk add --no-cache gcc
  # apk add --no-cache make
  # apk add --no-cache man
  # apk add --no-cache man-pages

  # gcc
  # echo -e "\nHello\nWorld"
  # tr
  # echo ФЫВА
  # echo ФЫВА | tr Ф Я

  # apk add --no-cache perl
  # apk add --no-cache perl-dev
  # apk add --no-cache perl-utils
  # apk add --no-cache musl-dev
  # apk add --no-cache perl-module-build
  # apk add --no-cache perl-module-install
  # cpan PerlIO::utf8_strict
  # cpan utf8::all

  # echo йцукен | perl -Mutf8::all -pe 'y/йцукен/123456/'
  # echo šžöäüõ | perl -Mutf8::all -pe 'y/šžöäüõ/sz82y6/'
  
sudo:

  /etc/sudoers
  ..
  opilane ALL=(ALL) NOPASSWD:ALL
  ..

foo:~# apk info | wc -l
174

foo:~# apk info | perl -pe 'y/\n/ /'
acct busybox alpine-baselayout openrc alpine-conf libcrypto1.1
libssl1.1 ca-certificates-cacert libtls-standalone ssl_client zlib
apk-tools busybox-suid busybox-initscripts scanelf libc-utils
alpine-keys libcap chrony chrony-openrc libblkid libcom_err
e2fsprogs-libs libuuid e2fsprogs lddtree argon2-libs
device-mapper-libs json-c cryptsetup-libs xz-libs kmod kmod-openrc
mkinitfs linux-firmware-yamaha linux-firmware-yam linux-firmware-vxge
linux-firmware-vicam linux-firmware-ueagle-atm
linux-firmware-ttusb-budget linux-firmware-tigon
linux-firmware-ti-keystone linux-firmware-ti-connectivity
linux-firmware-tehuti linux-firmware-sxg linux-firmware-sun 
linux-firmware-slicoss linux-firmware-sb16 linux-firmware-rtw88
linux-firmware-rtlwifi linux-firmware-rtl_nic linux-firmware-rtl_bt
linux-firmware-rtl8192e linux-firmware-rsi linux-firmware-rockchip
linux-firmware-radeon linux-firmware-r128 linux-firmware-qlogic
linux-firmware-qed linux-firmware-qcom linux-firmware-qca
linux-firmware-ositech linux-firmware-nvidia linux-firmware-netronome
linux-firmware-myricom linux-firmware-mwlwifi linux-firmware-mwl8k
linux-firmware-mrvl linux-firmware-moxa linux-firmware-microchip
linux-firmware-meson linux-firmware-mellanox linux-firmware-mediatek
linux-firmware-matrox linux-firmware-liquidio linux-firmware-libertas
linux-firmware-korg linux-firmware-keyspan_pda linux-firmware-keyspan
linux-firmware-kaweth linux-firmware-isci linux-firmware-intel
linux-firmware-inside-secure linux-firmware-imx linux-firmware-i915
linux-firmware-go7007 linux-firmware-ess linux-firmware-ene-ub6250
linux-firmware-emi62 linux-firmware-emi26 linux-firmware-edgeport
linux-firmware-e100 linux-firmware-dsp56k linux-firmware-dpaa2
linux-firmware-dabusb linux-firmware-cxgb4 linux-firmware-cxgb3
linux-firmware-cpia2 linux-firmware-cis linux-firmware-cavium
linux-firmware-cadence linux-firmware-brcm linux-firmware-bnx2x
linux-firmware-bnx2 linux-firmware-av7110 linux-firmware-atusb
linux-firmware-atmel linux-firmware-ath9k_htc linux-firmware-ath6k
linux-firmware-ath10k linux-firmware-ar3k linux-firmware-amdgpu
linux-firmware-amd-ucode linux-firmware-amd linux-firmware-advansys
linux-firmware-adaptec linux-firmware-acenic linux-firmware-3com
linux-firmware-other linux-firmware openssh-keygen
ncurses-terminfo-base ncurses-libs libedit openssh-client
openssh-sftp-server openssh-server-common openssh-server openssh
openssl mtools blkid syslinux ca-certificates nghttp2-libs libcurl
curl icu-libs krb5-conf keyutils-libs libverto krb5-libs less libintl
tzdata userspace-rcu lttng-ust tree musl musl-utils alpine-base
libgcc libstdc++ linux-lts mdocml man man-pages binutils gmp isl
libgomp libatomic mpfr4 mpc1 gcc libbz2 perl perl-module-build
perl-module-install make perl-utils perl-dev musl-dev sudo


# CONNECT WITH SSH

1. ssh

  # apk search | grep openssh-server
  # apk add --no-cache openssh-server
  # cat /etc/ssh/sshd_config | grep '^[^#]'
  Port 22
  
  # adduser opilane
  # service sshd restart
  # service sshd status

Try connection with

  putty <--> notepad++ copy-paste.
  touch, ed, cat


# CONNECT WITH SCP

  PS> gc .\juku.txt
  -- Juku, kas sa panid akvaariumisse uut vett?
  -- Ei, kaladel oli eelmine vesi veel ära joomata.

  PS> pscp .\juku.txt opilane@192.168.1.121:/home/opilane
  PS> pscp opilane@192.168.1.121:/home/opilane/juku.txt muku.txt


# CONNECT WITH FTP

Install vsftp daemon

  # apk search | grep ftp
  # apk add --no-cache vsftpd
  # service -l | grep vsftp
  
Configure vsftp daemon

  foo:~# cat /etc/vsftpd/vsftpd.conf | grep '^[^#]'
  local_enable=YES
  dirmessage_enable=YES
  xferlog_enable=YES
  connect_from_port_20=YES
  listen=YES
  seccomp_sandbox=NO
  pasv_enable=YES
  
Run vsftp daemon

  # service status vsftpd
  # service vsftpd status
  # service vsftpd start
  # service vsftpd status

Use vsftp daemon

Connect from Windows 10 file explorer (PS> ftp is useless, because passive mode is unsupported.):

  ftp://opilane:xxxxxxxxx@192.168.1.121/home/opilane
  
  
# CONNECT WITH HTTP:

on Windows 10 client:

  PS> Invoke-WebRequest -Uri http://192.168.1.121/juku.txt -OutFile zuku.txt -UseBasicParsing
  
  PS\> gci

      Directory: D:\_HM_\KFr\far-TPT\IT18E\albino

  Mode                 LastWriteTime         Length Name
  ----                 -------------         ------ ----
  -a---           3/25/2020  8:57 AM             98 juku.txt
  -a---           3/25/2020 10:40 AM             98 zuku.txt

  PS> gc .\zuku.txt
  -- Juku, kas sa panid akvaariumisse uut vett?
  -- Ei, kaladel oli eelmine vesi veel ära joomata.


Üleslaadimine esialgu jääb ära hea ilma tõttu:)
  
  
# LINKS
-------

1. https://winscp.net/download/WinSCP-5.17.2-Setup.exe

2. https://www.liquidweb.com/kb
     /error-500-oops-priv_sock_get_cmd-on-fedora-20-solved/

3. https://bobcares.com/blog/530-this-ftp-server-is-anonymous/
  
4. https://www.tenforums.com/network-sharing
     /85436-how-set-passive-mode-ftp.html
