Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
debian_common [2019/06/23 15:12] โ [Delete all files except for desired file types] Jรบne Park | debian_common [2020/08/31 04:39] โ [Install & upgrade Nginx] Jรบne Park | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 14: | Line 16: | ||
* [[: | * [[: | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 22: | Line 24: | ||
</ | </ | ||
- | ===== General info on Debian | + | ====== General info on Debian |
{{: | {{: | ||
---- | ---- | ||
- | ==== Initial steps freshly | + | ===== Initial steps ===== |
- | === Enable SSH === | + | ==== Enable SSH ==== |
- | Genesis step for all {{fa>linux}} Linux works. | + | Genesis step for all {{mdi>debian?2x}} Linux works. |
---- | ---- | ||
Line 62: | Line 64: | ||
---- | ---- | ||
- | ==== Configure Dynamic DNS ==== | + | ย |
+ | ==== User aliases command ==== ย | ||
+ | ย | ||
+ | If you don't have '' | ||
+ | <code bash> ย | ||
+ | touch .bash_aliases | ||
+ | </ | ||
+ | ย | ||
+ | '' | ||
+ | ย | ||
+ | <code bash> ย | ||
+ | alias backup_nginx=' | ||
+ | </ | ||
+ | ย | ||
+ | ----ย | ||
+ | ===== Configure Dynamic DNS ===== | ||
=== Google Domains with ddclient === | === Google Domains with ddclient === | ||
Line 284: | Line 301: | ||
---- | ---- | ||
+ | |||
+ | ===== Disable unused settings ===== | ||
==== Disable suspend mode ==== | ==== Disable suspend mode ==== | ||
Line 319: | Line 338: | ||
---- | ---- | ||
+ | |||
+ | ==== Disable power wireless off ==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo iwconfig wlan0 power off | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Disable Bluetooth service ==== | ||
+ | |||
+ | <code bash> | ||
+ | vi / | ||
+ | </ | ||
+ | |||
+ | Edit the line with '' | ||
+ | <code ini> | ||
+ | AutoEnable = false | ||
+ | </ | ||
+ | |||
+ | A more radical way is to either stop the bluetooth service | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl stop bluetooth.service | ||
+ | </ | ||
+ | |||
+ | Or even more radical is to disable it permanently | ||
+ | <code bash> | ||
+ | sudo systemctl disable bluetooth | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
==== Debugging service ==== | ==== Debugging service ==== | ||
Line 330: | Line 382: | ||
---- | ---- | ||
- | ย | + | ==== Configure locales |
- | ย | + | |
- | ==== Disable power wireless off ==== | + | |
<code bash> | <code bash> | ||
- | | + | |
</ | </ | ||
+ | |||
+ | Deselect unused '' | ||
---- | ---- | ||
- | ==== User defined command alias ==== | ||
- | If you don't have '' | + | ย |
+ | ===== Upgrade & Maintenance =====ย | ||
+ | ย | ||
+ | ==== Major LTS upgrade ==== ย | ||
+ | ย | ||
+ | Upgrade from 18.04 LTS to 20.04 LTS ('' | ||
+ | ย | ||
+ | Official Guide on upgrade [[https:// | ||
+ | ย | ||
+ | === Upgrade on the command line === ย | ||
+ | ย | ||
+ | Update all repository for packages, which already installed on the system. ย | ||
<code bash> | <code bash> | ||
- | touch .bash_aliases | + | sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove |
</ | </ | ||
- | '' | + | Upgrade with major LTS with |
<code bash> | <code bash> | ||
- | alias backup_nginx=' | + | sudo do-release-upgrade |
</ | </ | ||
+ | |||
+ | 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. | ||
+ | </ | ||
---- | ---- | ||
+ | |||
==== Fetch error during update ==== | ==== Fetch error during update ==== | ||
Line 368: | Line 440: | ||
---- | ---- | ||
- | ===== Upgrade php 7.x ===== | + | ==== Upgrade php 7.x ==== |
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 409: | Line 493: | ||
---- | ---- | ||
- | ===== Nginx repository ===== | + | ==== Install & upgrade |
Install the prerequisites: | Install the prerequisites: | ||
Line 458: | Line 542: | ||
---- | ---- | ||
+ | |||
+ | ==== 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 ' | ||
==== Basic commands 101 ==== | ==== Basic commands 101 ==== | ||
- | {{fa> | + | {{fa> |
=== rm === | === rm === | ||
Line 494: | Line 621: | ||
---- | ---- | ||
+ | |||
+ | === find string(s) in files === | ||
+ | |||
+ | <code bash> | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== [output to file] === | === [output to file] === | ||
Line 511: | Line 647: | ||
| | | | | | | | | | | | | | | | ||
- | ย | + | <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. | ||
- | |||
---- | ---- | ||
- | === Find string(s) in files === | ||
- | <code bash> | ||
- | find / | ||
- | </ | ||
- | ---- |