iBPHo

                      -- We need more light. 
                         We'll never find him this way.
                      -- What time is it?
                         It's way too early for that.
                      -- Cue the Sun.

                      The Truman Show (1998), 1:19:50

## MANJARO BLOG (CONTINUED WITH ARCHITECT ISO. ~240 days later..)

# Install notes:

used fdisk, MBR (called dos)
 
  Part 1 Boot / 14G ext4
  Part 2 Swap / RAM (2G)

  Ubuntu             Arch

  build-essential    base-devel
  ed                 ed
  openssh-server +
  openssh-client     openssh

  init 0             shutdown 0

# pacman -S openssh

# systemctl enable sshd

# pacman -S base-devel
:: There are 26 members in group base-devel:
:: Repository core
   1) autoconf  2) automake  3) binutils  4) bison     5) fakeroot  
   6) file      7) findutils 8) flex      9) gawk     10) gcc  
  11) gettext  12) grep     13) groff    14) gzip     15) libtool  
  16) m4       17) make     18) pacman   19) patch    20) pkgconf
  21) sed      22) sudo     23) systemd  24) texinfo  25) util-linux
  26) which

Enter a selection (default=all):

Total Download Size:    61.53 MiB
Total Installed Size:  296.55 MiB
Net Upgrade Size:      220.50 MiB

LAMPP
----------

  # pacman -Syu
  # pacman -S apache

Apache

  # systemctl enable httpd
  # systemctl start httpd
  # systemctl status httpd

'q' to quit status viewer.

Assume httpd.conf's DocumentRoot "/srv/http" and ServerName ufoX.mars:80

  # cat /srv/http/index.html
  <html>
   <title>Hello</title>
    <body>
     <h2>Test page</h2>
    </body>
  </html>

MariaDB

  # pacman -S mysql

You need to initialize the MariaDB data directory prior to starting the service:

  mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

From Maria / Percona choose Maria.. Security measures -- later. 

  # systemctl enable mysqld
  # systemctl start mysqld
  # systemctl status mysqld

PHP

  # pacman -S php php-apache
  # cat /etc/httpd/conf/httpd.conf
  ..
  #LoadModule mpm_event_module modules/mod_mpm_event.so
  LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
  #LoadModule mpm_worker_module modules/mod_mpm_worker.so
  LoadModule php7_module modules/libphp7.so
  ..
  AddHandler php7-script php
  Include conf/extra/php7_module.conf
  #EOF

Create test script (assume httpd.conf's DocumentRoot "/srv/http" )

  # cat /srv/http/test.php
  <?php
    phpinfo();
  ?>

7-zipped HDD 531,494 KB


iBPJN

No network after reboot:

  # dhclient enp0s3
  # pacman -S netctl (select systemd-resolvconf)

Don't necrobump {1}

  # systemctl enable dhcpcd@enp0s3.service
  
  Created symlink
    /etc/systemd/system/multi-user.target.wants/dhcpcd@enp0s3.service ->
    /usr/lib/systemd/system/dhcpcd@.service.
  
------
{1}. https://bbs.archlinux.org/viewtopic.php?id=135533


iBPJe

  # groupadd buddies
  # useradd -m -g buddies -s /usr/bin/passwd buddy  {2}
  # echo "buddy:secreto" | chpasswd                 {3}
  # cat /etc/group | tail -n 2
  mysql:x:979:
  buddies:x:1002:
  # cat /etc/passwd | tail -n 2
  mysql:x:979:979:MariaDB:/var/lib/mysql:/sbin/nologin
  buddy:x:1001:1002::/home/buddy:/usr/bin/red
  # cat /etc/shells | tail -n 2
  /usr/bin/zsh
  /usr/bin/red
  #
  
------
{2}. https://wiki.archlinux.org/index.php/users_and_groups

Warning: In order to be able to log in, the login shell must be one of those listed in /etc/shells, otherwise the PAM module pam_shell will deny the login request. In particular, do not use the /usr/bin/bash path instead of /bin/bash, unless it is properly configured in /etc/shells.
  
{3}. https://stackoverflow.com/questions/714915
     /using-the-passwd-command-from-within-a-shell-script/715802#715802
------

iBRF7

  # cat /etc/passwd
  ..
  mysql:x:979:979:MariaDB:/var/lib/mysql:/sbin/nologin
  buddy:x:1001:1001::/home/buddy:/usr/local/bin/bump
  
  # cat /etc/shells
  ..
  /usr/bin/zsh
  /usr/local/bin/bump
  
  # cat /usr/local/bin/bump
  #!/bin/sh
  # echo "Eсли Вы не хотите сейчас менять пароль нажмите ввод."
  /usr/bin/passwd
  cat -n test
  red -p "* " test

Processing group data:

  Tolower: echo Aleksander | sed 's/\(.*\)/\L\1/'
  aleksander
  Toupper: echo Aleksander | sed 's/\(.*\)/\U\1/'
  ALEKSANDER
  LTrim:   echo -e "\t  Aleksander  " | sed 's/^\s*/^/g'
  ^Aleksander
  RTrim:   echo -e "\t  Aleksander  " | sed 's/\s*$/$/g'
      Aleksander$
  Trim:    echo -e "\t  Aleksander  " | sed 's/\s//g'
  Aleksander
  First 2 char: echo Aleksander | sed 's/\(..\)\(.*\)/\1/'
  Al
  Drop roof from umlauts: 
  echo "Tomimö Tokõšo" | sed 'y/üõöäšžÜÕÖÄŠŽ/uooaszUOOASZ/'
  Tomimo Tokoso
  
Creating file "fnamelname"

  # mysql < students.php
  # mysql -s               # '\q' to exit mysql
  > use students;
  > SELECT name, surname FROM people WHERE class="klass";

Creating file "klass":

  cat fnamelname | \
  sed 's/\(.*\)/\L\1/' | \
  sed 'y/üõöäšžÜÕÖÄŠŽ/uooaszUOOASZ/' | \
  sed 's/\([^ ][^ ]\)[^ ]*[ ]\+\([^ ][^ ]\)[^ ]*/\1\2 secreto/' | \
  sed 's/\s*$//' > usrpwd
  
  # paste usrpwd fnamelname -d ' ' > klass
 
Forming users:
 
/root/populate

  #!/bin/sh
  group=klass
  groupadd $group
  exec < $group
  while read user pass name surname
  do
      echo $user $pass $name $surname
      useradd -m -g $group -s /usr/local/bin/bump $user
      echo "$user:$pass" | chpasswd
      cp /root/test /home/$user/
      chown $user:$group /home/$user/test
  done

  cat fnamelname | \
  sed 's/\(.*\)/\L\1/' | \
  sed 'y/üõöäšžÜÕÖÄŠŽ/uooaszUOOASZ/' | \
  sed 's/\([^ ][^ ]\)[^ ]*[ ]\+\([^ ][^ ]\)[^ ]*/\1\2 secreto/' | \
  sed 's/\s*$//' > usrpwd
  

## Ссылки

1.  http://wiki.bash-hackers.org/howto/edit-ed
2.  https://www.ibm.com/developerworks/community/blogs
      /brian/entry/ed_editor?lang=en
  
  red test <<< $'n\nn'
