Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
home_server:home_server_setup:other_services:misc [2023-01-08 Sun wk01 20:02] – [man] baumkphome_server:home_server_setup:other_services:misc [2025-09-29 Mon wk40 13:35] (current) – [php packages] baumkp
Line 1: Line 1:
-{{tag>linux command systemd journal journalctl tzdata timezone apt upgrade update install remove crontab man apropos tldr ip tc systemctl journalctl}}+{{tag>linux dmesg command systemd journal journalctl tzdata timezone apt upgrade update install remove crontab man apropos tldr ip tc systemctl journalctl pbcopy pbpaste copy paste}}
 ======Commonly used commands and scripts====== ======Commonly used commands and scripts======
 +
 +=====dmesg====
 +''sudo dmesg'' lists the OS boot messages between grub and os up.
 +''sudo dmesg --level=emerg,alert,crit,err,warn,notice,debug'' give a more succinct list of focus potential problem issues.
 +  *emerg - system is unusable    
 +  *alert - action must be taken immediately
 +  *crit - critical conditions
 +  *err - error conditions
 +  *warn - warning conditions   
 +  *notice - normal but significant condition
 +  *info - informational    
 +  *debug - debug-level messages
 +
 +
 =====systemd===== =====systemd=====
   *Systemctl related commands:   *Systemctl related commands:
Line 18: Line 32:
  
 =====php packages===== =====php packages=====
 +
 +++++Current main used php extenstions:|
 |<38em 28% 36% 12% 12% 12%>| |<38em 28% 36% 12% 12% 12%>|
 ^ package  ^ description  ^  mail server  ^  nextcloud  ^  wiki  ^ ^ package  ^ description  ^  mail server  ^  nextcloud  ^  wiki  ^
 +| php version | php version  |  8.3  |    |    |
 | php-apcu  | object read caching  |  ✔  |  ✔  |  ✔  | | php-apcu  | object read caching  |  ✔  |  ✔  |  ✔  |
 | php-apcu-bc  |    ✔  |  ✔  |  ✔  | | php-apcu-bc  |    ✔  |  ✔  |  ✔  |
-| php-bcmath  |    ✔  |  ✔  |  ✔  |+| php-bcmath  |     ✔  |  ✔  |
 | libapache2-mod-php  | apache2 php module  |  ✔  |  ✔  |  ✔  | | libapache2-mod-php  | apache2 php module  |  ✔  |  ✔  |  ✔  |
 | php-common  | Common php file modules  |  ✔  |  ✔  |  ✔  | | php-common  | Common php file modules  |  ✔  |  ✔  |  ✔  |
Line 35: Line 52:
 | php-mime-type  |    ✔  |  ✘  |  ✘  | | php-mime-type  |    ✔  |  ✘  |  ✘  |
 | php-mysql  |    ✔  |  ✘  |  ✔  | | php-mysql  |    ✔  |  ✘  |  ✔  |
 +| php-mysqli  |    ✔1  |    |    |
 +| php-mysqlnd  |    ✔1  |    |    |
 | php-pear  |    ✔  |  ✘  |  ✘  | | php-pear  |    ✔  |  ✘  |  ✘  |
 | php-redis  |    ✘  |  ✔  |  ✔  | | php-redis  |    ✘  |  ✔  |  ✔  |
 | php-xmlrpc  |    ✘  |  ✘  |  ✔  | | php-xmlrpc  |    ✘  |  ✘  |  ✔  |
-| php7.4-cli   |  ✔  |  ✔  |  ✔  |+| php7.4-cli Included in php  |  ✔  |  ✔  |  ✔  |
 | php7.4-common  |    ✔  |  ✔  |  ✔  | | php7.4-common  |    ✔  |  ✔  |  ✔  |
 | php7.4-curl  |    ✔  |  ✔  |  ✔  | | php7.4-curl  |    ✔  |  ✔  |  ✔  |
