建議使用 Ubuntu Linux 20.04 LTS (或版本更高的發行套件),Linux 核心必須在 v5.4 以上,否則課程提供的範例和作業無法正確執行。
Try installation on Apple MacBook by multipass project
步驟 from teacher:
brew install multipass # 安裝套件
multipass launch -c 2 -d 10G -m 2G -n ubuntu # 建立名為 ubuntu 的虛擬機器環境,其中 -c 表示 CPU 數量、-d 表示儲存裝置的容量、-m 表示主記憶體空間
multipass shell ubuntu # 一旦上述的虛擬機器環境建立,透過本命令即可存取到 Ubuntu Linux
uname -a # 取得 Ubuntu Linux 核心版本資訊
lsb_release -a # 取得 Distro資訊,如:Ubuntu release
Update
Ubuntu Linux
along with macOS
to my wife's MacBook Air 2014 Early
use a USB Flash Drive which has full permission to read or write, otherwise, Dual-Boot Manager may not recognize the Ubuntu image correctly.Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
prompt
(提示;提詞)Reference the offical doc: A1.6 Appendix A: Git in Other Environments - Git in Bash
git-completion.sh
and git-prompt.sh
from contrib/completion/. in Git repo somewhere handy
I put them in my home directory: ~/Scripts
PS1
by 'single quote', inorder to evaluate $(__git_ps1 " (%s)")
correctly
reference QUOTING in
man bash
Other references
Bash Reference Manual
ArchWiki
https://www.reddit.com/r/osx/comments/y6e59/xquartz_and_apparently_incorrectly_set_display/
XQuartz
to the Login ItemsCtrl + v
+ Backspace
–> ^?
iTerm2
ls
output does not have colors on different typesreferences window -> profiles -> Default -> Colors
Color Presets...
and change the upper item from Solarized
to Regular
or High Contrast
; the following picture shows the result of selecting Regular
item:Ref.: How to install X Window System XQuartz on macOS for ssh X11 forwarding
ssh -Y the_server
:
localhost
and the offset 11
were missed in my $DISPLAY
Try to update the environment variable
$DISPLAY
but the system still hung on the appbut the issue is not the root cause, please check the next item
Try to debug on ssh
vvv
optionX11 forwarding requested but DISPLAY not set
Follow one of the answers, the points are:
DISPLAY
on the local machine (*NOT* on the server side) is almost always :0.0
ssh -X
within xterm
window from XQuartz
updated: no need to do this step
For better use
-X
option ssh command:Ref.:
Stacer
– GUI based System Optimizerdf -h
ref.: [Partitioning/Home/Moving](https://help.ubuntu.com/community/Partitioning/Home/Moving)
(Option) Mount an SD card
autofs
?Find the mount point for the SD card
lsblk
fdisk -l
Move data by rsync
command
ref.: How to use sed to find and replace text in files in Linux / Unix shell
sed -i 's/search_string/replace_string/' filename
tar -xvjf guitar_songs.tar.bz2
tar -xvzf ukulele_songs.tar.gz
tar -czvf filename.tar.gz /path/to/dir1
tar -czvf filename.tar.gz /path/to/dir1 dir2 file1 file2
tar -czvf archive.tgz *.pdf
tar -czvf projects.tar.gz $HOME/projects/
sudo mtr access.sifive.com -c 100 -r
reference https://www.kernel.org/doc/html/latest/
Comments are good, but there is also a danger of over-commenting. NEVER try to explain HOW your code works in a comment:
Generally, you want your comments to tell WHAT your code does, not HOW. Also, try to avoid putting comments inside a function body:
When commenting the kernel API functions, please use the kernel-doc format. See the files at Documentation/doc-guide/ and scripts/kernel-doc
for details.
The preferred style for long (multi-line) comments is:
For files in net/
and drivers/net/
the preferred style for long (multi-line) comments is a little different.
There is no initial almost-blank line.Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
It’s also important to comment data
, whether they are basic types or derived types.
This leaves you room for a small comment on each item, explaining its use.
fzf
Source: https://github.com/junegunn/fzf
CTRL-T
, CTRL-R
, and ALT-C
) (bash, zsh, fish)man
pagesSYNOPSIS
:
[ ]
: means flags for this command