Archiso With Calamares Pre-installed, How?

This article is for reference ONLY.

This article is UNDER CONSTRUCTION

Bobby Rong

Calamares is a distribution-independent installer framework. As distributions like Arch Linux don’t provide graphical installer, we can try to adapt Calamares to them. To make things easier, we simply start by trying to provide a pacstrap part for Calamares, which allow users to install a minimal Arch Linux system, then we add the Calamares installer to our Archiso.

Get Started

Make sure that you have Git installed, fetch the source code by cloning the Calamares repository, to speed up, add --depth=1 option:

git clone https://github.com/calamares/calamares.git --depth=1

Entering the repository, you will find lots of files and directories, don’t panic! All you have to focus on are three files/directories: settings.conf, src/branding/ and src/modules/. Let’s try to deal with them one by one.

Continue reading “Archiso With Calamares Pre-installed, How?”

Nowcoder Contest 3002 Solution (Chinese)

2020 牛客寒假算法基础集训营 1(字符串、贪心、矩阵快速幂、概率论、计算几何、并查集、数论)

A. Honoka 和格点三角形

大意

给出 \(m \times n\) 格点矩阵,问在矩阵里面能找出多少个面积为 \(1\),且至少有一条边平行于 \(x\) 轴或 \(y\) 轴的三角形。答案对 \(1000000007\) 取模。

思路

若存在平行于 \(x\) 轴或 \(y\) 轴的边且长度为 \(2\),一共有 \(2(n-1)(m-2)m+2(m-1)(n-2)n\) 种情况。

若存在平行于 \(x\) 轴或 \(y\) 轴的边且长度为 \(1\),除去已经计算过的情况(即还存在平行于\(x\) 轴或 \(y\) 轴且长度为 \(2\) 的边),一共有 \(2(m-1)(m-2)(n-2)+2(n-1)(n-2)(m-2)\) 种情况。

相加后化简,得到 \(2(m+n-2)(2mn-3m-3n+4)\),利用 \(ab\ mod\ c = ((a\ mod\ c)(b\ mod\ c))\ mod\ c\) 计算结果。

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n, m, tempa, tempb;
    cin >> n >> m;
    tempa = 2 * (m + n - 2);
    tempb = (2 * m * n - 3 * m - 3 * n + 4);
    cout << (tempa % 1000000007) * (tempb % 1000000007) % 1000000007 << endl;
    return 0;
}
Continue reading “Nowcoder Contest 3002 Solution (Chinese)”

Install and Configure WordPress on Fedora Server Edition

Hi everyone! I am trying to i18n my website, so this post will be the first one which is written in English. Hope you will like it! 🙂

First things first

You should get a IP address after buying VPS, such as 123.123.123.123. Open your favourite terminal and enter:

Replace 123.123.123.123 with your actual IP address.

ssh [email protected]

Enter your password to login. Perform a full upgrade on your system:

dnf upgrade
Continue reading “Install and Configure WordPress on Fedora Server Edition”