Line 54: Line 73:
 | php7.4-zip  |    ✔  |  ✔  |  ✔  | | php7.4-zip  |    ✔  |  ✔  |  ✔  |
 | pkg-php-tools  |    ✔  |  ✘  |  ✘  | | pkg-php-tools  |    ✔  |  ✘  |  ✘  |
 +| pkg-session  |    ✔1  |    |    | 
 +++++ 
 +++++Here’s a list of common PHP extensions used for various functionalities, such as handling images, databases, encryption, and performance optimizations:
 +  * It would seem that packages can vary from distribution to distribution and over time? 
 +  - Essential PHP Extensions 
 +      *These are commonly required for most web applications: 
 +        *php - includes php-cli and php-fpm 
 +        *php-cli – Command-line interface for PHP (used where only php command line interface is required, no fpm) 
 +        *php-fpm - serves php onto a web server (Used where only web server integration is required, no cli) 
 +        *php-common – Core PHP libraries 
 +        *php-json – JSON data handling 
 +        *php-opcache – Improves performance via caching 
 +        *php-readline – Enables command-line interaction 
 +  - Web-Related Extensions 
 +        *php-curl – Handles HTTP requests (e.g., API calls) 
 +        *php-mbstring – Supports multibyte strings (needed for UTF-8) 
 +        *php-xml – XML parsing and processing 
 +        *php-zip – Handles ZIP archives 
 +        *php-gd – Image processing 
 +        *php-imagick – Alternative image processing (using ImageMagick) 
 +        *php-bcmath – Arbitrary precision math (needed for some applications) 
 +  -Database Support 
 +        *php-mysql – MySQL/MariaDB support 
 +        *php-pgsql – PostgreSQL support 
 +        *php-sqlite3 – SQLite database support 
 +        *php-redis – Redis caching support 
 +        *php-mongodb – MongoDB driver for PHP 
 +  -Security and Encryption 
 +        *php-openssl – SSL/TLS support 
 +        *php-mcrypt – Deprecated, but some old applications still need it 
 +        *php-sodium – Modern cryptography 
 +        *php-intl – Internationalization support 
 +  -Performance and Debugging 
 +        *php-xdebug – Debugging and profiling 
 +        *php-apcu – APCu caching for performance 
 +        *php-memcached – Memcached caching support 
 +++++
 ---- ----
 ====php test==== ====php test====
Line 62: Line 117:
 ?></code> ?></code>
  
 +From command line (cli)
 +  * ''php -m'' lists the install php packages
 +  * ''php -v'' lists the current installed/operating php version
 +
 +In Alpine Linux the following php packages need to be installed for php cli to function.
 +  * php
 +  * php-opcache  (not sure about this one?)
 ---- ----
  
Line 192: Line 254:
 Once you're comfortable with using grep to find simple strings as seen above, it can do far more complex tasks. These include but are not limited to: case-insensitive use, more complex patterns (including full regular expressions), exclusion (only show me lines that don't include the pattern), and much, much more. But don't worry about that until after you're familiar with simple grep uses. Once you start, it's truly hard to imagine life without grep anymore! Once you're comfortable with using grep to find simple strings as seen above, it can do far more complex tasks. These include but are not limited to: case-insensitive use, more complex patterns (including full regular expressions), exclusion (only show me lines that don't include the pattern), and much, much more. But don't worry about that until after you're familiar with simple grep uses. Once you start, it's truly hard to imagine life without grep anymore!
  
 +====netstat====
 +  *''netstat -n'' to see active internet connections
 +  *''netstat -ie'' to see kernal interface table
 +  *''netstat -u'' to see status of TCP/IP connections
 +  *''netstat -p'' to see all the active IPv4 connections
 +  *''netstat -a'' to demonstrate the stat of all sockets, TCP and UDP
 +  *''netstat -s'' to see statistical summary for each available protocol
 +  *''netstat -su'' to see statistical summary of UDP
 +  *''netstat -stu'' to see statistical summary of TCP
 +  *''netstat -r'' to kernal route table 
 =====Sed replaces strings===== =====Sed replaces strings=====
  
Line 266: Line 338:
 ss display socket statistics ss display socket statistics
   *''ss -a'' show all sockets (listening ornon-listening)   *''ss -a'' show all sockets (listening ornon-listening)
 +
 +''sudo hwinfo -class network'' to list network heard ware adapter properties
 +=====pbcopy pbpaste=====
 +Also see [[https://wiki.kptree.net/doku.php?id=home_server:home_server_setup:other_services:bash|BASH Customisation]]
 +
 +Linux requires the  package xsel, ''sudo apt install xsel''
 +Some raw xsel examples:
 +  *''%%uname -r | xsel --input --clipboard%%'' pipes the output of the command ''uname -r'' to the clipboard
 +  *''%%xsel --output --clipboard > file.txt%%'' copies the current clipboard contents to the file file.txt
 +
 +To create the command short cuts:
 +  *''vim ~/.bash_aliases'' and add  the following lines:
 +    *''%%alias pbcopy='xsel --input --clipboard'%%''
 +    *''%%alias pbpaste='xsel --output --clipboard'%%''
 +After  adjusting bash setting run ''source ~/.bashrc'' to update configuration
 +
 +To function on remote server:
 +  -Check the above setup on the remote sever
 +  -Check X11 forwarding is activated:
 +    - ''cat /etc/ssh/sshd_config | grep X11'',  output should show a line ''X11Frowarding yes''
 +    -If not, edit the file to make so, and then run ''sudo systemctl restart ssh'' to update the ssh configuration
 +  -Lastly, when ssh into system use the -X flag to use X11 forwarding; ''ssh -X
 +
 +  
 +
 +
 +
 ====Home Server Index==== ====Home Server Index====
 ++++Home Server Index|<pagelist&header> ++++Home Server Index|<pagelist&header>
Line 294: Line 393:
 ---- ----
  
-<- home_server:home_server_setup:other_services:logrotate|Prev ^ home_server:home_server_setup:other_services:index|Start page ^ ->+<- home_server:home_server_setup:other_services:firmware|Prev ^ home_server:home_server_setup:other_services:index|Start page ^ ->