Skip to main content

Etc


clang-format

Installation

sudo apt install -y clang-format-9 \
&& sudo update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9) 1

Option

https://clang.llvm.org/docs/ClangFormatStyleOptions.html

wget https://raw.githubusercontent.com/hhk7734/conf/master/.clang-format -O .clang-format

Usage

clang-format -style=file -i -verbose [file]

systemd service

시작 서비스 등록을 위해 필요 옵션만 골라서 사용하면 됩니다. 다양한 옵션이 있으므로 필요에 따라 검색해봐야합니다.

sudo vim /etc/systemd/system/<service_name>.service
sudo chmod +x /etc/systemd/system/<service_name>.service

<service_name>.service

[Unit]
Description=
# 의존
Requires=
# 약한 의존
Wants=
# 작성 중인 서비스 A before B
# B 이전에 A 실행
Before=
# 작성 중인 서비스 A after C
# C 이후에 A 실행
After=
# C -> A -> B 순으로 실행 됨

[Service]
User=
Group=
# 실행 위치
WorkingDirectory=
# 환경 변수
# 파이썬 가상환경 사용 시 "PATH=가상환경/bin" 추가
Environment=
# 실행 명령어1; 실행 명령어2;
# 또는 해당 설정을 여러번 하면 됨
ExecStart=
ExecStop=
Restart=[no|on-success|on-failure|on-watchdog|on-abort|always]

[Install]
# 유닛을 등록할때 등록에 필요한 유닛
WantedBy=default.target
RequiredBy=

Desktop Entry

/usr/share/applications/example.desktop
[Desktop Entry]
Name=
Type=<Application|Link|Directory>
Comment=
Icon=
Encoding=UTF-8
Categories=<AudioVideo|Audio|Video|Development|Education|Game|Graphics|...
# Network|Office|Science|Settings|System|Utility>
Keywords=
Exec=<command>
Terminal=<false|true>