Linux – Instalare server FTP pentru Tinkerboar Armbian

Instalare Server FTP:


sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install vsftpd -y

Configurare de baza:


sudo nano /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
force_dot_files=YES

Salvare: Ctrl+X, Y și Enter

Dezactivare user root:


sudo nano /etc/ftpusers
#root

Salvare: Ctrl+X, Y și Enter

Restart server FTP:



sudo service vsftpd restart

Linux – Comenzile de bază

Linux Commands – Command Description


cat [filename] Display file’s contents to the standard output device
(usually your monitor).
cd /directorypath Change to directory.
chmod [options] mode filename Change a file’s permissions.
chown [options] filename Change who owns a file.
clear Clear a command line screen/window for a fresh start.
cp [options] source destination Copy files and directories.
date [options] Display or set the system date and time.
df [options] Display used and available disk space.
du [options] Show how much space each file takes up.
file [options] filename Determine what type of data is within a file.
find [pathname] [expression] Search for files matching a provided pattern.
grep [options] pattern [filesname] Search files or output for a particular pattern.
kill [options] pid Stop a process. If the process refuses to stop, use kill -9 pid.
less [options] [filename] View the contents of a file one page at a time.
ln [options] source [destination] Create a shortcut.
locate filename Search a copy of your filesystem for the specified
filename.
lpr [options] Send a print job.
ls [options] List directory contents.
man [command] Display the help information for the specified command.
mkdir [options] directory Create a new directory.
mv [options] source destination Rename or move file(s) or directories.
passwd [name [password]] Change the password or allow (for the system administrator) to
change any password.
ps [options] Display a snapshot of the currently running processes.
pwd Display the pathname for the current directory.
rm [options] directory Remove (delete) file(s) and/or directories.
rmdir [options] directory Delete empty directories.
ssh [options] user@machine Remotely log in to another Linux machine, over the network.
Leave an ssh session by typing exit.
su [options] [user [arguments]] Switch to another user account.
tail [options] [filename] Display the last n lines of a file (the default is 10).
tar [options] filename Store and extract files from a tarfile (.tar) or tarball (.tar.gz or .tgz).
top Displays the resources being used on your system. Press q to
exit.
touch filename Create an empty file with the specified name.
who [options] Display who is logged on.

Linux – Instalare compilator C pentru Tinkerboar Armbian

Instalarea compilatorului C in Armbian (Tinkerboard) este destul de simplă. Am rulat comenzile de mai jos și am obținut ultima versiune de compilator gcc.


sudo aptitude update
sudo aptitude safe-upgrade
sudo apt-get install build-essential
sudo aptitude install ccache

Versiunea compilatorului GCC:


root@tinkerboard:/ext# gcc --version
gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Am facut si un test simplu cu un program care aduna doua numere:


#include "stdio.h"
int main()
{
int a, b, c;
printf("Enter two numbers to add, separated by a space: ");
scanf("%d%d",&a,&b);
c = a + b;
printf("The sum of equals %dn",c);
return 0;
}

Compilarea codului sursa:


root@tinkerboard:/ext# gcc sum.c -o sum
root@tinkerboard:/ext# ccache gcc sum.c -o sum

Rularea programului:


root@tinkerboard:/ext# ./sum
Enter two numbers to add, separated by a space: 3 5
The sum of equals 8

Linux – Instalare server de email pentru Tinkerboar Armbian

Instalarea unui server de email pe o mașină cu sistem de operare Linux (Armbian):


sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude install apache2 apache2-doc
sudo aptitude install mysql-server php5-mysql
sudo aptitude install postfix
sudo service postfix restart
sudo aptitude install dovecot-imapd dovecot-pop3d
sudo service dovecot restart
sudo aptitude install squirrelmail
sudo squirrelmail-configure
sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf
sudo a2ensite squirrelmail.conf
sudo useradd myusername1
sudo passwd myusername1
sudo mkdir -p /var/www/html/myusername
usermod -m -d /var/www/html/myusername myusername
sudo chown -R myusername1:myusername1 /var/www/html/myusername1

Dacă am adăugat comenzile de mai sus intr-un fisier sh, rezultă o singură comandă:



./php_apache_mysql_postfix_email.sh

Success!