2 = 1 ?!? — not really

As many people, we came across the following photo:

False proof that 2 = 1

In this mathematical “proof” the author tries to convince us that there is an error in math and it can be demonstrated using the above example. The steps taken by this person are the following:

  1. The proof starts by defining a equal to b (a = b).
  2. Then, it multiplies both sides with a which results to a^2 = ab.
  3. Next, it subtracts from both sides b^2 and we get a^2-b^2 = ab-b^2.
  4. Following, it extracts the common multiplier of both sides (a-b) resulting to (a+b)(a-b) = b(a-b).
  5. Here’s the nice part, the author divides both sides with (a-b) which results to a+b = b.
  6. Since a = b, it replaces a on the left side with a b and produces this state b+b = b => 2b = b.
  7. Finally, it divides by b both sides which results to 2 = 1.

The reason that this proof is false is because in step 5, where it divides both sides with (a-b) it really is dividing both sides with 0 (since we know for sure that a = b from step 1) which it cannot be defined as a valid division. So everything from step 5 and forward are invalid and thus the proof is wrong.


The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

Recently, we were trying to update a WordPress installation that was running under apache in a CentOS 7. When we would press the lovely blue button to update WordPress we would get the following error:

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

Installation Failed

At first we thought it was an issue with the privileges on the folder, so we did the following steps to fix the issue:

Find which user is controlling apache server:

We executed the following command to get the name of the local user that was handling the apache web server:

ps -ef | grep apache;

From which, we got the following results:

apache 7289 8523 1 10:35 ? 00:00:03 /usr/sbin/httpd -DFOREGROUND
apache 7293 8523 0 10:35 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 7316 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7317 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7335 8523 1 10:35 ? 00:00:03 /usr/sbin/httpd -DFOREGROUND
apache 7347 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7348 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7349 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 7350 8523 0 10:35 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 7351 8523 0 10:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
root 8071 7978 0 10:40 pts/1 00:00:00 grep --color=auto apache

The first column is the name of the user, so we found out that apache local user is the user executing the apache web server.

Repair all file and folder access rights:

After getting the above information we proceeded to update the access rights in our WordPress installation folder (/var/www/example.com)

find /var/www/example.com -type d -exec chmod 755 '{}' \;
find /var/www/example.com -type f -exec chmod 644 '{}' \;
chown -R apache:apache /var/www/example.com;

To our disappointment, nothing changed and we would still get the same error. Luckily enough we had another ace in our sleeve!

Checking the security context of each file and folder:

We executed the following command (ls -Z) to get the security context of the files and folders in the installation folder of WordPress:

ls -Z /var/www/example.com;

Where we got the following results:

drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 api
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 favicon.ico
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 index.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 license.txt
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 readme.html
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 r-file.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wordfence-waf.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-activate.php
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-admin
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-blog-header.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-comments-post.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-config.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-config-sample.php
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 wp-content
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-cron.php
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-includes
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-links-opml.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-load.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-login.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-mail.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-settings.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-signup.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wp-trackback.php
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 xmlrpc.php

What we got from this result: all files and folders marked with the httpd_sys_content_t are not directly editable by the apache web server even though the user has the rights to do so as it is a security step by SELinux.

Use this type for static web content, such as .html files used by a static website. Files labeled with this type are accessible (read only) to httpd and scripts executed by httpd. By default, files and directories labeled with this type cannot be written to or modified by httpd or other processes. Note that by default, files created in or copied into /var/www/html/ are labeled with the httpd_sys_content_t type.


The simple solution

We just changed the security context for the folders and files to httpd_sys_rw_content_t which allows apache web server to edit the files:

Files labeled with this type can be written to by scripts labeled with the httpd_sys_script_exec_t type, but cannot be modified by scripts labeled with any other type. You must use the httpd_sys_rw_content_t type to label files that will be read from and written to by scripts labeled with the httpd_sys_script_exec_t type.

chcon -R --type httpd_sys_rw_content_t /var/www/example.com;

After this command finished, we updated WordPress as normal!

(In case you want to change the security context back to the original just execute chcon with httpd_sys_content_t as parameter on the folders and files you want to operate as read-only).

