Home Network Architecture with RouterOS, OpenWrt, SmartDNS, and FRP
This article records a practical home network architecture built around MikroTik RouterOS, an OpenWrt bypass router, SmartDNS, Tailscale, and FRP. It is not a copy-and-paste configuration guide. It is more about ownership: which device should own routing, DNS, proxy, IPv6, public services, and recovery.
Goals- Run Gogs on Raspberry Pi and deploy using Docker- Since the Raspberry Pi is on the internal network, Frp needs to be used for internal network penetration.- Use Caddy+CDN proxy to speed up access to Gogs
## 2. Install Gogs with Docker#### (1). Download the image file`docker pull gogs/gogs-rpi`#### (2). Run the image```
docker run \
--name=gogs-rpi -d \
--restart=always \
-p 10022:22 -p 13000:3000 \
-v /data/gogs:/data gogs/gogs-rpi
10022:22->Map the local port 10022 to 22 in docker- 13000:3000->Map the local port 13000 to 3000 in docker- /data/gogs is the location where data is stored on this machine
3. Install Gogs with docker-compose Orchestration using MySQL (optional)
It should be noted here that the13000port is the port mapped by the gogs container on the Raspberry Pi, which should correspond to the port running on docker before.
proxy / 127.0.0.1:8888 means forwarding traffic accessing gogs.yourdomain:443 to port 8888 of this machine- address@mail.com represents the user’s email address
limitation- Gogs installed in this way can only perform git operations through https or http protocol.- SSH operations can be achieved by performing FRP penetration on the SSH port, but PrivateDNS cannot support SSH, so PrivateDNS needs to be turned off.
1. IntroductionWith the popularity of IPv6 and the unavailability of IPv4 on the public network, the demand for using IPv6 to access external networks has gradually increased. This article uses Cloudflare DNS API to implement IPv6 DDNS.
(1) Obtain theZone IDandAPI Keyof the domain nameThe Zone ID can be obtained directly from the API column at the bottom right of the domain name control panel.
To obtain the API Key, you need to click “Get your API key” below the column, then enter the password and verification code to confirm.
In fact, you can also create a new API Key yourself instead of using the global API Key.
(2) Add the AAAA record of the subdomain nameIn the “DNS” tab of the domain name panel, add an AAAA record in DNS Records, takingddns.example.comas an example:- Name: “ddns”- IPv6 address: “::1”- TTL: NULL- CDN: None
ZONE_ID isZone IDobtained in the first step- DDNS_HOSTNAME is the domain name for setting the AAAA record in the second step- CF_EMAIL is the registered email address of the Cloudflare account- CF_API_KEY isAPI KEYobtained in the first step
After successful execution, a piece of output in JSON format will be returned. Find the"id"corresponding to the domain nameddns.example.cominresult
This article takesgit pullthat implements timing as an example to explain the timer ofSystemd
1. Create agit pullScriptThe main purpose of this script is to enter the specified git path and execute thegit pullinstruction> You need to make sure that there is a git repository that has been cloned locally in this path.
Run./gitpull.shon the command line. When the command line displays the same output as the commandgit pullwhen running normally, it means that the script is normal.
${pwd_of_scripts} represents the folder where the script created in the previous step is located> ${USER} represents the user who executes the script, ${GROUP} represents the group to which the user belongs
The name ofTimerneeds to be consistent with the name ofService>
OnUnitActiveSecrepresents the interval at which the run timer runs>
Oncalnedarmeans running at a specific time>
Unitrepresents the service that needs to be run
Oncalnedar* *-*-* *:*:* - *- To signify the day of the week eg:- Sat,Thu,Mon - *-*-* - To signify the calendar date. Which means it breaks down to - year-month-date. - 2021-10-15 is the 15th of October - *-10-15 means every year at 15th October - *-01-01 means every new year. - *:*:*is to signify the time component of the calnedar event. So it is - hour:minute:second
socks5indicates the proxy protocol used, which can be replaced by other protocols such ashttp- 10080is the port number of the proxy, corresponding to the Input port of the proxy service
4. Configure system network Proxy### GUI interfaceOpen the following path[system] settings -> network -> network proxySelect the proxy mode as automatic, and fill in the configuration url as
1. Problem IntroductionPodman is different from Docker in that it does not require the docker daemon to control the running of the container in terms of architecture, so the restart of the container needs to be taken over by systemd.
-t: timeout period- -n: indicates using the container name instead of the container id- -f: indicates generating service files- –new: Delete the old container and start a new container every time it is started
3. Manage Pod with Systemd### (1). Create a Pod```
tags: - SELinuxcategories: - Linux - Containerdate:created: 2022-06-02# updated: 2024-01-19—
Podman Volumes and SELinux## SELinuxSecurity-Enhanced Linux (SELinux) is a security architecture for Linux systems that allows administrators to have greater control over who can access the system [What is SELinux?]. For a detailed description of SELinux, refer to SELinux Policies and Rules.
When running a podman container as a non-root account, files in the/home/user/directory may have the following context permissions:unconfined_u:object_r:data_home_t:s0, but podman volumes require such permissionssystem_u:object_r:container_file_t:s0to function properly.
Container volumes created by podman at runtime will automatically have the appropriate context set. However, for the/home/user/directory volume, podman does not change the context by default.
2. Auto Labelspodman provides two labels for modifying the security context at runtime::zand:Z
Shared Labels- Private Labels
Shared Labels allow multiple containers to access a volume at the same time;
Private labels only allow specific containers to access the volume.
| —–– | ––––––––––––––––––– |
|app|Create a Makefile for building the application (default)|
|lib|Create a Makefile for building the library|
|subdirs|Create a Makefile for building the target subdirectory specified by the SUBDIRS variable|
|aux|Create a Makefile that doesn’t create anything|
2. TARGETSpecify the name of the target file## 3. CONFIG
Program compilation is a dependent path## 6. INCLUDEPATH
The include path of the header file specifies the #include directory that should be searched when compiling the project. If it contains spaces, “” should be used## 7. QMAKE_LFLAGS
Specifies a common set of identifiers passed to the linker## 8. LIBSSpecify a list of libraries to link to in the project
Convert Raspberry Pi 3B+ into a wifi wireless router
Implement the following functions:
1. WiFi works in 802.11ac mode, 433Mbps Link Speed 2. WiFi network sharing Ethernet port, IPv4 uses NAT 3. External USB driver-free network card as LAN port
In layman’s terms, ssid is the network name of Wi-Fi.
wpa_passphrase is the Wi-Fi password
ssid and wpa_passphrase can be changed at will, but be careful that wpa_passphrase is more than 8 bytes
Generally speaking, there is no need to change the channel, because the frequency band available in China requires a continuous 80MHz bandwidth, and no matter how you adjust it, there is no way for two APs to have no overlapping frequency bands.
The country_code must be present and must be US. I have tried changing it to CN but it cannot be started.
(3) Write the configuration file path into the service configuration file
There is a compatibility issue here [ebtables], ebtables needs to be set
Enterupdate-alternatives --set ebtables /usr/sbin/ebtables-legacyin the command line. The main problem is that the new version of ebtalbes is incompatible with the command and you need to switch to the old version of the program.
After turning on IPv6 transparent transmission, there are network problems, and the cause of the problem is unknown.
The main phenomenon is that the docker network is completely down (maybe because of the host’s network settings, maybe using Bridge)
Int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
- Sockfd: socket descriptor, uniquely identifies a socket- addrlen: address length- addr: an address pointer pointing to the protocol address to be bound to sockfd
Int setsockopt(SOCKET s, int level, int optname, const char FAR *optval, int optlen)
s:socket descriptor- Level: option level, SOL_SOCKET/IPPROTO_TCP- Optname: Options that need to be set- optval: just want to store the pointer of the option- Optlen: buffer length
GPG (GNU Privacy Guard): A cryptographic tool commonly used for signing and encrypting data. We can leverage GPG key pairs for authentication.* SSH (Secure Shell): An encrypted network protocol used to securely execute commands and transfer files over unsecured networks.* gpg-agent: A daemon that manages your GPG private keys to avoid having to enter a password every time you use them.* ssh-agent: A daemon that manages your SSH private keys and also avoids password re-entering.* libpam-gnome-keyring(optional but recommended): A PAM module that automatically startsgpg-agentandssh-agentwhen you log in.* gnupg-agent: Provides the functionality required for SSH authentication using GPG keys.
1. Install the necessary packages:Depending on your Linux distribution, install the following packages: * Debian/Ubuntu: ```bash
Follow the prompts to select the key type, key length, expiration date, and set your real name, email address, and comment. Please remember your password.If you already have a GPG key pair, you can skip this step.
3. Confirm GPG key usage and obtain fingerprint:Make sure you have a GPG key or subkey with purpose set toAuthenticate. Confirm and obtain the fingerprint (40-digit HEX) of the key or subkey with the following command: ```bash
4. Add the GPG key fingerprint to thesshcontrolfile:Put the fingerprint obtained in the previous step into the~/.gnupg/sshcontrolfile. Place one fingerprint per line. ```
* `enable-ssh-support`: Enable SSH support. * `default-cache-ttl`: Set the default password cache time in seconds. * `max-cache-ttl`: Set the maximum password cache time.
6. Configure PAM (optional but recommended):If you havelibpam-gnome-keyring(or a similar package) installed, you can configure PAM to automatically startgpg-agentandssh-agentat login.Edit the/etc/pam.d/loginand/etc/pam.d/sshdfiles and add the following lines if they do not exist:In theauthsection add: ```
In thesessionsection add: session optional pam_gnome_keyring.so auto_start Note: The exact files and lines may vary depending on your Linux distribution and PAM configuration. You may need to make similar changes in other PAM configuration files such assudoor the graphical login manager.
7. Export the SSH public key:Use the following command to export the SSH public key from your GPG private key. ReplaceYOUR_GPG_KEY_IDwith your GPG key ID. You can find your key ID using thegpg --list-secret-keys --keyid-format longcommand. ```bash
Notice: * The exported public key is saved as~/.ssh/id_ed25519.pubby default. You can change the file name as needed. * Make sure your GPG private key is password protected.
8. Copy the SSH public key to the remote server:Copy the contents of your exported SSH public key (~/.ssh/id_ed25519.pub) into the~/.ssh/authorized_keysfile on the remote server you want to SSH authenticate.You can use thessh-copy-idcommand to simplify this process (if your local machine is already configured for password- or key-based SSH access): ```bash
* `Host`: The alias you set for the remote server. * `Hostname`: The IP address or hostname of the remote server. * `User`: Your username on the remote server. * `IdentityFile`: The path to the SSH public key file you exported (without the`.pub`extension). * `PubkeyAcceptedKeyTypes`: Specifies the accepted public key types. Add`+ssh-ed25519-cert-v01@openssh.com`to enable certificate-based authentication.
10. Startgpg-agentandssh-agent:If you do not configure PAM, you need to startgpg-agentandssh-agentmanually after logging in. Add the following to your shell configuration file (e.g.~/.bashrc,~/.zshrc): ```bash
Alternatively, you can enter your password the first time you attempt an SSH connection.
12. Test the SSH connection:You should now be able to SSH to the remote server using the configured alias without entering a password (unless your GPG private key is not already unlocked): ```bash
If this is your first time using this GPG key for an SSH connection, you may be asked to enter the password for the GPG key. Afterwards, the password will be cached ingpg-agentuntil the cache expires.
Security: Make sure your GPG private key is protected by a strong password.* Backup: Be sure to back up your GPG private key.* gpg-agentandssh-agent: Make sure these two agents are running. You can check this using theps aux | grep gpg-agentandps aux | grep ssh-agentcommands.* Permissions: Make sure the permissions for the~/.sshdirectory and~/.ssh/authorized_keysfiles are set correctly (usually700for~/.sshand600for~/.ssh/authorized_keys).* Server Configuration: Ensure that public key authentication (PubkeyAuthentication yes) is enabled in thesshd_configfile on the remote server.
With the above steps, you should be able to successfully configure your Linux system to use GPG keys for SSH authentication, improving security and streamlining your workflow.
1. Requirements- VPS -> Take CentOS as an example-> IP is represented by 123.123.123.123- Domain name -> represented by domain.com-> Subdomain names are represented by tunnels
Note:> -f runs in the foreground> -c disables checking the client IP address of all incoming requests; by default, requests from non-matching IPs will be rejected.> -P sets authentication password> 10.0.0.1 is a reserved address
ConfigTools is a high-performance industrial graphical configuration application written in Qt/C++ (C++17). It is designed for the physical and logical deployment of modular automation systems, such as Siemens TIA Portal scenarios. The project includes a high-fidelity 42U cabinet simulation, intelligent hardware assembly collision detection, an undo/redo command stack, and a one-click engineering report generation engine.
Built on a precise 1U = 50px grid coordinate system, rendering a virtual cabinet with rulers and physical rails.
Supports drag interaction and Magnetic Snapping, with built-in real-time collision detection and physical rebound animation when a placement is invalid.
Strict MVC data and graphics architecture
Uses a highly decoupled hierarchical tree structure: “cabinet -> device -> slot -> module”.
Supports runtime slot count changes and adaptive layout recalculation.
Undo/redo command system based on QUndoStack
Implements the Command Pattern. Add, delete, drag-move, property changes, and slot adjustment actions are all captured by command objects, enabling seamless Undo / Redo.
One-click “four-in-one” automated Excel report
Deeply integrates the open source QXlsx library and converts configuration results into expressive professional Excel reports with four worksheets:
Topology: intuitive graphical cabinet topology with intelligent cell merging.
BOM: lists each device type, physical slot position, quantity, and calculated unit price.
I/O Mapping: automatically derives and assigns logical I/O addresses for each signal channel.
Cost Analysis: calculates purchase costs for a single cabinet and the overall system, with support for multiple tax rates.
Project lifecycle and packaging protection
Supports save validation, unsaved-exit prompts, and shortcut keys such as Ctrl+S / Ctrl+Shift+S.
Exports .ctproj compressed project packages with built-in ZIP serialization for collaboration and project archiving.
Polished industrial theme and multilingual support
Uses a custom Catppuccin Mocha modern dark industrial QSS stylesheet to reduce eye strain during long configuration sessions.
Natively supports seamless runtime switching between Chinese and English.
QML-FFmpeg is a high-performance, multi-threaded video player solution built with Qt Quick/QML, FFmpeg, and SDL2. The project focuses on a smooth migration from the traditional OpenGL/FBO offscreen rendering path to a modern Qt Quick Scene Graph / RHI (Rendering Hardware Interface) compatible rendering pipeline. This reduces the dependency on a specific graphics backend and provides cross-platform hardware-accelerated playback capabilities.
Replaces the outdated QQuickFramebufferObject path with Qt Quick Scene Graph nodes for video frame rendering, making the player compatible with the Qt 6 RHI rendering architecture.
Decoupled multi-threaded pipeline
Separates demuxing, video decoding, and audio playback into independent threads, keeping the UI responsive while preserving smooth playback.
Uses SDL2 audio playback as the master clock for AV sync, providing stable audio-video synchronization.
Three-stage smooth hardware acceleration fallback
Stage 1 (zero-copy GPU rendering): zero-copy rendering based on Direct3D11 / VA-API, mapping GPU textures directly.
Stage 2 (GPU-to-CPU copy rendering): uses av_hwframe_transfer_data() to copy NV12 and other hardware-decoded frames back to system memory, then submits them to the Scene Graph after high-performance color-space conversion. This path has resolved hardware frame pool deadlocks and avfilter filtering issues.
Stage 3 (pure CPU software decoding): when hardware acceleration initialization or transfer fails repeatedly, the player reloads within 5 frames and smoothly falls back to CPU decoding, such as YUV420P, without interrupting playback.
Dual integration architecture
Supports both direct static integration of the player core in a standalone application and dynamic injection as an independent QML extension plugin.
Ready-to-use deployment and validation
Provides CMake presets and automation scripts. On Windows, required FFmpeg/SDL2 DLLs and test videos are copied after build; Linux (Ubuntu) deployment is also designed to remain portable.
Windows (NVIDIA physical machine): Stage 2 (GPU-to-CPU NV12 copy rendering) and Stage 3 software decoding have been fully validated, providing strong stability and fault tolerance. D3D11 zero-copy rendering is still pending final closure.
Linux (Ubuntu virtual machine): because there is no GPU passthrough, VA-API hardware decoding is unavailable. The application successfully falls back to Stage 3 pure software decoding, and playback plus the control UI work normally.
ARM / embedded platforms: planned work includes Rockchip MPP and Raspberry Pi V4L2 M2M hardware decoding, plus DRM / GLES zero-copy rendering.
Preprocess and generate .i file 2. Convert the preprocessed files into assembly language and generate .s files 3. From assembly to object code, generate .o file 4. Connect the target code and generate an executable program2. Common parameters
-c
Only activate preprocessing, compilation, and assembly, do not connect, and generate obj (*.o) files
-o
Specify target file name
-S
Preprocessing + compilation, no assembly connection
-E
Only preprocessing
-O0/-O1/-O2/-O3
There are 4 levels of compiler optimization, -O0 has no optimization, -O1 is the default value, and -O3 has the highest optimization level.
-g
Generate debugging information at compile time
-ggdb
Generate debugging information that gdb can use when possible
-w
Does not generate any warning message
-Wall
Generate all warning messages
-Wl,-options1,-options2
Connection options
-LLIBRARY
Search the specified function library when connecting
-IDIRECTORY (this is a capital i)
Specify additional header file search paths
-nostartfiles -nostdlib
It is necessary to run bare metal without Linux. -nostartfiles does not connect to the system standard startup files. -nostdlib includes -nostartfiles and standard libraries.
-static
Static linking shared library files
-shared
Connect multiple target files to generate a shared library file ending in .a
Link: Link multiple .o files, or .o files and library files into an executable program that can be executed by the operating system- Static library: document file, a collection of multiple .o files; the suffix in Linux is .a; maintained and managed using the ar tool- Shared library: a collection of multiple .o files, generated by the compiler in a special way, usually executable in Linux; dynamically loaded into memory; multiple executable programs can share the code segment of the library file
TARGET: The target of the rule, the final file name & the intermediate process file name; it can be the name of the action executed by make- PREREQUISTIES: rule dependencies, generating a list of file names required by the rule target- COMMAND: The command line of the rule; each command must start with [Tab], but not everything starting with [Tab] is a command; make will process all lines starting with [Tab] after the first rule as a command line
4. make execution- The first rule of the Make file is executed by default, and the first target of this rule becomes the “final destination”- Makefile will only perform compilation of dependencies required for the final goal
How to update one or more target files under what circumstances#### b. Implicit rules
According to the rules automatically derived from a type of target file, dependent files are automatically generated according to the file suffix name and the target is updated using default commands.#### c. Variable definition#### d. indicator
Specify the actions that need to be performed when the make program reads the makefile, including:
Read the specified file as part of the makefile- > Decide to process or ignore a specific part of the Makefile- > Define a multi-line variable#### e. Comments
The content after the # character is used as a comment### (3). Naming of makefile files
make will search in the following order- GNUmakfile->makefile->Makefile- When it is not the above file name, you can specify the makefile read by make through “-f” or “–file”; multiple makefile files will be in the specified order.### (4). Include other makefile files
Use include:
Include FILENAMES
FILENAMES is the file name supported by the shell, and wildcards can be used;- Must not start with [Tab]- The default search path for files not found is: “./usr/gnu/include /usr/local/include /usr/include”; make will use rules to create files specified by the inlcude directive but not found
The first stage: read all makefile files and resume the dependency structure linked list between all targets and dependencies- Phase 2: Based on the relationship structure linked list in the first phase, determine which targets need to be updated and reconstructed
Conditional statement: make expands the branch with correct preset conditions- Definition of rules: When make is executed, all rules are expanded according to the following pattern:
If the target and dependency in the rule refer to other variables, they will be expanded immediately; while the variables in the rule command line will be expanded later.
The command can be on the same line as the command, separated by “;”- The command is on the next line of the dependency description. As an independent command line, it must start with [Tab].- $ in Makefile has a special meaning (indicating a reference to a variable or function). You need to use the symbol $ in the rules and write consecutive $$- For longer lines, you can use \ to branch### (6). Dependency type#### a. Regular dependencies
The order in which the rules need to be executed to rebuild the target- In what order and commands should you follow to rebuild dependency files?#### b. order-only dependency
Dependencies for updating dependencies- Start with the pipe symbol “|” as a dependency file of the target:
Regular dependency files can be empty; the same dependency appearing in both regular and order-only will be treated as regular### (7). Use wildcard characters in file names
a. The wildcard characters are exactly the same as those of the linux shell.
The target and dependency of the rule- Appears in the command of the rule and is executed in the shell#### c. wildcard function
$(wildcard *.c) gets the .c file list- $(patsubst %.c,%.o,$(wildcard *.c))–Replace the .c file list with .o### (8). Command line and search directory
Use automation variables- > $^ represents the full pathname of all dependent files obtained through directory search- > $@ represents the target of the rule- > $< The first dependent file in the dependent file list obtained through directory search### (9). Library files and search directories
Specify the dependency file name “-lNAME”## 8. Variables
(1). Variable rules#### a. Use “=” or “define” to define#### b. Can be used to represent:- file name- compile options- Program running options parameters- Search directory listing for source files- Compile output directory#### c. Variable names do not include: “:”, “#”, “=”#### d. Variable names are case sensitive#### e. Automation variables### (2). Variable reference
1. $(subst FROM,TO,TEXT) replaces FROM in TEXT with TO 2. $(patsubst PATTERN,REPLACEMENT,TEXT) searches for words separated by spaces in TEXT and replaces those matching PATTERN with REPLACEMENT 3. $(strip STRINT) removes leading and trailing spaces 4. $(findstring FIND,IN) finds the FIND string in IN 5. $(sort LIST) sorts the words in LIST in alphabetical order 6. $(word N,TEXT) to get the Nth word in TEXT 7. $(wordlist S,E,TEXT) takes the word string from S to E from TEXT 8. $(words TEXT) counts the number of words in TEXT 9. $(firstword NAMES) takes the first word in NAMES### (2). File name processing function
1. $(dir NAMES) takes the directory part of the file name 2. $(notdir NAMES) takes the non-directory part of the file name 3. $(suffix NAMES) takes the file name suffix 4. $(addsuffix SUFFIX,NAMES) adds the suffix SUFFIX to each item of NAMES 5. $(addprefix PREFIX,NAMES) Add prefix PREFIX to NAMES 6. $(join LIST1,LIST2) connects two strings (corresponding index connection between lists) 7. $(wildcard PATTERN) lists the file names in the current directory that match the PATTERN format### (3). foreach function 1. $(foreach VAR,LIST,TEXT) assigns the words in LIST to VAR in sequence, and then executes the TEXT expression### (4). if function 1. $(if CONDITION,THEN-PART [,ELSE-PART])### (5). call function### (6). value function### (7). eval function### (8). origin function### (9). shell function### (10). Make control function 1. $(error TEXT) 2. $(warning TEXT)## 11. Execute make
(3). Specify the ultimate goal 1. first goal of first rule 2. The command line specifies the target name in the makefile as the target “make TARGET_NAME” 3. Execution of alternative commands 4. Prevent specific files from being rebuilt 5. Replace variable definition 6. Use make to compile and test: “make -k”
12. Implicit rules of make 1. Use of implicit rules 1. make will start the corresponding implicit rules based on the source file type 2. There is always a target pattern and dependency pattern for implicit rules; 3. The same target mode can correspond to multiple dependency modes 2. pattern matching 3. universal rules 4. Rebuild embedded implicit rules 5. Default rules 6. Suffix rules 7. Implicit rule search algorithm 8. make automation variables| | |
|—|—|
|$@|The target file name of the rule|
|$%|a member of a static library|
|$<|The first dependent file name of the rule|
|$?|List of all dependent files that are newer than the target file|
|$^|List of all dependent files of the rule|
|$+|Similar to $^, keep duplicate files|
|$(@D)|directory part of target file|
|$(@F)|Target file except directory part|
1. Virtual address- kernel space- user space## 2. Physical address- ZONE_DMA- ZONE_NORMAL- ZONE_HIGHMEN## 3. Process and memory### (1). Code segment- Executable file operation instructions- Prevent illegal modification during runtime- read only### (2). Data segment- Store initialized global variables (statically allocated variables and global variables) in the executable file### (3). BSS section- Uninitialized global variables in the program### (4). Heap
Dynamically allocated memory segment in the program- Can be expanded or reduced- Malloc/free### (5). StackStack
Local variables temporarily created by the program- variables defined in the function- Parameters when calling the function## 4. Kernel space
direct mapping area- High-end memory linear address space- Dynamic memory mapping area- Permanent memory mapping area- Fixed mapping area
The user space occupied by the process is divided into 5 different memory areas according to the principle of “address spaces with consistent access attributes are stored together” (access attribute: rwx)Including kernel image, physical page table, driver
dpkg is used to install .deb files, but it does not resolve module dependencies and does not care about the software in Ubuntu’s software warehouse.
apt will resolve and install module dependencies and consult the software repository.
2. Check package dependencies in Ubuntuapt-cache depends XXX --recurse
The dns_cloudflare plugin automates the process of completing a dns-01 challenge (DNS01) by creating, and subsequently removing, TXT records using the Cloudflare API.
The default config file located/etc/logrotate.conf
In default config file, the config folder/etc/logrotate.dis included by default. Which means, config files added in this folder will be executed by logrotate process.
Due to the configuration in default systemd file, the parameter ProtectSystem=full, caddy lose the permission on writing /usr, /boot and /etc.(Reference-2 for details).
Add ReadWrite permission to caddy web folder /usr/share/caddy
Adding paramter to service file /usr/lib/systemd/system/caddy.service under [service] lable:
Due to the configuration in default systemd file, the parameter ProtectSystem=full, caddy lose the permission on writing /usr, /boot and /etc.(Reference-2 for details).
Add ReadWrite permission to caddy web folder /usr/share/caddy
Adding paramter to service file /usr/lib/systemd/system/caddy.service under [service] lable:
Make sure you save the generated password somewhere secure such as a password manager. The management key is needed any time you generate a keypair, import a certificate or change the number of PIN or PUK retries
The PUK should also be kept somewhere safe. This is used if the PIN is entered incorrectly too many times.
When SSHing, you may get prompted with the key’s subject name, like Enter PIN for 'SSH key':. But if you add the key to the agent, you’ll get a prompt like Enter passphrase for PKCS#11:. These are the same PIN (your PIV PIN).
If you remove the key from ssh-agent using ssh-add -d or ssh-add -D, you’ll have to either remove and re-add the PKCS library to the agent or restart the agent.
Install with commands: .\qt-unified-windows-x86-online.exe --mirror https://mirrors.ustc.edu.cn/qtproject
DO NOT install Qt with sudo command nor with user ROOT.
If you prefer Qt Online Installer, libxcb-xinerama.so.0 is needed. To install this dependency, run following command sudo apt install libxcb-xinerama0.
It’s possible to install Qt from source. Follow the instruction, and the script is available here.
1. Submit the current code to another remote git repositoryIf warehouse repo_a is currently located in branch_a, it is required to extract all the data of branch_a (including submission history) and create a new warehouse repo_b. It is assumed here that the warehouse repo_b has been created.The basic syntax ofgit remote addis as follows. name and url are required.
2. Submit the same code to multiple different git hosting servers (multiple git repositories)The method is very similar, mostly using the commandgit remote set-url --add [--push] <name> <newurl>Assume that a new warehouse repo_c is added to the remote git server, and the codes submitted by repo_b and repo_c must be consistent.
Before mounting the disk, you need to know the path orUUIDof each disk. At this time, you mainly rely on the two instructionsfdiskandblkid. The former instruction obtains the partition information, and the latter instruction obtains the attributes of theBlock deviceblock device.```
$ sudo blkid
/dev/sda1: LABEL=“Win10” UUID=“C4A0E65EA0E65708” TYPE=“ntfs” PARTUUID=“6190c592-01”
/dev/sda2: UUID=“AE3C137D3C133FAF” TYPE=“ntfs” PARTUUID=“6190c592-02”
/dev/sdb1: LABEL=“Apps” UUID=“0000678400004823” TYPE=“ntfs” PARTLABEL=“Basic data partition” PARTUUID=“45ed07d2-c9e3-4167-8868-3e33f62784e1”
/dev/sdb2: LABEL=“Data” UUID=“0000678400004823” TYPE=“ntfs” PARTLABEL=“Basic data partition” PARTUUID=“2a8b4bf1-8357-4d65-bed4-f73f01b96431”
/dev/sdb3: LABEL=“Backup” UUID=“0000678400004823” TYPE=“ntfs” PARTLABEL=“Basic data partition” PARTUUID=“a7187083-2820-4eef-83ff-05d8899879a2”
From the above output results, the disk can be mapped to the specific block device path`/dev/sdax`. Because the computer contains two disks, it contains`sda`and`sdb`. The block device path and`UUID`here will be used in the following configuration parameters.
## 2. Temporary MountFor a temporary solution, you can use the following command to mount`/dev/sda1`to the`/mnt/c`directory```
(1). Modify configuration fileThe solution to automatically mount after booting requires modifying the configuration file/etc/fstab. After opening it with an editor, add a new mount item in the following format
# /mnt/Backup was on /dev/sdb3 during installation
/dev/sdb3 /mnt/Backup ntfs defaults 0 2
The last two items are used to mount the disk. Of course, the/dev/sdbxin front of each line can also be replaced byUUID=xxxxx. However, since theUUIDof the two disks are consistent, there may be problems. Maybe you can use thePARTUUIDoutput byblkid.
2. Configure VSCodeCreate a.vscodefolder under the source code folder, which containsc_cpp_properties.json,launch.json,tasks.json. For the specific meaning of each file, please refer to [VScode tasks.json and launch.json settings], [VSCode predefined variables]
1. Set hop count- What are hops> - Metrics is a value assigned to an IP route for a particular network interface that identifies the cost associated with using that route. For example, hop count can be calculated based on link speed, hop count, or time delay. Automatic metric counting is a new feature in Windows that automatically configures the metric count for local routing based on link speed. Automatic metric counting is enabled by default, but can be manually configured to give it a specific metric number.> - The Automatic Hop Counting feature is useful when the routing table contains multiple routes for the same destination. For example, if your computer has a 10 megabit (Mb) network interface and a 100 Mb network interface, and the computer has a default gateway configured on both network interfaces, the Automatic Hop Counting feature assigns a higher hop count to the slower network interface. This feature forces all traffic to the Internet, for example, to use the fastest network interface available.
If certain GPU functions, such as audio, cannot be passed through to the VM due to support limitations, you can modify the driver bindings of the endpoints within an IOMMU group to pass through only the necessary GPU functions.
Convert the GPU settings to XML and note the PCI address of the endpoints that you want to prevent from attaching to the host drivers.
Prevent the endpoints from attaching to the host driver.
To install Vlmcsd Manually, refer to [Vlmcsd-on-Ubuntu-18.04] or [Centos7-Build KMS server and windows product key]## 1. Deploy Vlmcsd on Docker### (1). Compiledocker-compose.yaml, as below```
version: “3”
services:
kms-docker:
image: teddysun/kms
container_name: kms
restart: always
network_mode: “host”
ports:
- 1688:1688
### (2). Run docker container with docker-compose```
sudo semanage fcontext -a -t samba_share_t "/mnt/shared(/.*)?"
```
Delete the rule that automatically marks the security context of subsequent files under a certain path ```
sudo semanage fcontext - “/mnt/shared(/.*)?”
6. Attention- It should be noted that any program running under SElinux needs to be supported by the corresponding SElinux security context, otherwise the operation will inevitably cause insufficient permissions.
During use, you often encounter the following situations:
It is necessary to modify the folder permissions in a certain directory to: 0755, the owner is root, the file permissions are: 0644, the owner is root
1. Set the permissions of all folders in a directory individually```
The latest frp version at the time of publication of this article isv0.36.2. The server uses thex64architecture as an example, and the client uses thearmarchitecture as an example.## Config on Server### 1. Download FRPDownload the latest precompiled package for the corresponding platform from the [release] page of fatedier/frp.
Download and unzip anywhere on the server```
wget https://github.com/fatedier/frp/releases/download/v0.36.2/frp_0.36.2_linux_amd64.tar.gz
tar -zxvf frp*.tar.gz
### 2. Install FRPS```
cd frp*
mv frps /usr/bin/frps
mkdir /etc/frp
mv frps.ini /etc/frp/frps.ini
From Step2 to Step4 need ROOT authority, you need addsudobefore each command if NOT a ROOT user.
~~3a. Configuration of FRPS(before version 0.52.0)~~Edit the frp config filevim /etc/frps.iniand fill in the following format```
## Config on Client> The client installation method is exactly the same as the server installation method. The only difference is in the configuration file. Therefore, only the differences from the server installation are explained.### 1. Download FRP for Client```
- `server_addr`Fill in the ipv4 address of FRPS- `server_port`is the port corresponding to`bind_port`of the server- `token`is the`token`corresponding to the server
### 3b. Configuration of FRPC(newer then 0.52.0)Edit the frp config file`vim /etc/frpc.toml`and fill in the following format```
1. Set up domain name resolution on the domain name website- Resolve the A/AAAA record of a custom domain name to the public IP address of the FRP server
- CUSTOM_DOMAIN fill in the domain name set in the previous step## One More Thing> FRP one-click installation script> - linux platform, amd64 architecture> - Default service port`7000`,> - The dashboard username and password are both admin> - Token is random
> ! Onekey script only working for version 0.36.2### 1. Download the one-click installation script```
Run the pppoeconf command and keep selecting “yes” through the prompts. During the process, you will be asked to enter your PPPoE account and password.
Open System Interconnection Reference Model (OSI) is a conceptual model proposed by the International Organization for Standardization (ISO). It is a standard framework that attempts to interconnect various computers worldwide.
According to recommendation X.200, OSI divides the computer network architecture into seven layers, labeled 1 to 7, with Layer 1 at the bottom.
The Application Layer provides interfaces for application software to establish communication with other applications. Examples include: HTTP, HTTPS, FTP, Telnet, SSH, SMTP, POP3, etc.
The Presentation Layer converts data into formats compatible with the recipient’s system, making it suitable for transmission (e.g., encoding, encryption, compression).
The Transport Layer adds a transport header (TH) to the data to form packets. It manages end-to-end transmission, error recovery, and flow control. Examples include: TCP and UDP.
The Data Link Layer handles physical addressing, error detection, and synchronization. It packages packets into data frames. It is divided into two sub-layers: Logical Link Control (LLC) and Media Access Control (MAC). Examples include: Ethernet, Wi-Fi, GPRS, etc.
Gogs keeps default configuration in conf/app.ini. You normally do not edit that file directly, because the default configuration has been embedded into the binary since v0.6.0.
Control Panel,Region,Administrative,Language for non-Unicode Option Set as Chinese(Simplified,China)
Control Panel,Region,Formats,Format Option Set as Chinese(Simplified,China).
After this setting, the system format changes to Chinese, and the matlab display language also changes to Chinese. However, when plotting, garbled characters will still be displayed.
The main reason is character set mismatch.
## MethodFind the lcdata.xml file in the MATLAB directory. When the file is empty, MATLAB automatically calls the system default character set. Therefore, copy lcdata_utf8.xml in the MATLAB directory and rename it to lcdata.xml. Replace the content with the following```
Because AuthorizedKeysFile is set to .ssh/authorized_keys, the file is stored under the target user’s home directory. If the target account is git, the path should be /home/git/.ssh/authorized_keys.
Create an SSH key pair and specify RSA as the authentication algorithm. DSA is the older default algorithm on some systems.
$ ssh-keygen -t rsa
This creates a public key and a private key. If you do not change the path and do not set a passphrase, the files are usually saved under the current user’s .ssh directory as id_rsa and id_rsa.pub.
After entering the git user’s password and importing the key successfully, return to the server, confirm that authorized_keys exists, and adjust permissions:
paragraph
Line breaks require two carriage returns
font italic text italic textBold textBold TextBold italic textitalic bold text
dividing line
You can use more than three asterisks, minus signs, and underscores in a line to create a separator line. There can be no other things in the line.
***
-–
strikethrough
Add ~~ at both ends of the textGoogle.com
Underline
Underline
footnote
Format: [^famous text required]
This is a text that requires footnotes 1