Skip to content

Commit 3890628

Browse files
committed
Refactor documentation, add previous docs back, and remove outdated files; update blog title and navigation paths
1 parent 91e5fce commit 3890628

10 files changed

Lines changed: 247 additions & 40 deletions

File tree

blog/2025-01-01-welcome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Welcome to the Solution Base blog
2+
title: Welcome!
33
tags: [announcement]
44
---
55

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
id: Compression
3+
title: Compression (Tar, Bzip2, Gzip, Zip)
4+
---
5+
6+
# Compression (Tar, Bzip2, Gzip, Zip)
7+
*Varribles in Code are marked as CAPITAL LETTERS.*
8+
## `tar`
9+
:::tip
10+
Command parameter structure:
11+
'**tar** (usually -Action+Format+f)'
12+
:::
13+
14+
### Query
15+
```Bash
16+
# List File(s) in the Archive
17+
tar -tf ARCHIVE
18+
# List File(s) in the Archive & Permissions/Owner/Date
19+
tar -tvf ARCHIVE
20+
```
21+
22+
### tar
23+
```Bash
24+
tar -cf FILE.tar FILE
25+
tar -xf FILE.tar ASSIGNED_FILE (-C OUTPUT_DIRECTORY)
26+
```
27+
28+
### tar.GZ [`-z`]
29+
```Bash
30+
tar -czf FILE.tar.gz FILE
31+
tar -xzf FILE.tar.gz ASSIGNED_FILE (-C OUTPUT_DIRECTORY)
32+
```
33+
34+
### tar.BZ2 [`-j`]
35+
```Bash
36+
tar -cjf FILE.tar.bz2 FILE
37+
tar -xjf FILE.tar.bz2 ASSIGNED_FILE (-C OUTPUT_DIRECTORY)
38+
```
39+
40+
### tar.XZ [`-J`]
41+
```Bash
42+
tar -cJf FILE.tar.xz FILE
43+
tar -xJf FILE.tar.xz ASSIGNED_FILE (-C OUTPUT_DIRECTORY)
44+
```
45+
46+
<details>
47+
<summary><strong>Explanation of Parameters</strong></summary>
48+
49+
- **-c**: Create
50+
- **-x**: Decompress
51+
- **-f**: Followed by the files to be processed
52+
- **-t**: Show contents in the archive
53+
- **-r**: Add file(s) to a tarball
54+
- **-u**: Update files in the archive
55+
- **-v**: Show all progress
56+
- **-f**: Assign an archive
57+
- **-C**: Change to a specific directory
58+
- **-P**: Preserve properties and permissions
59+
- **-N**: Save only files newer than `DATE-OR-FILE`
60+
- **--exclude=FILE**: Exclude FILE
61+
- **--remove-files**: Add then remove source files
62+
63+
</details>
64+
65+
66+
## `Bzip2`
67+
:::warning
68+
If need to RETAIN the original file(s), add parameter "-k" or "--keep"
69+
:::
70+
```Bash
71+
bzip2 -c FILE
72+
bzip2 FILE.bz2
73+
```
74+
75+
## `Gzip`
76+
:::warning
77+
Single file only.
78+
Will NOT retain the original file(s)!
79+
:::
80+
```Bash
81+
gzip FILE.gz
82+
gunzip FILE.gz
83+
```
84+
85+
## `Zip`
86+
87+
```Bash
88+
zip FILE.zip FILE
89+
unzip FILE.zip
90+
```

docs/Linux/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/Linux/SSH-Port.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SSH Port
2+
3+
## RHEL, CentOS 8+, Rocky 8&9
4+
5+
```Bash
6+
sudo vim /etc/ssh/sshd_config
7+
#Port 22 -> Port UR_PORT
8+
9+
systemctl restart sshd
10+
```
11+
12+
## Ubuntu
13+
14+
```Bash
15+
sudo vim /etc/ssh/sshd_config
16+
#Port 22 -> Port UR_PORT
17+
18+
sudo service ssh restart
19+
```

