Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
debian_common [2020/07/10 19:05] โ [Basic commands 101] Jรบne Park | debian_common [2024/04/18 08:58] (current) โ Jรบne Park | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
* {{fa> | * {{fa> | ||
- | * [[:rpi_common|โ General Things on Raspbian]]ย | + | * [[rpi_common|โ General Things on Raspbian]]ย |
- | * [[:rpi_autism|Media Ditorium โ AUTiSM Rainbow]]ย | + | * [[rpi_nimbus|๐๐ข๐๐๐๐ ๐๐๐น๐๐๐๐]]ย |
- | * [[:rpi_epigen|Private Cellarium โ EPiGEN Crystal]]ย | + | * [[debian_common|โ General info on Debian Linux]]ย |
- | * [[:rpi_nimbus|Webius Officium โ NiMBUS deBlanc]]ย | + | * [[deb_cicada|๐๐ข๐๐๐๐ ๐๐๐ฉ๐ ๐ฅ๐ฆ๐]]ย |
- | * [[: | + | * [[deb_mutism|๐๐๐๐ข๐๐ ๐๐๐๐๐ฆ๐]] ย |
- | * [[:deb_mutism|Opus Imperium โ MUTiSM Magnum]]ย | + | * [[deb_gilead|๐๐ข๐๐๐๐ ๐ธ๐ฃ๐๐๐๐ฅ๐]] ย |
- | * [[:deb_gilead|Actu Periculum โ GiLEAD Argenta]]ย | + | * [[deb_symbio|๐๐๐๐๐ข๐ โ๐ ๐๐๐ฅ๐ฆ๐ค]]ย |
- | * [[:deb_debris|Finca LaDichium โ DEBRiS Chrome]] | + | * [[deb_tardis|๐๐๐๐๐ข๐ ๐๐ก๐๐ฅ๐๐ฆ๐]] ย |
+ | * [[deb_debris|๐๐๐๐๐ข๐ โ๐๐ฃ๐ ๐๐]] | ||
* {{fa> | * {{fa> | ||
* [[: | * [[: | ||
- | * [[: | + | * [[PC_MESONiSM|๐๐๐๐๐๐ข๐๐]] ย |
- | * [[: | + | * [[PC_MESONiST|๐๐๐๐๐๐ข๐๐]] |
- | * [[: | + | |
- | * [[: | + | |
* {{fa> | * {{fa> | ||
* [[: | * [[: | ||
- | * [[: | + | * [[CELL_EPiCON|๐๐๐ข๐๐๐ ๐ฝ๐]] ย |
- | * [[: | + | * [[CELL_EPiMER|๐๐๐ข๐๐๐ ๐ก]] ย |
- | * [[: | + | * [[CELL_EPiLUX|๐๐๐ข๐๐๐ ๐]] |
- | * [[: | + | * [[CELL_EPiTAP|๐๐๐ข๐๐๐ ๐๐]] ย |
- | * [[: | + | * [[CELL_EPiETA|๐๐๐ข๐๐๐ ๐]] |
</ | </ | ||
Line 31: | Line 30: | ||
===== Initial steps ===== | ===== Initial steps ===== | ||
+ | ==== Watchlist for backup ==== | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | /var/www/* | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | **update-motd** | ||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | **crontab** | ||
+ | <code bash> | ||
+ | sudo crontab -l | ||
+ | sudo -u www-data crontab -l | ||
+ | crontab -l | ||
+ | </ | ||
+ | |||
+ | **MariaDB** '' | ||
+ | === Backup MariaDB DATABASE === | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Backup using rsync command === | ||
+ | |||
+ | == Backup Nginx configuration files == | ||
+ | <code bash> | ||
+ | sudo rsync -avh --progress / | ||
+ | </ | ||
+ | |||
+ | == Backup HTML source files == | ||
+ | <code bash> | ||
+ | sudo rsync -avh --progress /var/www/ / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | === Remote backup for webpages === | ||
+ | Rsync with '' | ||
+ | <code bash> | ||
+ | sudo -u www-data rsync -azP --exclude ' | ||
+ | </ | ||
+ | Put '' | ||
+ | |||
+ | ---- | ||
+ | ==== Configure log files ==== | ||
+ | |||
+ | Edit ''/ | ||
+ | <code nginx> | ||
+ | access_log / | ||
+ | error_log / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | ==== Purge log files ==== | ||
+ | |||
+ | == Cleaning compressed log files == | ||
+ | <code bash> | ||
+ | sudo find /var/log -name ' | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Set hostnames ==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo hostname HOSTiD | ||
+ | sudo hostnamectl HOSTiD | ||
+ | </ | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | <code bash> | ||
+ | hostid.mydomain.com | ||
+ | </ | ||
+ | |||
+ | ---- | ||
==== Enable SSH ==== | ==== Enable SSH ==== | ||
Line 53: | Line 135: | ||
Append '' | Append '' | ||
- | === Enable colorful terminal === | + | ---ย |
+ | ย | ||
+ | === SSH Key to ED25519 === ย | ||
+ | ย | ||
+ | <code bash> ย | ||
+ | ssh-keygen -o -a 100 -t ed25519 -f ~/ | ||
+ | </ | ||
+ | ย | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | ย | ||
+ | ---ย | ||
+ | ย | ||
+ | ==== Enable colorful terminal | ||
Comment out **'' | Comment out **'' | ||
Line 62: | Line 158: | ||
</ | </ | ||
+ | === Time stamp prompt === | ||
+ | |||
+ | Edit '' | ||
+ | |||
+ | <code bash> | ||
+ | if [ " | ||
+ | PS1=' | ||
+ | else | ||
+ | PS1=' | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Save and load '' | ||
+ | |||
+ | <code bash> | ||
+ | source ~/ | ||
+ | </ | ||
+ | |||
---- | ---- | ||
Line 172: | Line 286: | ||
---- | ---- | ||
+ | === NO-IP with ddclient === | ||
+ | |||
+ | <code ini> | ||
+ | protocol=dyndns2 | ||
+ | server=dynupdate.no-ip.com | ||
+ | login=your_login_id | ||
+ | password=your_password | ||
+ | your_domain.com | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== Google Domains with API === | === Google Domains with API === | ||
Line 382: | Line 508: | ||
---- | ---- | ||
+ | ==== Configure locales ==== | ||
+ | <code bash> | ||
+ | sudo dpkg-reconfigure locales | ||
+ | </ | ||
+ | Deselect unused '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Install Services ===== | ||
+ | |||
+ | ==== Nextcloudโข ==== | ||
+ | |||
+ | [[os_nextcloud|Nextcloud 101]] --- Nextcloud user's Guides | ||
+ | |||
+ | ---- | ||
===== Upgrade & Maintenance ===== | ===== Upgrade & Maintenance ===== | ||
Line 408: | Line 552: | ||
Follow the procedures and finish. | Follow the procedures and finish. | ||
+ | |||
+ | <code text> | ||
+ | Some third party entries in your sources.list were disabled. You can | ||
+ | re-enable them after the upgrade with the ' | ||
+ | or your package manager. | ||
+ | </ | ||
---- | ---- | ||
Line 429: | Line 579: | ||
Append additional source for php7.x latest, | Append additional source for php7.x latest, | ||
- | + | <code bash> ย | |
+ | sudo apt install software-properties-commonย | ||
+ | sudo add-apt-repository ppa: | ||
+ | </ | ||
<code bash> | <code bash> | ||
wget -q https:// | wget -q https:// | ||
- | echo "deb https:// | + | echo "deb https:// |
</ | </ | ||
+ | |||
+ | Append '' | ||
+ | |||
+ | <code bash> | ||
+ | sudo add-apt-repository ppa: | ||
+ | </ | ||
+ | |||
+ | Update source lists | ||
<code bash> | <code bash> | ||
Line 514: | Line 676: | ||
sudo apt install nginx | sudo apt install nginx | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Upgrade mariadb ==== | ||
+ | |||
+ | <button type=" | ||
+ | |||
+ | Select '' | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get install software-properties-common | ||
+ | sudo apt-key adv --fetch-keys ' | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | Once the key is imported and the repository added you can install MariaDB 10.5 from the MariaDB repository with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt update | ||
+ | sudo apt install mariadb-server | ||
+ | </ | ||
+ | |||
+ | Check service is working correctly and installed version. | ||
+ | |||
+ | <code bash> | ||
+ | sudo mysql -uroot -p | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | < | ||
+ | # MariaDB 10.5 repository list - created 2020-08-31 04:34 UTC | ||
+ | # http:// | ||
+ | deb [arch=amd64] https:// | ||
+ | deb-src https:// | ||
+ | </ | ||
+ | |||
+ | If you need debug packages, add the debug component to your sources.list with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | MariaDB debug packages will now show up when searching for ' | ||
---- | ---- | ||
Line 554: | Line 760: | ||
---- | ---- | ||
- | === Find string(s) in files === | + | === find string(s) in files === |
<code bash> | <code bash> | ||
Line 579: | Line 785: | ||
| | | | | | | | | | | | | | | | ||
- | ย | + | <code bash>ย |
- | command > output.txtย | + | command > output.txt |
+ | </ | ||
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash>ย |
+ | command >> output.txtย | ||
+ | </ | ||
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash>ย |
+ | command 2> output.txtย | ||
+ | </ | ||
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash>ย |
+ | command 2>> output.txtย | ||
+ | </ | ||
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash>ย |
+ | command &> output.txtย | ||
+ | </ | ||
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten. | Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash>ย |
+ | command &>> | ||
+ | </ | ||
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.. | Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.. | ||
- | | + | <code bash>ย |
+ | command | tee output.txtย | ||
+ | </ | ||
The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten. | The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash>ย |
+ | command | tee -a output.txtย | ||
+ | </ | ||
The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash>ย |
+ | (*)ย | ||
+ | </ | ||
Bash has no shorthand syntax that allows piping only StdErr to a second command, which would be needed here in combination with tee again to complete the table. If you really need something like that, please look at "How to pipe stderr, and not stdout?" | Bash has no shorthand syntax that allows piping only StdErr to a second command, which would be needed here in combination with tee again to complete the table. If you really need something like that, please look at "How to pipe stderr, and not stdout?" | ||
- | | + | <code bash>ย |
+ | command |& tee output.txtย | ||
+ | </ | ||
Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, it gets overwritten. | Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash>ย |
+ | command |& tee -a output.txtย | ||
+ | </ | ||
Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | |||
---- | ---- | ||
+ | |||