Ένα προληπτικό μέτρο για την προστασία της μπαταρίας του αυτοκινήτου σας κατά την διάρκεια του κατ’οίκον περιορισμού

Τα περισσότερα αυτοκίνητα (αν όχι όλα) καταναλώνουν ενέργεια ακόμη και όταν είναι σταθμευμένα, με τον κινητήρα σβηστό και χωρίς ορατά συστήματα που λειτουργούν. Τα ηλεκτρικά συστήματα, συμπεριλαμβανομένου του ρολογιού και των συστημάτων υπολογιστών επί του οχήματος, αποστραγγίζουν την μπαταρία σιγά-σιγά μέχρι να την αδειάσουν εντελώς.

Όταν το επίπεδο ενέργειας σε μια μπαταρία είναι χαμηλό, μπορεί να την αποτρέψει από το να είναι σε θέση να ξεκινήσει το αυτοκίνητό σας και θα χρειαστείτε μια ώθηση για να κάνετε το αυτοκίνητό σας να λειτουργήσει ξανά. Σε χειρότερο σενάριο, οι μπαταρίες που είναι εντελώς στραγγισμένες μπορεί να υποστούν ζημιά και πρέπει να αντικατασταθούν.

Επομένως, εάν δεν μετακινήσετε το αυτοκίνητό σας για μεγάλο χρονικό διάστημα (όπως κατά τη διάρκεια της περιόδου κλειδώματος), τότε η εκτεταμένη έλλειψη χρήσης μπορεί να καταστρέψει την μπαταρία και σας αναγκάσει να την αντικαταστήσετε.

Απλή λύση

Ελέγξτε το εγχειρίδιο λειτουργίας του αυτοκινήτου σας ή επικοινωνήστε με τον αντιπρόσωπό σας πριν αποσυνδέσετε την μπαταρία. (Δεν είμαστε σίγουροι αν υπάρχει ένα αυτοκίνητο εκεί έξω που δεν θα ήθελε να αφαιρεθεί η μπαταρία του)

Αποσυνδέστε την μπαταρία από το αυτοκίνητό σας για να σταματήσετε την αποστράγγιση ενέργειας.
Για να το κάνετε, αφαιρέστε το καλώδιο από την αρνητική θύρα (έχει το σύμβολο "-" και είναι συνήθως χρώματος μαύρου).

Μην αφήσετε τα εκτεθημένα μεταλλικά άκρα των αρνητικών και θετικών καλωδίων να αγγίζουν σε καμία περίπτωση.

Microsoft Outlook: Auto Reply

1) Click the File tab at the top-left corner of the Outlook display.

2) Click the box to Automatic Replies box to the immediate left of the Automatic Replies (Out of Office) text.

3) In the Automatic Replies box that appears, click the circle to the left of the Send automatic replies option.

4) Fill the box with the desire information and click ok
You don’t need to add rules, as you want the auto reply to be sent for every incoming email.

Microsoft Outlook: Auto CC in Emails

1) Click File in your Outlook Inbox.

2) Go to the info category.
3) Make sure the account for which you want to set up automatic Cc copies is selected under Account Information.
4) Click Manage Rules & Alerts.

5) Go to the E-mail Rules tab.
6) Click New Rule….

7) For Step 1: Select a template, make sure Apply rule on messages I send is selected (under Start from a blank rule).

8) Click Next >.
9) Click Next > again.
You can pick criteria for the messages you want to copy via Cc; if you select nothing, however, all emails will be added the CC: recipients.

10) If you are prompted:
Under This rule will be applied to every message you send. Is this correct?, click Yes.

11) Under Step 1: Select action(s), make sure CC the message to people or public group is checked.

12) Under Step 2: Edit the rule description, click people or public group.

13) Double-click any recipients (or lists) from your address book, or enter email addresses directly under To ->; these addresses will receive the CC: copies.
Separate email addresses under To -> with semicolons (;).

14) Click OK.
15) Now click Next >.
16) Optionally, under Are there any exceptions?, specify any exceptions to the Cc: sending rule .
17) Click Next >.
18) Typically, precede the email address or addresses entered under Step 1: Specify a name for this rule with something like “Automatically Cc “.

19) Also typically, make sure Run this rule now on messages already in “Inbox” is not checked.
20) Click Finish.

21) Now click OK.