docs/Linux/PHP 8/Compilation-Install-PHP-8.md renamed to docs/Linux/Software-Installation/PHP-8.md

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
id: Compilation-Install-PHP-8
3-
title: Install PHP 8 by Compilation
3+
title: PHP 8
44
sidebar_position: 1
55
---
66

7-
# Install PHP 8 from Source
7+
# Install PHP 8 by Compilation
88

99
<div align="left">
1010

@@ -14,15 +14,15 @@ sidebar_position: 1
1414

1515
</div>
1616

17+
---
18+
1719
:::warning
1820
Compiling requires adequate memory.
1921

20-
If your device has **less than 2GB of RAM**, it is strongly recommended to create a swap partition first.
22+
If your device has **less than 2GB of RAM**, it is strongly recommended to [create a swap](/Linux/Swap-Partition) partition first.
2123
:::
2224

23-
## Prepare
24-
25-
### 1. Install basic build tools
25+
## 1. Install basic build tools
2626

2727
```bash
2828
dnf groupinstall "Development Tools"
@@ -31,7 +31,7 @@ dnf install libxml2-devel libicu-devel sqlite-devel libxslt-devel \
3131
systemd-devel curl-devel
3232
```
3333

34-
### 2. Download & build Oniguruma
34+
## 2. Download & build Oniguruma
3535
```bash
3636
cd oniguruma
3737
./autogen.sh
@@ -51,12 +51,12 @@ make
5151
make install
5252
```
5353

54-
### 3. Add user for PHP-FPM
54+
## 3. Add user for PHP-FPM
5555
```bash
5656
adduser www
5757
```
5858

59-
### 4. Download PHP source code
59+
## 4. Download PHP source code
6060

6161
You can download suitable PHP for your application from the offical website:
6262
https://www.php.net/downloads
@@ -69,8 +69,8 @@ wget https://www.php.net/distributions/php-8.1.2.tar.gz
6969
tar -xzf php-8.1.2.tar.gz
7070
```
7171

72-
### 5. Configure PHP
73-
:::tip
72+
## 5. Configure PHP
73+
:::tip
7474
You can find all available ./configure options in the official docs:
7575
https://www.php.net/manual/en/configure.about.php#configure.options.misc
7676
:::
@@ -79,7 +79,7 @@ Below is a recommended FPM-enabled configuration:
7979
```bash
8080
cd php-8.1.2
8181
```
82-
:::tip
82+
:::tip
8383
Replace YOUR_WEB_USER with the actual PHP-FPM user (for example: www)
8484
:::
8585

@@ -107,10 +107,59 @@ Replace YOUR_WEB_USER with the actual PHP-FPM user (for example: www)
107107
--with-fpm-user=YOUR_WEB_USER \
108108
--with-fpm-group=YOUR_WEB_USER
109109
```
110-
Optional MySQL-related options (adjust paths to your own environment; the example assumes MySQL installed via 'dnf'):
110+
111+
### (Optional) MySQL-related options (adjust paths to your own environment; the example assumes MySQL installed via `dnf`):
111112
```bash
112113
--enable-mysqlnd \
113114
--with-pdo-mysql=mysqlnd \
114115
--with-mysqli \
115116
--with-mysql-sock=/var/lib/mysql/mysql.sock
116-
```
117+
```
118+
119+
## 6. Compile & Install
120+
```bash
121+
make && make install
122+
```
123+
124+
## 7. Final configurations
125+
Rename the default `.conf` files to enable them.
126+
```bash
127+
cp PATH_TO_THE_SRC/php.ini-production /usr/local/php/php.ini
128+
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
129+
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
130+
```
131+
132+
### (Optional) Add PHP-FPM to `system-daemon` (**Recommanded**)
133+
*About the usage of systemd, Check [systemd#BasicUsage](/Linux/Systemd#basic-usage)*
134+
1. Edit PID Location
135+
```bash
136+
# Open the File
137+
vim /usr/local/php/etc/php-fpm.conf
138+
# Find the part and Change into
139+
pid = /var/run/php-fpm.pid
140+
```
141+
2. Write the systemd script
142+
```bash
143+
# Create one and edit
144+
vim /lib/systemd/system/php-fpm.service
145+
```
146+
3. Then, add the content.
147+
```conf
148+
[Unit]
149+
Description=The PHP FastCGI Process Manager
150+
After=syslog.target network.target
151+
[Service]
152+
Type=forking
153+
PIDFile=/var/run/php-fpm.pid
154+
ExecStart=/usr/local/php/sbin/php-fpm
155+
ExecReload=/bin/kill -USR2 $MAINPID
156+
PrivateTmp=true
157+
[Install]
158+
WantedBy=multi-user.target
159+
```
160+
4. Reload systemd
161+
```bash
162+
systemctl daemon-reload
163+
```
164+
165+
## Enjoy it!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
id: Software Installation
3+
---
4+
5+
Here to find verified solutions to install software manually on Linux.
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1+
---
2+
id: Swap-Partition
3+
title: Swap Partition
4+
---
5+
16
# Create/Edit Swap Partition
27

38
![Tested Platform](https://img.shields.io/badge/RockyLinux\_9.1-Tested-green?style=flat\&logo=RockyLinux)
49

5-
### Set-up Steps
10+
---
11+
12+
## Set-up Steps
613

7-
1. Check the free space
14+
### 1. Check the free space
815

916
```bash
1017
free -m
1118
```
12-
2. Create a partition
19+
### 2. Create a partition
1320

1421
```bash
1522
dd if=/dev/zero of=SWAPFILE_DIRECTORY bs=COUNT count=SPACE
@@ -21,22 +28,22 @@
2128
`SPACE` depends on your need, e.g. `1024`
2229
:::
2330

