MySQL replication CHANGE MASTER TO master_log_file

master Server

show master status;

+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000177 | 31692464 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.000 sec)

File = mysql-bin.000177, Position = 31692464

slave Server

stop slave;
CHANGE MASTER TO master_log_file = 'mysql-bin.000177', master_log_pos =31692464;
start slave;
show slave status \G;

Vue.js table template v-for Example

<div id="maintable">
    <table>
        <thead>
        <tr>
          <th scope="col">#</th>
          <th scope="col">連結</th>
          <th scope="col">名稱</th>
        </tr>
        </thead>
        <tbody>
        <template v-for="(item, index) in menulist">
          <tr>
            <th>{{ index + 1 }}</th>
            <td><a :href="item.dm_link">{{ item.dm_key }}</a></td>
            <td>{{ item.dm_name }}</td>
          </tr>
        </template>
        </tbody>
    </table>
</div>
let maintable = new Vue({
  el: '#maintable',
  data: {
    menulist: [
      {dm_key: 'TW1', dm_link: 'menu/TW1', dm_name: 'Innonext 1'},
      {dm_key: 'TW2', dm_link: 'menu/TW2', dm_name: 'Innonext 2'},
      {dm_key: 'TP1', dm_link: 'menu/TP1', dm_name: 'Innonext 3'},
      {dm_key: 'TP2', dm_link: 'menu/TP2', dm_name: 'Innonext 4'},
    ]
  },
  methods: { }
});

Salary for new manager

When the new manager wants 400,000/year.

We will give him 500,000/year.

If we give him 500,000/year, that’s 41,600/month.

If we don’t do any test for the new manager, we will definitely lost.

If the new manager is unqualified, we can’t take a pay cut either, or he’ll sue us. Then we will lose a lot.

So, we divide 500,000 into fixed salary of 240,000 and performance salary of 260,000.

Fixed salary of 240,000

Divide 240,000 fixed salary into 4 to 6, Basic salary & Performance salary.

Basic salary 96000, 8000/month linked to attendance.

Performance salary 144000, 12000/month linked to performance.

Performance salary of 260,000

Divided into annual goals, quarterly goals and monthly goals

Complete the Annual Goal to get 80,000

Complete the Quarterly Goal to get 15,000

Complete the Monthly Goal to get 10,000

If you can’t get the job done, you don’t get performance pay

OPNsense BUG

Fix ssh connection at session time broken over the OPNsense to VPN server

That is the Firewall optimization bug. The following setting is fix method:

Firewall > Settings > Advanced > Miscellaneous > Firewall Optimization > Change to "conservative"

擴展 CentOS 7 /root partition 的容量(並且删除預設的 /home partition)

原文:https://gist.github.com/troyfontaine/87091bd6a5c68f45dd62ced3d12bc377

您需要有root的權限,並且可以透過ssh來進行操作。另外,需要注意您的系統中,沒有任何 services 正在 /home 中運行

這個示例,是假設您是使用默認方式安裝CentOS 7,並且您清楚明白知道 volumes/partitions 的情況,避免因不了解而做成嚴重破壞。

在默認情況下,CentOS 7 使用 XFS 作為 file system 和 Logical Volume Manager (LVM) 建立3個分區 / , /home 和 /swap

步驟 1 – 複制 /home 的內容

執行以下的指令為 /home 備份,注意:在備份前,您必須要確認 /temp/ 有足夠的空間存放 /home 的所有內容。若沒有足夠的空間,切勿繼續後面所有的步驟!

mkdir /temp
cp -a /home /temp/

當步驟1完成後,可以繼續步驟2的工作

步驟 2 – Unmount /home 目錄

umount -fl /home

步驟 3 – 查詢 home 在 LVM volume 的容量

用 lvs 指令來查詢 LVM volumes 的屬性

lvs

輸出例子:

  LV   VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home cl -wi-a----- 406.94g
  root cl -wi-ao----  50.00g
  swap cl -wi-ao----   7.81g

步驟 4 – 移除 home 的 LVM volume

指令:lvremove /dev/{VG 名稱 }/{LV名稱}, 本例子 VG 名稱 為 c1, LV 名稱 為 home

lvremove /dev/cl/home

步驟5 – 調整 root的 LVM volume的容量

在步驟3的輸出例子中,原本 home的 LSize 為 406.94g。我們可以安全地把root擴展406GiB。

指令:lvextend -L+{擴展容量} /dev/ {VG名稱} / {LV名稱}

lvextend -L+406G /dev/cl/root

步驟 6 – 調整 root partition 的分區容量

指令: xfs_growfs /dev/mapper/{VG名稱}{LV名稱}

xfs_growfs /dev/mapper/cl-root

步驟 7 – 把原本 /home 的檔案及文件,複制到 /home 的目錄中

cp -a /temp/home /

步驟 8 – 移除 /temp 目錄

rm -rf /temp

步驟 9 – 在 /etc/fstab 中移除項目

使用您習慣的文件編輯器,打開 /etc/fstab。並把 /dev/mapper/c1-home 這一行刪除或在該行最前第一個位加入#號

#/dev/mapper/c1-home /home xfs defaults 0 0

步驟 10 – 再後一個重要的步驟

執行以下指令,讓 systemd 同步,並且更改預設設定。

dracut --regenerate-all --force

ISPConfig 3 API, List all domain_id

Attention: Before using this script, you MUST KNOW how to use ISPConfig API. If you are first time to learning ISPConfig API, Please go to see First time test ISPConfig API learning how to config, how to run it and how to debug with https.

File name: sites_web_domain_id_get_all.php
<?php

require 'soap_config.php';

$context = stream_context_create([
    'ssl' => [
        // set some SSL/TLS specific options
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    ]
]);

$client = new SoapClient(null, array('location' => $soap_location,
                'uri'      => $soap_uri,
                'trace' => 1,
                'exceptions' => 1,
                'stream_context' => $context));

try {
        if($session_id = $client->login($username, $password)) {
                echo 'Logged successfull. Session ID:'.$session_id.'<br />';
        }


        $domain_record = $client->sites_web_domain_get($session_id, []);
        $domain_ids = array_column($domain_record, 'domain_id');


        print_r($domain_ids);

        if($client->logout($session_id)) {
                echo 'Logged out.<br />';
        }


} catch (SoapFault $e) {
        echo $client->__getLastResponse();
        die('SOAP Error: '.$e->getMessage());
}

?>