瞧瞧我对教研室的电脑干了些什么!

双系统安装与配置

为LabPC购买了两个完全一样的480GB固态硬盘,在安装系统的时候,为了区分好系统是安装到了哪个盘里,首先是仅接入了一个SSD。当把Windows系统安装到这个SSD之后,再把另一个SSD接上,之后再去安装Ubuntu。因为在Ubuntu系统安装的分区时,能看到不同硬盘的标号,只要确定好哪个硬盘里安装好了Windows系统,在另外的一个空盘里进行分区和安装Ubuntu就好了。

先安装Windows10

之前装Windows系统的时候,我都喜欢使用官方的安装工具MediaCreationTool_Win11_23H2,用这个工具做一个U盘启动工具,但这次做U盘启动盘的时候总是报错,其实之前也遇到过了这个问题!遇到这个问题的话,可以下载Windows的镜像文件,然后用Rufus来制作U盘启动盘。

再安装Ubuntu 20.04

分区

设备 类型 挂载点 格式化? 大小
/dev/sda1 ext4 / 200GB
/dev/sda2 ext4 /boot 2GB
/dev/sda3 ext4 /tmp 20GB
/dev/sda4 ext4 /usr 80GB
/dev/sda5 ext4 /var 50GB
/dev/sda6 ext4 /home 100GB
/dev/sda7 swap 20GB

image-20231208211750504

Snipaste_2023-12-08_12-46-32

  • 磁盘0:KIOXIA 480GB ▶ Ubuntu 20.04
  • 磁盘1:KINGSTON SSD
  • 磁盘2:1TB HDD
  • 磁盘3:KIOXIA 480GB ▶ Windows 10

双系统引导界面美化+修改默认启动项

Windows11安装Ubuntu 20.04.3 LTS双系统(详细过程)| CSDN

主题下载地址:Grub-theme-vimix

ubuntu-vim-1080p

在Ubuntu系统,按照如下的步骤使用该主题。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 解压
$ tar xvJf Vimix-1080p.tar.xz

# 进入解压后的文件夹
$ cd Vimix-1080p

# 安装
$ sudo ./install.sh

# 修改启动设置
$ sudo gedit /etc/default/grub

# 修改完成之后,对更改进行更新,将电脑重启后可看到更新后的主题效果
$ sudo update-grub

一般我们需要更改其中的 GRUB_DEFAULT(默认启动项:这个编号是你开机时看到的若干个启动项从上到下的依次编号,记住!编号是从0开始的,意思是,第一项是0,第二项是1,以此类推)、GRUB_TIMEOUT_STYLE(是否显示倒计时,hidden的属性表示不会显示倒计时,注释掉该行则显示倒计时)、GRUB_TIMEOUT(等待时间,单位是秒)。
按自身需求更改后,保存即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=2
# GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=30
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_THEME="/usr/share/grub/themes/Vimix/theme.txt"

Ubuntu系统时间正确,Windows系统时间错误

在Ubuntu系统中执行如下操作

1
2
3
sudo apt-get install ntpdate					//在Ubuntu下更新本地时间
sudo ntpdate time.windows.com
sudo hwclock --localtime --systohc //将本地时间更新到硬件上

Ubuntu无法连接网络

有线网络-拨号上网

1
2
3
4
$ npu481@npu481-H310M:~$ cat /sys/class/net/enp5s0/carrier
1 # 输入为1证明网线连接到了网口上了,证明硬件层面没有什么问题!

# 至于是不是代表着“有线网卡的驱动安装好了”,我也不清楚

PC的有线网上网连接方式是拨号上网,所以我得先建立一个拨号的链接。
按照下面的操作,添加一个DSL/PPPoE

1
$ nm-connection-editor

image-20231207214319121

  • 上网接口即为网线,这里是enp5s0
  • 用户名输入为上网账号,西工大的上网账号即为学号;
  • 服务,空着
  • 密码即为西工大的上网密码
1
$ sudo apt-get update

使用上面这种方法有一种问题是,每次开机之后电脑都没有网络,必须手动到网络设置中把有线网打开。

pppoeconf

1
2
$ sudo apt-get install pppoeconf
# 按照提示,输入上网账号和秘密即可,以后就能自动拨号了。

