PA0-notes
Very Basic Vim
You can edit /etc/vim/.vimrc for settings
origin mode, insert mode, quit mode
origin mode
- main usage:
h,j,k,l for the moving
i for entering insert mode - for entering the quit mode
insert mode
just like the origin windows one
quit mode
:w for saving
:q for quitting
Makefile
本质:描述有向无环图
BASIC rule:
target file: dependent file
instructions
first example: hello world
1 | hello:hello.o |
a more complicated one: test
target: test
origin: program1.c program1.h program2.c program2.h main.c main.h
1 | # 目标文件:test |
some skills
=: simplifyingTAR = test : TAR can stand for test
+=: addingTAR += test1: TAR can not only stand for test, but also stand for test1
:=: always =
simplification of the example above: \
1 | TAR = test |
%.o: any .o file*.o: all of the .o file
1 | program1.o:program1.c |
can be simplified to
1 | %.o:%.c |
$^: all dependent files
$@: all target files
$<: all first files of the dependent files
Basic GDB & Valgrind
a simple tool for debugging
see [[61C-P0-debug]] for more!
tmux
a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
sessions
start
1 | tmux |
exit
1 | exit |
or ^D
create a session
1 | tmux new -s <session-name> # seems not work! |
split sessions
1 | tmux detach |
list sessions
1 | tmux ls |
enter sessions
1 | tmux attach -t 0 |
kill sessions
1 | tmux kill-session -t 0 |
windows
split windows
1 | tmux split-window # split up and down |
光标切换到上方窗格$ tmux select-pane -U
光标切换到下方窗格$ tmux select-pane -D
光标切换到左边窗格$ tmux select-pane -L
光标切换到右边窗格$ tmux select-pane -R
当前窗格上移$ tmux swap-pane -U
当前窗格下移$ tmux swap-pane -D
GitHub SSH in Linux
1 | ssh-keygen -t ed25519 -C "your-email" |
then enter twice (if you want to set up the password, ignore that)
your public key will be generated in /root/.ssh/id_exxxx.pub
using github, add the generated ssh key to your account, then OK
other useful informations
aptitude is a useful tool for handling the dependency in linux!
