Find the files older than 30 days

Find the files that is older than 30 days:
find . -atime +30 -exec stat -c “%n %y” {} \;

Delete the files that is older than 30 days:
find . -atime +30 -print0 | xargs -0 -r rm

Reference: https://stackoverflow.com/a/21451441/126639

Example of addslashes Multibyte SQL injection

CREATE TABLE users (
    username VARCHAR(32) CHARACTER SET GBK,
    password VARCHAR(32) CHARACTER SET GBK,
    PRIMARY KEY (username)
);
$db = mysqli_init();
$db->real_connect('localhost', 'username', 'password', 'database');
$db->query('SET NAMES gbk');

$_POST['username'] = chr(0x87)."' OR username = username -- ";
$username = addslashes($_POST['username']);
$sql = "SELECT *
        FROM users
        WHERE username = '{$username}'";
$res = $db->query($sql);

if ($res->num_rows) {
    echo 'success';
} else {
    echo 'fail';
}

The certificate for this server is invalid

If you try to access a https website in iOS simulator, you will see the error below.

Error loading page
Domain: NSURLErrorDomain
Error Code: -1202
Description: The certificate for this server is invalid. You might be connecting to a server that is pretending to be "your-domain.com" which could put your confidential information at risk.

Follow the steps below to bypass the ssl cert validation:
1. Drag and drop the .crt file to the iOS simulator.
2. Go to Settings > General > Profile, Select the cert and click “Install”.
3. Go to Settings > General > About > Certificate Trust Settings, Turn on the “Enable Full Trust for Root Certificates” option.

STRAIGHT_JOIN

When using JOIN query, sometimes MySQL’s JOIN optimizer would process the tables in a suboptimal order. STRAIGHT_JOIN can be used to resolve this problem. When using STRAIGHT_JOIN, the left table is always read before the right table.