How to speed up Ubuntu 18

Illustration: Bionic Beaver is slow
Illustration: Bionic Beaver is slow

TL;DR: A list of tweaks and settings that can improve your Ubuntu 18x’s speed A LOT.

Reading time: around 40 minutes, so if you don’t have that much time on your hand, you can go read something else.

If you’re one of the people who have noticed a significant change in booting speed, shutdown speed, and generally, operating speed of your computer after upgrading or installing Ubuntu 18.x, then read on, this article is for you.

I have an older model Lenovo T410 (4×2.4Ghz i5, 4GB RAM), that was working absolutely flawlessly with Ubuntu before the 18.04 version, and even with flavors of Ubuntu like Linux Mint Cinnamon based on Ubuntu 17, but after 18x came along, things started moving slower and slower.

Read more

How to regenerate icon cache on linux ?

A GTK configuration screen complaining about a missing icon cache file on Peppermint Linux
A GTK configuration screen complaining about a missing icon cache file on Peppermint Linux

If you see some widget or configuration dialog in Linux,  complaining about the fact that your icon cache files are missing, here’s how you can easily fix it.

Using the manual method, or folder-by-folder method that is displayed in the small tooltip on the image, is cumbersome, and if you have a lot of icons that have missing cache files, it can take up a lot of time and would force you to do a lot of unnecessary typing.

*see update at the end*

Read more

How to install Prestashop on mysql 5.7 or newer

TL;DR version: here’s how you can solve the Prestashop installation error “SQL error on query Invalid default value for ‘last_connection_date'”.

A part of the Prestahop 1.6 Installation Assistant
A part of the Prestahop 1.6 Installation Assistant

If you are installing a Prestashop CMS for your e-commerce needs on a server that is configured with a mysql backend with version numbers 5.7, or any of its newer versions, you might get stuck at 12% of the installation screen, and get an error message that says something like “SQL error on query Invalid default value for ‘last_connection_date'” . This error simply means that the version of Prestashop that you are trying to install, used to handle some database management tasks differently, then the current mysql server expects it.

Most importantly, in the newer versions of the mysql server, beginning with version 5.6, some stricter data validation and field validation defaults have been implemented. And because of those “new rules”, some older php/mysql based software, and some CMS-es like Prestashop, will fail to install.

To circumvent these defaults, you can either temporarily, or permanently modify the way the mysql server loads on your system (if you have access to the “my.cnf” on Linux, usually located at /etc/mysql/my.cnf, or “my.ini” on Windows systems).

Open a simple text-editor in terminal (on Linux) or notepad if you are on Windows, and open your “my.cnf” or “my.ini” file. Add the configuration directive that will REMOVE the strict defaults enforcement.

sql-mode=””

If you already have blocks/sections in your config file, sections like [mysql] or  [mysqld], add it to [mysqld].

If your file is the default one, it will probably be almost empty, and end with 2 lines beginning with

!includedir….

directives.

Add these two lines then, before the !includedir directives:

[mysqld]

sql-mode=””

Save the file. Restart your mysql server. (service mysql restart from a terminal, if you are on a Linux box, and the Restart Mysql button if you are on a Wamp server on Windows).

Retry the installation by clicking on the “click here to restart” link in the Prestashop installation screen.

Has this how-to helped you ? Please share the blog with your friends on your preferred social media. Still can’t install it ? Leave a comment in the commentbox, with the error message you’ve received, and I’ll do my best to help you.

 

Smarty template tricks for OG:tags with international charsets

TL;DR version: if you use opencart or prestashop and your shares on facebook don’t look good, you have product images missing or product descriptions missing, read the article completely, to learn how to properly og: tag your templates.

Some of my Prestashop and Opencart customers, especially French and eastern-europeans use in their product and category names special apostrophe characters, that while look good on the product page, in the product or category description itself, cause a very strange behaviour in Facebook’s sharer apps.

Read more

Quick apache .htaccess rules writer in PHP

Sometimes it’s good to have a quick .htaccess rules writer for your server / host, to block a larger number of IP addresses from accessing stuff on your site, like spambots, or people (bored kids ?) who try to hack into your site or blog. If you use any kind of statistics plugin on your wordpress blog, or any other stats on other platforms, you can most likely see the IP addresses and the paths these visitors have taken, trying to access your site in an unauthorised way, like trying to exploit a revolution slider vulnerability to show your config.php, or some other plugin.

So here’s the quickest way to deal with these IP addresses, presuming you are on a linux box with PHP installed, or on any computer with PHP available in command line (php5-cli package on debian/ubuntu/mint/fedora/q4os , basically, on most modern linux systems, and xampp or wampp package on windows based machines).

Read more

Trick to use against idiots who try to hack your site

TL:DR version: some examples of how some lifewaster hacker-wannabes try to gain unauthorised access to sites and blogs and how you can simply and effectively block them

Obviously, some people have too much time on their hands, and don’t appreciate life enough in order to do something useful with theirs, so they spend hours and days trying to hack into other people’s servers, websites, and webapps. How do I know this ? Well, this year only, I’ve found and filtered out over 300 IP addresses and user agents, behavioral patterns and 404s (not found messages) in the logs of THIS SITE ALONE (I manage several sites and blogs, both for myself and coworkers and some companies, all on different servers), that have all indicated that some idiots spend hours a day trying to hack into wordpress, joomla, and other CMS (content-management system) based sites.

Some of the IP addresses clearly indicate that they do have some serious resources at their disposal, like hacking attacks coming from datashack.net, a company or hosting service with several thousands of IP addresses, or ovh.net, again, with several hundreds of IPs at their disposal. Some of the log entries (see some examples below) clearly indicate that they either have no clue how a webserver actually operates, or they base their attacks on outdated information from 10 years ago, when hacking into a server was possible simply by knowing what components the CMS has and looking for ones that can be exploited via SQL injections or concurrent command executions.

Obviously, almost all major CMS engines are constantly being improved, and security flaws are consistently being patched by all well-known platforms, however, it looks like some of these life-wasters and hacker wannabes haven’t found out about that and try EVERY DAY the same tactict, the same M.O (modus operandi), on THE SAME SITE, in some cases from the same IP address. Now if that is not a good example of insanity, I don’t know what is 🙂

Read more