Monday, November 21, 2022

Programmatically cache clear in PrestaShop 1.6 , 1.7 | PrestaCraft

Programmatically cache clear in PrestaShop 1.6 , 1.7 | PrestaCraft

🔥 Save unlimited web pages along with a full PDF snapshot of each page.
Unlock Premium →

Today I will show you how to programatically clear cache in PrestaShop. For example, you can make a CRON task which will execute this little PHP script once or more per day – depending on your needs.

1. Create PHP file in your store root (main) directory and name it as you wish – in this example it'll be cache_clear.php
2. Open this file and paste

include('./config/config.inc.php');    $token = Tools::getValue('token');    if($token == "vBnmmP3218") {      Tools::clearSmartyCache();      Tools::clearXMLCache();      Media::clearCache();      Tools::generateIndex();      echo "Cache clear ended successfully.";  } else {      echo "Wrong security token - cache clear failed.";  }

3. Change the string vBnmmP3218 to your random one (stronger is more secure).
4. Save the file.
5. Add script URL to your CRON task manager or execute it directly via your browser in format: http://{your_store_url}/cache_clear.php?token=vBnmmP3218

For example: http://example.com/cache_clear.php?token=vBnmmP3218

Source: https://prestacraft.com/programmatically-cache-clearing-in-prestashop/#
This web page was saved on Monday, Nov 21 2022.

Upgrade to Premium Plan

✔ Save unlimited bookmarks.

✔ Get a complete PDF copy of each web page

✔ Save PDFs, DOCX files, images and Excel sheets as email attachments.

✔ Get priority support and access to latest features.

Upgrade now →

Saturday, November 05, 2022

10 Linux Terminal Tips and Tricks to Enhance Your Workflow

10 Linux Terminal Tips and Tricks to Enhance Your Workflow

🔥 Save unlimited web pages along with a full PDF snapshot of each page.
Unlock Premium →

Are you a Linux user and/or administrator? These 10 terminal tricks will show you some new and exciting ways you can enhance your workflow, shorten longer tasks, and even have a little fun along the way.

Commands used in this video

Simplify package installation

Use the alias command to create custom commands of your own, and feel free to get creative. In the video, an example is shown of simplifying package manager commands. For example, with Debian/Ubuntu:

alias install="sudo apt install"

With that alias in place, you can simply type install in order to install a package:

install tmux

Similarly, you can shorten that same alias down to just a single character:

alias i="sudo apt install"

And then, package management is much easier:

i tmux

Go ahead and create your own. Here's another one:

alias e="nano"

And that will shorten the command for your text editor.

In order to keep these aliases around, be sure to add the commands that create them to your ~/.bashrc file, so that way they're automatically recreated every time you open a terminal.

Checking your weather forecast

Believe it or not, you can check your local weather anytime right from within your terminal:

curl wttr.in

And there you go – you now know what your weather is like without even having to step outside. Check out the project that makes this possible here.

Running an Internet Speed Test (From Your Terminal)

What's your download and upload speed? This alias will let you know:

speedtest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -'

Now you can simply run speedtest anytime to check your Internet speed.

Jay's custom bash prompt

To use the same bash prompt style as Jay, create the file ~/home/.bash_prompt and place the following inside:

BRACKET_COLOR="\[\033[38;5;35m\]"  CLOCK_COLOR="\[\033[38;5;35m\]"  JOB_COLOR="\[\033[38;5;33m\]"  PATH_COLOR="\[\033[38;5;33m\]"  LINE_BOTTOM="\342\224\200"  LINE_BOTTOM_CORNER="\342\224\224"  LINE_COLOR="\[\033[38;5;248m\]"  LINE_STRAIGHT="\342\224\200"  LINE_UPPER_CORNER="\342\224\214"  END_CHARACTER="|"    tty -s && export PS1="$LINE_COLOR$LINE_UPPER_CORNER$LINE_STRAIGHT$LINE_STRAIGHT$BRACKET_COLOR[$CLOCK_COLOR\t$BRACKET_COLOR]$LINE_COLOR$LINE_STRAIGHT$BRACKET_COLOR[$JOB_COLOR\j$BRACKET_COLOR]$LINE_COLOR$LINE_STRAIGHT$BRACKET_COLOR[\H:\]$PATH_COLOR\w$BRACKET_COLOR]\n$LINE_COLOR$LINE_BOTTOM_CORNER$LINE_STRAIGHT$LINE_BOTTOM$END_CHARACTER\[$(tput sgr0)\] "

Save that file, and then open up your ~/.bashrc and place the following at the end of the file:

source ~/.bash_prompt

The next terminal window you open should use the new prompt.

View Linux command cheat sheets

Viewing man pages might be useful, but cheat sheets are simpler and more to the point. You can view a cheat sheet from cheat.sh by running a command like the following:

curl https://cheat.sh/ls

Replace the command name at the end with the command you want to see information on.

Want more?

Check out the video for even more terminal tips and tricks!

Source: https://www.learnlinux.tv/10-linux-terminal-tips-and-tricks-to-enhance-your-workflow/
This web page was saved on Saturday, Nov 05 2022.

Upgrade to Premium Plan

✔ Save unlimited bookmarks.

✔ Get a complete PDF copy of each web page

✔ Save PDFs, DOCX files, images and Excel sheets as email attachments.

✔ Get priority support and access to latest features.

Upgrade now →