Sun Mar 17 2024
401 字 · 4 分钟

Ubuntu 常用设置


Table of Contents
SHELL
1
2
http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
PLAINTEXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
PLAINTEXT
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
38
39
40
# /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Types: deb-src
# URIs: http://security.ubuntu.com/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 预发布软件源,不建议启用

# Types: deb
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# # Types: deb-src
# # URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# # Suites: noble-proposed
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
SHELL
1
sudo dpkg-reconfigure console-setup
SHELL
1
2
3
$ sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX="fbcon=rotate:1"
$ sudo update-grub
SHELL
1
2
echo 1 | sudo tee /sys/class/graphics/fbcon/rotate
echo 1 | sudo tee /sys/class/graphics/fbcon/rotate_all
SHELL
1
2
3
sudo apt install zsh
chsh -s $(which zsh)
sudo chsh -s $(which zsh)
SHELL
1
2
$ sudo vim /etc/sudoers
username ALL=(ALL:ALL) NOPASSWD:ALL
SHELL
1
2
sudo apt install build-essential
sudo apt install gcc gfortran
SHELL
1
2
3
4
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
SHELL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
#SBATCH -N 1
#SBATCH -n 4

# specify all the variables
EXECUTABLE=/home/chantian/tristan-mp-v2/bin/tristan-mp2d
INPUT=/home/chantian/tristan-mp-v2/inputs/input.2d_rec
OUTPUT_DIR=/home/chantian/program/output
SLICE_DIR=/home/chantian/program/slices
RESTART_DIR=/home/chantian/program/restart
REPORT_FILE=report
ERROR_FILE=error

srun $EXECUTABLE -i $INPUT -o $OUTPUT_DIR -s $SLICE_DIR -r $RESTART_DIR >$OUTPUT_DIR/$REPORT_FILE 2>$OUTPUT_DIR/$ERROR_FILE
Thanks for reading!

Ubuntu 常用设置

Sun Mar 17 2024
401 字 · 4 分钟

© Kadath Drawer | CC BY-NC-ND