debian_common

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
debian_common [2019/06/24 00:12]
Júne Park [Delete all files except for desired file types]
debian_common [2020/07/28 17:38] (current)
Júne Park [Basic commands 101]
Line 1: Line 1:
 <​nav> ​ <​nav> ​
   * {{fa>​server?​color=#​8B0000}} Linux   * {{fa>​server?​color=#​8B0000}} Linux
-    * [[:​rpi_common|General Things on Raspbian]]+    * [[:​rpi_common|■ General Things on Raspbian]]
     * [[:​rpi_autism|Media Ditorium ─ AUTiSM Rainbow]]     * [[:​rpi_autism|Media Ditorium ─ AUTiSM Rainbow]]
     * [[:​rpi_epigen|Private Cellarium ─ EPiGEN Crystal]]     * [[:​rpi_epigen|Private Cellarium ─ EPiGEN Crystal]]
     * [[:​rpi_nimbus|Webius Officium ─ NiMBUS deBlanc]]     * [[:​rpi_nimbus|Webius Officium ─ NiMBUS deBlanc]]
-    * [[:​debian_common|General info on Debian Linux]]+    * [[:​debian_common|■ General info on Debian Linux]]
     * [[:​deb_mutism|Opus Imperium ─ MUTiSM Magnum]]     * [[:​deb_mutism|Opus Imperium ─ MUTiSM Magnum]]
 +    * [[:​deb_gilead|Actu Periculum ─ GiLEAD Argenta]]
 +    * [[:​deb_debris|Finca LaDichium ─ DEBRiS Chrome]]
   * {{fa>​windows?​color=#​0000A0}} Windows   * {{fa>​windows?​color=#​0000A0}} Windows
-    * [[:​pc_common|Common Works on Windows]]+    * [[:​pc_common|■ Common Works on Windows]]
     * [[:​pc_mesonism|Primus Workstation ─ MESONiSM]]     * [[:​pc_mesonism|Primus Workstation ─ MESONiSM]]
     * [[:​pc_mesonium|Manibus Tablet ─ MESONiUM]]     * [[:​pc_mesonium|Manibus Tablet ─ MESONiUM]]
Line 14: Line 16:
     * [[:​pc_mesonity|Praevus Station ─ MESONiTY]]     * [[:​pc_mesonity|Praevus Station ─ MESONiTY]]
   * {{fa>​android?​color=#​006400}} Android   * {{fa>​android?​color=#​006400}} Android
-    * [[:​cell_common|Common Stuffs on Androids]]+    * [[:​cell_common|■ Common Stuffs on Androids]]
     * [[:​cell_epiaux|Júne'​s Primus ─ EPiAUX 5X]]     * [[:​cell_epiaux|Júne'​s Primus ─ EPiAUX 5X]]
     * [[:​cell_epihex|Júne'​s Extentus ─ EPiHEX 6]]     * [[:​cell_epihex|Júne'​s Extentus ─ EPiHEX 6]]
Line 22: Line 24:
 </​nav>​ </​nav>​
  
-===== General info on Debian ​Linux ===== +====== General info on Debian ​======
  
 {{:​playground:​boo_the_bunny_36.png?​nolink&​250|}} {{:​playground:​boo_the_bunny_36.png?​nolink&​250|}}
  
 ---- ----
-==== 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 ''​.bash_aliases''​ in your home directory.  
 +<code bash>  
 +touch .bash_aliases ​    
 +</​code>​  
 + 
 +''​Edit''​ ''​.bash_aliases''​. Example: Backup Nginx configuration files with date stamp.  
 + 
 +<code bash>  
 +alias backup_nginx='​sudo rsync -avh --progress /etc/nginx/ /​home/​user/​storage/​Nginx.Config//​nginx_config_`date +"​%Y%m%d"​`/'​ 
 +</​code>​  
 + 
 +---- 
 +===== 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 
 +</​code> ​
 +
 +----
 +
 +==== Disable Bluetooth service ==== 
 +
 +<code bash> ​
 +vi /​etc/​bluetooth/​main.conf
 +</​code> ​
 +
 +Edit the line with ''​AutoEnable''​ with ''​false'' ​
 +<code ini>
 +AutoEnable = false
 +</​code> ​
 +
 +A more radical way is to either stop the bluetooth service
 +
 +<code bash>
 +sudo systemctl stop bluetooth.service
 +</​code>​
 +
 +Or even more radical is to disable it permanently
 +<code bash> ​
 +sudo systemctl disable bluetooth
 +</​code> ​
 +
 +----
 +
 ==== Debugging service ====  ==== Debugging service ==== 
  
Line 330: Line 382:
 ---- ----
  
- +==== Configure locales ​==== 
- +
-==== Disable power wireless off ==== +
  
 <code bash> ​ <code bash> ​
- ​sudo ​iwconfig wlan0 power off + ​sudo ​dpkg-reconfigure locales
 </​code> ​ </​code> ​
 +
 +Deselect unused ''​locales''​ and save them.
  
 ---- ----
-==== User defined command alias ====  
  
-If you don't have ''​.bash_aliases''​ in your home directory+ 
 +===== Upgrade & Maintenance ===== 
 + 
 +==== Major LTS upgrade ====  
 + 
 +Upgrade from 18.04 LTS to 20.04 LTS (''​Focal Fossa''​)  
 + 
 +Official Guide on upgrade [[https://​meson.in/​2ALsTwg|How to upgrade from Ubuntu 18.04 LTS to 20.04 LTS today]] <​sub> ​ --- Updated on //​2020/​07/​11 03:40// </​sub>​  
 + 
 +=== 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 ​
 </​code> ​ </​code> ​
  
-''​Edit''​ ''​.bash_aliases''​. Example: Backup Nginx configuration files with date stamp. ​+Upgrade with major LTS with 
  
 <code bash> ​ <code bash> ​
-alias backup_nginx='​sudo rsync -avh --progress /etc/nginx/ /​home/​user/​storage/​Nginx.Config//​nginx_config_`date +"​%Y%m%d"​`/'​+ sudo do-release-upgrade ​-d 
 </​code> ​ </​code> ​
 +
 +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 '​software-properties'​ tool 
 +or your package manager. ​
 +</​code>​
  
 ---- ----
 +
 ==== 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:​ondrej/​php 
 +</​code>​  
 <code bash> ​ <code bash> ​
 wget -q https://​packages.sury.org/​php/​apt.gpg -O- | sudo apt-key add - wget -q https://​packages.sury.org/​php/​apt.gpg -O- | sudo apt-key add -
-echo "deb https://​packages.sury.org/​php/ ​stretch ​main" | sudo tee /​etc/​apt/​sources.list.d/​php.list+echo "deb https://​packages.sury.org/​php/ ​`lsb_release -cs` main" | sudo tee /​etc/​apt/​sources.list.d/​php.list
 </​code>​ </​code>​
 +
 +Append ''​Nginx mainline''​ packages ​
 +
 +<code bash> ​
 +sudo add-apt-repository ppa:​ondrej/​nginx-mainline
 +</​code> ​
 +
 +Update source lists
  
 <code bash> ​ <code bash> ​
Line 409: Line 493:
  
 ---- ----
-====Nginx repository ===== +==== Install & upgrade ​Nginx ==== 
  
 Install the prerequisites:​ Install the prerequisites:​
Line 460: Line 544:
 ==== Basic commands 101 ====  ==== Basic commands 101 ==== 
  
-{{fa>​terminal?​size=24&​color=#​AABBCC}} [[https://​devhints.io/​|Rico'​s cheatsheets]] -- First glimpse on {{fa>​linux?​color=#​a80030}} **Linux commands**+{{fa>​terminal?​size=24&​color=#​AABBCC}} [[https://​devhints.io/​|Rico'​s cheatsheets]] -- first glimpse on {{fa>​linux?​color=#​a80030}} **Linux commands** 
  
 === rm ===  === rm === 
Line 494: Line 579:
  
 ---- ----
 +
 +=== find string(s) in files ===
 +
 +<code bash> ​
 +find /​path/​to/​files/​ -type f | xargs grep -n '​string_to_search'​
 +</​code> ​
 +
 +----
 +
 === [output to file] ===  === [output to file] === 
  
Line 511: Line 605:
 | | | | | | |  | | | | | | | 
  
- +<code bash> 
-  command > output.txt +command > output.txt ​  ​ 
 +</​code> ​
 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.
  
-  ​command >> output.txt +<code bash> 
 +command >> output.txt 
 +</​code> ​
 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.
  
-  ​command 2> output.txt +<code bash> 
 +command 2> output.txt 
 +</​code> ​
 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.
  
-  ​command 2>> output.txt +<code bash> 
 +command 2>> output.txt 
 +</​code> ​
 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.
  
-  ​command &> output.txt +<code bash> 
 +command &> output.txt 
 +</​code> ​
 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.
  
-  ​command &>>​ output.txt +<code bash> 
 +command &>>​ output.txt 
 +</​code> ​
 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..
  
-  ​command | tee output.txt +<code bash> 
 +command | tee output.txt 
 +</​code> ​
 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.
  
-  ​command | tee -a output.txt +<code bash> 
 +command | tee -a output.txt 
 +</​code> ​
 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> 
 +(*) 
 +</​code> ​
 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?"​ on Stack Overflow for some ways how this can be done e.g. by swapping streams or using process substitution. 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?"​ on Stack Overflow for some ways how this can be done e.g. by swapping streams or using process substitution.
  
-  ​command |& tee output.txt +<code bash> 
 +command |& tee output.txt 
 +</​code> ​
 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.
  
-  ​command |& tee -a output.txt +<code bash> 
 +command |& tee -a output.txt 
 +</​code> ​
 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 /​path/​to/​files/​ -type f | xargs grep -n '​string_to_search'​ 
-</​code> ​ 
  
----- 
  • debian_common.1561302732
  • Last modified: 2019/06/24 00:12
  • by Júne Park