24-
3. Formation
31+
### 3. Formation
2532

2633
```bash
2734
mkswap $SWAPFILE_DIRECTORY
2835
chmod -R 600 $SWAPFILE_DIRECTORY
2936
```
3037

3138

32-
4. Turn it on
39+
### 4. Turn it on
3340

3441
```bash
3542
swapon $SWAPFILE_DIRECTORY
3643
```
3744

3845

39-
5. Enable it permanently
46+
### 5. Enable it permanently
4047
1. Open /etc/fstab in the editor.
4148

4249
```bash

docs/Linux/Systemd.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# systemd
2+
3+
## Basic Usage
4+
5+
```bash
6+
# Start the service
7+
systemctl start SERVICE_NAME
8+
9+
# Stop the service
10+
systemctl stop SERVICE_NAME
11+
12+
# Check the status of service
13+
systemctl status SERVICE_NAME
14+
15+
# Restart(Stop and Start) the Service
16+
systemctl restart SERVICE_NAME
17+
18+
# Reload(The service may not stop) the service
19+
systemctl reload SERVICE_NAME
20+
21+
# Start the service automatically when boot
22+
systemctl enable SERVICE_NAME
23+
24+
# Disable start the service when boot
25+
systemctl disable SERVICE_NAME
26+
```

docs/intro.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
---
22
id: intro
3-
title: Welcome to Solution Base
3+
title: Welcome
44
sidebar_position: 1
55
slug: /
66
---
77

88
# Welcome to Solution Base
99

10-
Solution Base houses the experiences of my CS exploration and study notes, all written in a commonly-understandable style. Use the sidebar to explore topics or jump to specific guides. Hope you'll like it.
11-
12-
---
10+
Solution Base houses the experiences of my CS exploration and study notes, all written in a commonly-understandable style. Most of them are tested on Rocky Linux 9, the platform I am using. Use the sidebar to explore topics or jump to specific guides. Hope you'll like it.
1311

1412
## What’s inside this site?
1513

@@ -25,8 +23,6 @@ Solution Base houses the experiences of my CS exploration and study notes, all w
2523
- **“What’s Up?” updates**
2624
A lightweight space for small announcements, personal notes, reflections, or anything I feel like writing at the moment.
2725

28-
---
29-
3026
## Quick links
3127

3228
- Navigate to **Getting started** to set up your local environment.

0 commit comments

Comments
 (0)