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 [2020/01/27 12:04] โ [Disable power wireless off] Jรบne Park | debian_common [2020/07/28 08:38] โ [Basic commands 101] 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: | ||
---- | ---- | ||
- | ==== Debugging service ==== | ||
- | |||
- | <code bash> | ||
- | sudo service stop sshd # ssd daemon for example | ||
- | / | ||
- | </ | ||
- | |||
- | Find problem from messages in debugging mode. | ||
- | |||
- | ---- | ||
- | |||
- | |||
==== Disable power wireless off ==== | ==== Disable power wireless off ==== | ||
Line 363: | Line 370: | ||
---- | ---- | ||
- | ==== User defined command alias ==== | ||
- | If you don't have '' | + | ==== Debugging service ==== ย |
<code bash> | <code bash> | ||
- | touch .bash_aliases | + | sudo service stop sshd # ssd daemon for example ย |
+ | / | ||
</ | </ | ||
- | '' | + | Find problem from messages in debugging mode. ย |
+ | ย | ||
+ | ----ย | ||
+ | ย | ||
+ | ==== Configure locales ==== | ||
<code bash> | <code bash> | ||
- | alias backup_nginx=' | + | sudo dpkg-reconfigure locales |
</ | </ | ||
+ | |||
+ | Deselect unused '' | ||
---- | ---- | ||
+ | |||
+ | |||
+ | ===== 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> | ||
+ | sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove | ||
+ | </ | ||
+ | |||
+ | Upgrade with major LTS with | ||
+ | |||
+ | <code bash> | ||
+ | sudo do-release-upgrade -d | ||
+ | </ | ||
+ | |||
+ | 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 392: | 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 433: | Line 493: | ||
---- | ---- | ||
- | ===== Nginx repository ===== | + | ==== Install & upgrade |
Install the prerequisites: | Install the prerequisites: | ||
Line 484: | Line 544: | ||
==== Basic commands 101 ==== | ==== Basic commands 101 ==== | ||
- | {{fa> | + | {{fa> |
=== rm === | === rm === | ||
Line 518: | Line 579: | ||
---- | ---- | ||
+ | |||
+ | === find string(s) in files === | ||
+ | |||
+ | <code bash> | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== [output to file] === | === [output to file] === | ||
Line 535: | Line 605: | ||
| | | | | | | | | | | | | | | | ||
- | ย | + | <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 / | ||
- | </ | ||
- | ---- |