跳到正文

个人记录

config

shicj约 2 分钟
原文
文章信息与版本

文章信息

发布
2025年11月24日
收录
2025年12月12日
更新
2026年11月8日
篇幅
约 2 分钟

版本

  1. v2当前
  2. v1

vimrc

代码
set hidden
set number
set ts=4 sw=4 autoindent cindent smartindent mouse=a
set backspace=indent,eol,start
set noexpandtab guifont=Consolas::h12
syntax on
colorscheme habamax

makefile

代码
# Compiler and flags
CXX = g++
CXXFLAGS = -Wall -std=c++11 -DUSE_FILE_IO

# Target executable
TARGET = code

# Source files
SRC = code.cpp

all: $(TARGET)
	./$(TARGET)

$(TARGET): $(SRC)
	$(CXX) $(CXXFLAGS) -o $@ $^

clean:
	rm -f $(TARGET)

.PHONY: all clean

service 模板

代码
[Unit]
Description=Name
After=network.target

[Service]
ExecStart=Command
Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target

写入 /etc/systemd/system/Name.service

代码
sudo systemctl enable Name
sudo systemctl start Name
sudo systemctl status Name
原文