几个常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
npu481@npu481-H310M:~$ sudo pon dsl-provider # 联网
Plugin rp-pppoe.so loaded.
npu481@npu481-H310M:~$ sudo poff # 断网
npu481@npu481-H310M:~$ plog # 在断网状态下查看日志
Dec 8 10:54:40 npu481-H310M pppd[9905]: Terminating on signal 15
Dec 8 10:54:40 npu481-H310M pppd[9905]: Connect time 0.1 minutes.
Dec 8 10:54:40 npu481-H310M pppd[9905]: Sent 16471 bytes, received 24941 bytes.
Dec 8 10:54:40 npu481-H310M pppd[9905]: Connection terminated.
Dec 8 10:54:40 npu481-H310M pppd[9905]: Sent PADT
Dec 8 10:54:40 npu481-H310M pppd[9905]: Exit.
npu481@npu481-H310M:~$ sudo pon dsl-provider # 联网
Plugin rp-pppoe.so loaded.
npu481@npu481-H310M:~$ ifconfig # 在联网状态下查看网络状态
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::8dd3:2a85:6bb9:f6e prefixlen 64 scopeid 0x20<link>
ether 18:c0:4d:56:b9:c0 txqueuelen 1000 (以太网)
RX packets 102253 bytes 132719087 (132.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38868 bytes 5981990 (5.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (本地环回)
RX packets 5850 bytes 526989 (526.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5850 bytes 526989 (526.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1492
inet 10.71.10.187 netmask 255.255.255.255 destination 10.68.0.1
ppp txqueuelen 3 (点对点协议)
RX packets 56 bytes 7807 (7.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 66 bytes 10491 (10.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

通过pppoeconf设置后,每次开机就能自动拨号了,但这样出现了一个很奇怪的现象是,网络设置中,有线的那个选项没有了,并且出现了“有线未托管”的字样。这样用起来没有什么问题,但我并不知道出现这种问题的原因是什么!

image-20231208211916678

无线网络和蓝牙

USB无线网卡不知道怎么弄

后续:买的这个USB无线为网卡不支持Linux,蓝牙适配器也不支持Linx!好吧,就只能先这样将就这就这样用吧~

在Ubuntu安装常用软件

‘deb’软件

  • Nutstore
  • Chrome
  • Sunlogin
  • VSCode
1
2
$ sudo apt-get install -f # 
$ sudo dpkg -i nautilus_nutstore_amd64.deb

CFW

  • Step 1, install and setup

Github上的CFW已经删库了,唉!只能在网上找一找别人之前做到备份了.

1
2
3
4
$ tar -zxvf Clash.for.Windows-0.20.39-x64-linux.tar.gz
$ mv 'Clash for Windows-0.20.39-x64-linux' CFW
$ cd CFW
$ ./cfw
  • Step 2, 在CFW的Profiles中加入自己的配置文件,然后在Proxies中选择一个节点
  • Step 3, 打开Ubuntu 设置,在网络 - VPN - 网络代理中加入配置。

image-20231207214319121

flameshot(火焰截图)

  • 安装和启动
1
2
$ sudo apt install flameshot
$ flameshot gui
  • 绑定键盘快捷键

image-20231208211830829

git

1
2
3
sudo apt update
sudo apt install git
git --version

Ubuntu用户

  • npu481

    • 登录密码:481481
    • sudo apt-get update:481481
  • root

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ sudo passwd root
$ npu481481 #(不可见)
$ npu481481 #(不可见)

$ su

---

npu481@npu481-H310M:~/下载$ ls
Clash.for.Windows-0.20.39-x64-linux.tar.gz nautilus_nutstore_amd64.deb
code_1.84.2-1699528352_amd64.deb SunloginClient_11.0.1.44968_amd64.deb
google-chrome-stable_current_amd64.deb
npu481@npu481-H310M:~/下载$ su
密码:
root@npu481-H310M:/home/npu481/下载# ls
Clash.for.Windows-0.20.39-x64-linux.tar.gz nautilus_nutstore_amd64.deb
code_1.84.2-1699528352_amd64.deb SunloginClient_11.0.1.44968_amd64.deb

Ubuntu开机卡在了紫屏,进入不了用户登陆界面

不知道怎么回事,有一次从Ubuntu启动的时候卡在了紫屏进不来系统了。也不知怎么解决网上搜了搜说是内核的问题,也有说是英伟达驱动的问题,不知道怎么回事,于是重启之后,在开机时候选择了Ubuntu的高级选项,然后选了一个Recovery模式的内核,可以进入登陆界面,但是显示缩放不正常,并且双屏中只有一个屏幕有输出图像。这个现象和英伟达显示驱动有问题一模一样,所以就打开了附加驱动,果然当前的选择是X.Org X Server,重新选择了Nvidia驱动之后,然后重启,正常选择Ubuntu就能正常进入系统了。

image-20231208211848886

Windows MATLAB配置

字体:GitHub - yakumioto/YaHei-Consolas-Hybrid-1.12: YaHei Consolas Hybrid 字体

一种适用于matlab的代码字体解决方案 - Yu_tiann - 博客园 (cnblogs.com)

image-20231212153215003

主题:GitHub - scottclowe/matlab-schemer: Apply and save color schemes in MATLAB with ease.

Matlab如何更换主题颜色_matlab主题颜色-CSDN博客

MATLAB设置工作路径

image-20240119153258670

使用Gitpush到Github上面的时候出现问题

有一天中午,在GPU server上LabPC上push的时候出现错误,很奇怪唉,我还以为是GitHub崩掉了呢!

找了一下,在GitHub上面找到了一个解决方法,起效了!

1
2
3
4
5
6
7
[master ca35107] Site updated: 2024-01-17 16:30:15
3 files changed, 40 insertions(+), 16 deletions(-)
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决方法:Solution for ‘ssh: connect to host github.com port 22: Connection timed out’ error

git - ssh: connect to host github.com port 22: Connection timed out - Stack Overflow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Server
(base) houjinliang@3080server:~$ pwd
/mnt/houjinliang
(base) houjinliang@3080server:~$ cat .ssh/config
Host github.com
Hostname ssh.github.com
Port 443

# LabPC
(base) PS C:\Users\NPU481\.ssh> pwd
Path
----
C:\Users\NPU481\.ssh
(base) PS C:\Users\NPU481\.ssh> cat config
Host xxx # 这个是VSCode连接GPU Server时候的ssh配置
HostName xxx
User xxx
Port xxx

Host github.com
Hostname ssh.github.com
Port 443

瞧瞧我对教研室的电脑干了些什么!
https://cosmicdusty.cc/post/Tools/WorkingWithLabPC/
作者
Murphy
发布于
2023年12月7日
许可协议