共有 277 篇文章
📅 最近更新
2022-07-14
- 2024-09-18
选择要下载的版本
下载安装
1# 下载
2wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz
3# 解压
4mv go1.18.4.linux-amd64.tar.gz go.tar.gz
5tar -C /usr/local -xzf go.tar.gz
配置环境变量
1# 编辑.bashrc
2vim /root/.bashrc
3# 添加如下内容
4export GOPATH=/root/go
5export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
6# 设置代理
7# Set the GOPROXY environment variable
8export GOPROXY=https://goproxy.io,direct
9# Set environment variable allow bypassing the proxy for specified repos (optional)
10export GOPRIVATE=git.mycompany.com,github.com/my/private
使环境变量生效
1source /root/.bashrc
安装完成
查看安装的go版本
2022-07-14
- 2024-09-18
编辑
1apt install apt-transport-https ca-certificates
2vim /etc/apt/sources.list
Debian 11
1# Official & Contrib & Non-free
2deb https://deb.debian.org/debian bullseye main contrib non-free
3deb-src https://deb.debian.org/debian bullseye main contrib non-free
4
5deb https://deb.debian.org/debian-security bullseye-security main contrib non-free
6deb-src https://deb.debian.org/debian-security bullseye-security main contrib non-free
7
8deb https://deb.debian.org/debian bullseye-updates main contrib non-free
9deb-src https://deb.debian.org/debian bullseye-updates main contrib non-free
10
11# Backports
12deb https://deb.debian.org/debian bullseye-backports main contrib non-free
13deb-src https://deb.debian.org/debian bullseye-backports main contrib non-free
Debian 12
1# apt install apt-transport-https ca-certificates
2
3deb https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware
4deb-src https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware
5
6deb https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
7deb-src https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
8
9deb https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
10deb-src https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
11
12deb https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware
13deb-src https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware
2022-07-14
- 2024-09-18
安装SSH服务
1apt-get install openssh-server
修改SSH配置文件
1vim /etc/ssh/sshd_config
配置项
1# 监听端口
2Port 22
3
4# 监听地址
5ListenAddress 0.0.0.0
6
7# 是否允许root用户登录
8PermitRootLogin yes
9
10# 允许密码认证
11PasswordAuthentication yes
12
13# 允许密钥认证
14PubkeyAuthentication yes
15
16# 客户端保活
17ClientAliveInterval 60
18ClientAliveCountMax 3
Message of the Day
内容放在vim /etc/motd
,可以用 UpdateMotd 动态生成的内容,也可以直接使用landscape-common
2021-07-14
- 2024-09-18
如果要启用Mathjax和KaTeX
在header模板中添加以下内容
1 <!-- Mathjax support -->
2 {{ with .Site.Params.mathjax }}
3 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
4
5 <!-- inline Mathjax -->
6 <script type="text/x-mathjax-config">
7 MathJax.Hub.Config({
8 tex2jax: {
9 inlineMath: [['$math_inline$','$math_inline$'], ['\\(','\\)']],
10 displayMath: [['$math_noinline$','$math_noinline$'], ['\[','\]']],
11 processEscapes: true,
12 processEnvironments: true,
13 skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
14 TeX: { equationNumbers: { autoNumber: "AMS" },
15 extensions: ["AMSmath.js", "AMSsymbols.js"] }
16 }
17 });
18 </script>
19 {{ end }}
20
21 <!-- KaTeX support -->
22 {{ with .Site.Params.katex }}
23 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css">
24 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js"></script>
25 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
26
27 <!-- inline KaTeX -->
28 <script>
29 document.addEventListener("DOMContentLoaded", function() {
30 renderMathInElement(document.body, {
31 delimiters: [
32 {left: "$math_noinline$", right: "$math_noinline$", display: true},
33 {left: "$math_inline$", right: "$math_inline$", display: false}
34 ]
35 });
36 });
37 </script>
38 {{ end }}
在layouts/shortcodes下添加latex.html
1<!-- layouts/shortcodes/latex.html -->
2{{ if .Site.Params.viryLatex }}
3 {{ if ne (.Get "inline") ("false") }}
4 {{ $url := printf "<img style='border: none;' src=\"https://latex.akvicor.com/?base=math&key=mTFPk34&crop=1&type=png&transp=1&latex=%s\">" (urlquery .Inner) }}
5 {{ replace $url "+" "%20" | safeHTML }}
6 {{ else }}
7 {{ $url := printf "<p><img style='border: none;' src=\"https://latex.akvicor.com/?base=math&key=mTFPk34&crop=1&type=png&transp=1&latex=%s\"></p>" (urlquery .Inner) }}
8 {{ replace $url "+" "%20" | safeHTML }}
9 {{ end }}
10{{ else }}
11 {{ if ne (.Get "inline") ("false") }}
12 $math_inline${{ .Inner }}$math_inline$
13 {{ else }}
14 $math_noinline${{ .Inner }}$math_noinline$
15 {{ end }}
16{{ end }}
启用
在配置文件中添加
2020-02-14
- 2024-09-15
Download ISO file
https://www.archlinux.org/download/
https://mirrors.tuna.tsinghua.edu.cn/archlinux/iso/
Prepare an installation medium
1dd bs=4M if=path/to/archlinux.iso of=/dev/sdb status=progress oflag=sync
Boot the live environment
Connect Network
1iwctl
2device list
3station [device] scan
4station [device] get-networks
5station [device] connect SSID
6
7# Check
8ip address
9
10# Update the system clock
11timedatectl set-ntp true
12timedatectl status
Partition the disks
1lsblk -l
2
3cgdisk /dev/sda
4
5# Format
6# EFI `ef00`
7# Linux `8300`
8# SWAP `8200`
9mkfs.ext4
10mkfs.vfat
11mkswap
12
13# Mount
14mount /dev/sda3 /mnt
15mkdir /mnt/boot
16mount /dev/sda1 /mnt/boot
17swapon /dev/sda2
Edit Mirrorlist
1vim /etc/pacman.d/mirrorlist
1Setver = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
2Setver = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
3Setver = https://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch
4Setver = https://mirrors.163.com/archlinux/$repo/os/$arch
1pacman -Syy
Install essential packages
1pacstrap /mnt base linux-lts linux-firmware vim
Configure the system
1genfstab -U /mnt >> /mnt/etc/fstab
2arch-chroot /mnt /bin/bash
TimeZone
1ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2hwclock --systohc --utc
Locale
1vim /etc/locale.gen
1en_US.UTF-8 UTF-8
2zh_CN.UTF-8 UTF-8
1locale-gen
2echo LANG=en_US.UTF-8 > /etc/locale.conf
3echo lap > /etc/hostname
Boot Loader
1pacman -S efibootmgr grub
2grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Arch Linux" --recheck
3grub-mkconfig -o /boot/grub/grub.cfg
User
1visudo /etc/sudoers
1%wheel ALL=(ALL) ALL
1# root password
2passwd
3# user
4useradd -m -G wheel -s /bin/zsh akvicor
5passwd akvicor
Network
1vim /etc/systemd/network/20-wired.network
Wired DHCP
1[Match]
2Name=enp1s0
3
4[Network]
5DHCP=yes
Wired Static
1[Match]
2Name=enp1s0
3
4[Network]
5Address=10.1.10.9/24
6Gateway=10.1.10.1
7DNS=10.1.10.1
8DNS=8.8.8.8
1vim /etc/systemd/network/25-wireless.network
Wired DHCP
1[Match]
2Name=wlan0
3
4[Network]
5DHCP=yes
1systemctl enable systemd-networkd
2systemctl start systemd-networkd
3systemctl enable systemd-resolved
4systemctl start systemd-resolved
5systemctl enable iwd
6systemctl start iwd
Extra Package
1pacman -S base-devel iwd zsh
2# Desktop Environment
3pacman -S xf86-video-intel xorg
4pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-font-awesome terminus-font
5pacman -S i3-gaps i3blocks i3status xorg-xinit alsa-utils
6pacman -S rofi dunst libnotify ranger feh xclip
if use xorg-xinit
2020-01-03
- 2024-09-18
Ubuntu Error: ENOSPC:System limit for number of file watchers reached
2019-12-19
- 2024-09-18
A cellular automaton is a discrete model studied in computer science, mathematics, physics, complexity science, theoretical biology and microstructure modeling.