共有 274 篇文章
LaTeX
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 }}

启用

在配置文件中添加

Arch Linux Installation
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-23 - 2024-09-15
  • 排序算法
  • 不稳定排序
  •     $_math_inline$O(n\log(n))$math_inline_$
    
通过proxychain在命令行实现魔法
2020-01-22 - 2024-09-18
在魔法环境下运行命令行命令,例如 apt-get wget git curl
Ubuntu Error: ENOSPC:System limit for number of file watchers reached
2020-01-03 - 2024-09-18
Ubuntu Error: ENOSPC:System limit for number of file watchers reached
Cellular automaton
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.
插入音乐/视频
2019-11-27 - 2024-09-18
Hexo 插件插入音乐/视频
配置SSL证书
2019-11-07 - 2024-09-18
Nginx 配置SSL证书