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]

User and Group

User

sudo useradd -m -s $SHELL <user>
sudo passwd <user>
sudo usermod -aG <group> <user>
sudo groups <user>
sudo visudo
# user host=(target_user:target_group)[option:] command
# %group host=(target_user:target_group)[option:] command
# ex
# hhk7734λŠ” μ ‘μ†μœ„μΉ˜μ— 관계없이, μ–΄λ–€ μœ μ €λ‚˜ 그룹의 μ†Œμœ μ— 관계없이
# ν™˜κ²½ λ³€μˆ˜λ₯Ό μœ μ§€ν•˜κ³ , μ•”ν˜Έ μž…λ ₯ 없이 λͺ¨λ“  λͺ…λ Ήμ–΄λ₯Ό sudo둜 μ‹€ν–‰ κ°€λŠ₯
# μΆ”κ°€ μœ„μΉ˜λ₯Ό λͺ¨λ₯΄λ©΄ 맨 μ•„λž«μ€„μ— μΆ”κ°€ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.
# hhk7734 ALL=(ALL:ALL) NOPASSWD:SETENV: ALL

Group

sudo groupadd <group>

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=

systemctl

sudo systemctl status <service_name>
sudo systemctl enable <service_name>
sudo systemctl disable <service_name>
sudo systemctl start <service_name>
sudo systemctl stop <service_name>
sudo systemctl restart <service_name>

Zsh

sudo apt install -y git zsh curl \
&& chsh -s $(which zsh) \
&& sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions \
&& sudo apt install -y autojump \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
echo '# Path to your oh-my-zsh installation.
export ZSH="'$HOME'/.oh-my-zsh"
# theme
ZSH_THEME="refined"
# plugins
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
autojump
)
source $ZSH/oh-my-zsh.sh
autoload -U compinit && compinit
# alias
alias ls="ls -F --color=auto"
alias cf="clang-format -style=file -i -verbose"
' > ~/.zshrc
Last updated on