Posted Updated 2 minutes read (About 225 words)
self configuration in linux
install
1 2 3
| apt install build-essential
echo $PATH
|
bachrc
1 2 3 4 5 6 7 8
| alias mgs="git status" alias mgc="git commit" alias mgca="git commit --amend"
alias mcmakec="rm -rf build && cmake -S . -B build" alias mcmakeb="cmake --build build --parallel 32 "
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| ssh-keygen -t ed25519 -C helianthus547@gmail.com
ssh-copy-id -i ~/.ssh/id_ed25519.pub heli@192.168.1.113
vim ~/.ssh/config
Host WS HostName 192.168.1.113 Port 22 User heli IdentityFile ~/.ssh/id_ed25519
ssh -T git@github.com
|
change to nerd font
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| apt install -yqq fontconfig
wget -q -nv https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip
unzip JetBrainsMono.zip -d ~/.local/share/fonts
fc-cache -fv
brew search font brew install font-jetbrains-mono-nerd-font
'JetbrainsMonoNL Nerd Font Mono'
|
tar
1 2 3 4 5 6 7
|
tar -zcvf xxx.tar.gz source_file
tar -zxvf xxx.tar.gz -C path
|
big or little endian
lscpu
1 2 3 4 5 6 7 8 9 10 11 12
| #include <bit> #include <iostream> int main() { if constexpr (std::endian::native == std::endian::big) std::cout << "big-endian\n"; else if constexpr (std::endian::native == std::endian::little) std::cout << "little-endian\n"; else std::cout << "mixed-endian\n"; }
|
1 2 3 4 5 6 7 8 9 10 11 12
| union T { int i; char byte[]; } t;
int main() { t.i = 1; t.byte[0] == 1;
return }
|