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
Next revisionBoth sides next revision
debian_common [2020/03/21 18:55] โ€“ Jรบne Parkdebian_common [2020/07/28 08:38] โ€“ [Basic commands 101] Jรบne Park
Line 24: 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 64: 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 286: Line 301:
  
 ---- ----
 +
 +===== Disable unused settings =====
  
 ==== Disable suspend mode ====  ==== Disable suspend mode ==== 
Line 321: Line 338:
  
 ---- ----
-==== Debugging service ====  
- 
-<code bash>  
-  sudo service stop sshd   # ssd daemon for example  
-  /usr/sbin/sshd -d       # need to specify full path  
-</code>  
- 
-Find problem from messages in debugging mode.  
- 
----- 
- 
- 
  
 ==== Disable power wireless off ====  ==== Disable power wireless off ==== 
Line 365: Line 370:
  
 ---- ----
-==== User defined command alias ====  
  
-If you don't have ''.bash_aliases'' in your home directory. +==== Debugging service ==== ย 
 <code bash>  <code bash> 
-touch .bash_aliases    +  sudo service stop sshd   # ssd daemon for example ย 
 +  /usr/sbin/sshd -d       # need to specify full path 
 </code>  </code> 
  
-''Edit'' ''.bash_aliases''. Example: Backup Nginx configuration files with date stamp+Find problem from messages in debugging modeย 
 +ย 
 +----ย 
 +ย 
 +==== Configure locales ==== 
  
 <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 dpkg-reconfigure locales
 </code>  </code> 
 +
 +Deselect unused ''locales'' and save them.
  
 ---- ----
 +
 +
 +===== 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> 
 + sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove 
 +</code> 
 +
 +Upgrade with major LTS with 
 +
 +<code bash> 
 + sudo do-release-upgrade -d 
 +</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 394: 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 435: Line 493:
  
 ---- ----
-====Nginx repository ===== +==== Install & upgrade Nginx ==== 
  
 Install the prerequisites: Install the prerequisites:
Line 486: 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 520: 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 537: 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
  • Last modified: 2024/04/18 08:58
  • by Jรบne Park