Forwarded from Laravel World
Laravel немного ускоряется при переходе с PHP 8.1 на 8.2. А с PHP 8.3 вы получаете еще плюс 38% производительности.
https://kinsta.com/blog/php-benchmarks/
https://kinsta.com/blog/php-benchmarks/
🐳1
Please open Telegram to view this post
VIEW IN TELEGRAM
Host: Xubuntu 23.10 (mantic)
# id
uid=1000(roman) gid=1000(roman) ...
Docker Container: Debian 12 (bookworm)
PhpDockerfile:
FROM php:8.3-fpm
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN apt-get update && apt-get install sudo
RUN groupadd -g 1000 mygroup && \
useradd -u 1000 -g 1000 -m roman && \
echo "roman:root" | chpasswd && \
usermod -aG sudo roman
# Other RUN instructions ...
USER roman
#docker #fix #php #dockerfile #chmod #sponsor
💎 Sponsored
Please open Telegram to view this post
VIEW IN TELEGRAM
Linux Nano Hotkeys:
For next occurrence just Ctrl + W and Enter
#bash #nano #linux
Ctrl + Delete ➡️ Drop Next WordAlt + Backspace ➡️ Drop Previous WordCtrl + L ➡️ Refresh ScreenCtrl + K ➡️ Drop Current LineShift + Arrows ➡️ Select Text Ctrl + K ➡️ Cut SelectedCtrl + U ➡️ PasteCtrl + 6 ➡️ Set MarkShift + Arrows ➡️ Select TextAlt + 6 ➡️ Unset Mark / CopyCtrl + U ➡️ PasteAlt + 3 ➡️ CommentAlt + U ➡️ Ctrl + Z (Undo)Alt + E ➡️ RedoAlt + N ➡️ Show line numberCtrl + O / Ctrl + S ➡️ SaveCtrl + X ➡️ Save & ExitCtrl + W ➡️ Write text for search, then Enter.For next occurrence just Ctrl + W and Enter
#bash #nano #linux
#bash #linux #debian #root #sudo
How to ignore sudo in commands on server (if only root user exists):
Problem:
Before:
After:
Tested on Debian 11 (bullseye)
How to ignore sudo in commands on server (if only root user exists):
Problem:
root@mx1:~# sudo nano somefile.txt
-bash: sudo: command not found
nano /etc/bash.bashrc
Before:
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1"
return $?
else
printf "%s: command not found\n" "$1" >&2
return 127
fi
}
fi
After:
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1"
return $?
else
if [ "$EUID" -eq 0 ] && [[ $1 == sudo* ]]; then
full_command="$0 $@"
drop_sudo="${full_command#-}"
drop_sudo="${drop_sudo#bash}"
drop_sudo="${drop_sudo# }"
drop_sudo="${drop_sudo#sudo}"
drop_sudo="${drop_sudo# }"
bash -c "$drop_sudo"
return $?
else
printf "%s: command not found\n" "$1" >&2
fi
return 127
fi
}Tested on Debian 11 (bullseye)
#linux #boot #apt #kernel
Current Linux Kernel:
Show Installed Kernels:
Problem:
Solution:
or
#image #core #mkinitramfs #failure #pigz
Current Linux Kernel:
uname -r
5.10.0-23-amd64
Show Installed Kernels:
dpkg -l | grep linux-image | awk '{print$2}'linux-image-5.10.0-12-amd64
linux-image-5.10.0-23-amd64
linux-image-5.10.0-26-amd64
linux-image-5.10.0-28-amd64
linux-image-amd64
Problem:
apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up linux-image-5.10.0-28-amd64 (5.10.209-2) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-28-amd64
pigz: abort: write error on <stdout> (No space left on device)
E: mkinitramfs failure pigz 28
update-initramfs: failed for /boot/initrd.img-5.10.0-28-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.10.0-28-amd64 (--configure):
installed linux-image-5.10.0-28-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-5.10.0-28-amd64 (= 5.10.209-2); however:
Package linux-image-5.10.0-28-amd64 is not configured yet.
dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-5.10.0-28-amd64
linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
Solution:
apt remove --purge linux-image-5.10.0-12-amd64
or
sudo apt-get autoremove --purge
dpkg -l 'linux-image-*' | awk '{ if ($1 == "ii") print $2}' | grep -v $(uname -r | grep -o '^[^-]*-[^-]*') | xargs sudo apt-get -y purge#image #core #mkinitramfs #failure #pigz
#ubuntu #debian #xubuntu #sources #repositories
Edit sources:
Other sources directory:
Edit sources:
sudo nano /etc/apt/sources.list
alias sources='sudo nano /etc/apt/sources.list'
Other sources directory:
sudo mc /etc/apt/sources.list.d
#debian #supervisor #super #systemctl #bot #superpupper
Supervisor installation & configuration:
Supervisor installation & configuration:
sudo apt update && sudo apt install supervisor
sudo systemctl status supervisor
sudo nano /etc/supervisor/conf.d/bot.conf
[program:bot]
command=/var/www/bot.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/bot.err.log
stdout_logfile=/var/log/bot.out.log
sudo chmod +x /var/www/bot.sh
sudo supervisorctl
sudo supervisorctl stop
sudo supervisorctl start
sudo supervisorctl reread
sudo supervisorctl restart
sudo supervisorctl update
Reconfigure Locales on Debian Server:
#debian #locales #server #кракозябры #characters #кодировка #encoding
dpkg-reconfigure locales
#debian #locales #server #кракозябры #characters #кодировка #encoding
Some docker PHP container errors:
Error:
Solution:
Error:
Solution:
Error:
Solution:
Error:
Solution:
#docker #php #error #errors #dockerfile
Error:
=> ERROR [php stage-0 5/9] RUN docker-php-ext-install curl
...
1.877 configure: error: Package requirements (libcurl >= 7.29.0) were not met:
...
Solution:
RUN apt -y install libcurl4-openssl-dev
Error:
=> ERROR [php stage-0 8/10] RUN docker-php-ext-install pdo_pgsql
...
1.853 configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
...
Solution:
RUN apt -y install libpq-dev
Error:
=> ERROR [php stage-0 9/10] RUN docker-php-ext-install zip
...
1.930 configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:
...
Solution:
RUN apt -y install libzip-dev
Error:
=> ERROR [php stage-0 11/11] RUN docker-php-ext-install mbstring
...
1.758 configure: error: Package requirements (oniguruma) were not met:
...
Solution:
RUN apt -y install libonig-dev
#docker #php #error #errors #dockerfile
Bash script automatically execution after system startup on your Xubuntu system:
🖱
#xubuntu #autostart #linux #bash #autostart #startup
cd ~
nano bootstrap.sh
nohup "/home/roman/.local/share/JetBrains/Toolbox/apps/phpstorm/bin/phpstorm.sh" > /dev/null 2> /dev/null &
nohup "google-chrome-stable" > /dev/null 2> /dev/null &
nohup "/opt/Telegram/Telegram" > /dev/null 2> /dev/null &
sudo chmod 777 bootstrap.sh
MenuSession and StartupApplication Autostart Fill name, description & command/home/roman/bootstrap.sh
Add & Close#xubuntu #autostart #linux #bash #autostart #startup
Please open Telegram to view this post
VIEW IN TELEGRAM