If you need to display date one or two days ago you could use the following command in the terminal:
#!/usr/bin/evn bash echo $(date -d '-1days' +'%Y-%m-%d') $(date -d '-2days' +'%Y-%m-%d')
web development and system administration of Linux
If you need to display date one or two days ago you could use the following command in the terminal:
#!/usr/bin/evn bash echo $(date -d '-1days' +'%Y-%m-%d') $(date -d '-2days' +'%Y-%m-%d')
Are you a PHP enthusiast, developer, or just curious about the world of PHP? Look no further! We’re thrilled to introduce the brand-new Telegram channel, PHP Dinos.
What to expect:
Whether you’re a seasoned PHP developer or just starting your PHP journey, PHP Dinos is your go-to destination for all things PHP-related. Let’s come together to explore, learn, and share our passion for PHP programming.
Join us now at https://t.me/phpdinos and be part of a vibrant community of PHP enthusiasts. Don’t miss out on the fun – see you there!
#PHP #WebDevelopment #Programming #Community #PHPDinos
If you need to make a bulk files rename on Linux you could use the following Bash Shell script:
#!/bin/bash # Specify the directory where the files are located directory="/home/user/Videos/2023-08-18" # Change to the directory cd "$directory" # Iterate over the files matching the pattern and rename them for file in [0-9]*.mp4; do new_filename=$(echo "$file" | sed -E "s/^([0-9]+)\.mp4$/_name-prefix-\1.mp4/") mv -v "$file" "$new_filename" done
Just replace directory variable value to an actual path to folder with *.mp4 files on your system.
Replace _name-prefix- with a desired file names prefix.
You could use the following Gist: with bulk mp4 files rename shell script.
Check out Video tutorial on how to Bulk files rename in a bash shell script for Linux.
To convert mp3 file to aac format on Linux you could use the following command:
ffmpeg -i inputFileName.mp3 outputFileName.aac
Replace inputFileName.mp3 and outputFileName.aac with actual file names in command above.
If you are using Docker setup for Yii2 Advanced application template to build REST API as I do, you could be interested in the command below:
tee /app/api/web/.htaccess <<EOF RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php EOF
it is generating .htaccess configuration file for Apache web server to redirect all requests from not existing files or directories to index.php file in API web application inside Docker container.
Multiple lines below starting <
Web server Apache Mod_rewrite module should be installed and enabled to make it work.
I’ve faced the following error running CoreShop 3.0.2 demo in a Docker running command:
docker-compose up -d
I’ve got the following error:
network cors_dev declared as external, but could not be found
To fix it run the commands below:
docker network create "cors_dev" docker-compose up -d
I hope this will save several minutes of your time.
During the Pimcore update from older versions to the most recent 10.5 at this time I’ve got the following errpr:
Attempted to load class "Twig_Function" from the global namespace. Did you forget a "use" statement?
To fix it add the following use statement to your class:
use Twig\TwigFunction;
And replace all Twig_Function to TwigFunction in your php class file code.
I’ve completed a PHP Yii2 Framework Advanced course and certification on an ITVDN platform.
Previously, I’ve created my first own Yii2 Framework Essentials course on the ITVDN platform.
To search commits by the author you can use the following command:
# git log --author="Taras Shkodenko"
where Taras Shkodenko example author name.
To get the list of all authors in a current Git repository use the useful command below:
# git shortlog -sne --all
Today I’ve complete PHP Symfony Developer Certification on ITVDN Platform.