This commit is contained in:
veypi
2024-05-23 16:11:06 +08:00
parent bc0cf47785
commit f64a97ecb0
16 changed files with 343 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
# apt cache mirror
```bash
apt-get install apt-cacher-ng
systemctl enable apt-cacher-ng
service apt-cacher-ng start
#/etc/apt-cacher-ng/acng.conf
```
+14
View File
@@ -0,0 +1,14 @@
# linux 检查 系统资源
| 命令 | 含义 |
| :------------------: | :----------: |
| uname -a | 查看内核 |
| head -n 1 /etc/issue | 查看操作系统 |
| cat /proc/cpuinfo | 查看cpu |
| lscpu | 查看cpu |
| | |
| free -m | 查看mem |
| df -h | 查看分区使用 |
| du -h | 查看目录大小 |
| | |
+35
View File
@@ -0,0 +1,35 @@
# create ap
### ubuntu netplan
```bash
sudo apt install hostapd
sudo systemctl unmask hostapd
sudo systemctl enable hostapd
sudo vim /etc/hostapd/hostapd.conf
```
```yaml
interface=wlan0
driver=nl80211
hw_mode=g
channel=1
ieee80211d=1
country_code=DE
ieee80211n=1
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
ssid=yourSSID
wpa_passphrase=yourpassphrase
```
```bash
sudo vim /etc/default/hostapd
# DAEMON_CONF="/etc/hostapd/hostapd.conf"
```
+13
View File
@@ -0,0 +1,13 @@
#! /bin/sh
#
# date.sh
# Copyright (C) 2023 veypi <i@veypi.com>
#
# Distributed under terms of the MIT license.
#
sudo date -s "$(bash ~/.date.sh 01)"
a=$RANDOM
a1=$1
echo $(printf "202310${a1}T%02d:%02d:%02d" $(($RANDOM%24)) $(($RANDOM%24)) $(($RANDOM%24)) )
+4
View File
@@ -0,0 +1,4 @@
# lazy git 使用
https://github.com/jesseduffield/lazygit
+15
View File
@@ -0,0 +1,15 @@
# lvm
## lvm 扩容
```bash
sudo lvdisplay
sudo pvdisplay
sudo lvextend -L +1.5TB /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h
```
+43
View File
@@ -0,0 +1,43 @@
# ubuntu22 install 4090 dirver
## ubuntu server
```bash
sudo apt install nvidia-driver-550-server nvidia-utils-550-server
reboot
nvidia-smi
```
```bash
sudo apt install pkg-config libglvnd-dev gcc-12 make
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
sudo systemctl set-default multi-user.target
sudo reboot -h now
sudo ./NVIDIA-Linux-x86_64-535.171.04.run
sudo systemctl set-default graphical.target
sudo reboot -h now
```
## cuda
https://developer.nvidia.com/cuda-toolkit-archive
https://developer.nvidia.com/cuda-12-1-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local
```bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt -y install cuda
```
+20
View File
@@ -0,0 +1,20 @@
# 4090直通
```bash
lspci -nn | grep NVIDIA
10de:2684,10de:22ba
echo "vfio vfio_iommu_type1 vfio_virqfd vfio_pci ids=10de:2684,10de:22ba" >> /etc/initramfs-tools/modules
echo "options vfio-pci ids=10de:2684,10de:22ba" > /etc/modprobe.d/vfio.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nvidia.conf
echo "blacklist nvidiafb" >> /etc/modprobe.d/blacklist-nvidia.conf
sed -ri "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ intel_iommu=on vfio-pci.ids=10de:2684,10de:22ba\"/" /etc/default/grub
update-initramfs -u
update-grub
reboot -h now
```
+6
View File
@@ -3,6 +3,7 @@
``` bash
sudo apt install -y zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sh -c "$(curl -fsSL https://public.veypi.com/install_zsh.sh)"
echo 'PROMPT=%m\ $PROMPT' >> ~/.zshrc
@@ -11,4 +12,9 @@ sed -i '1i\DISABLE_AUTO_UPDATE="true"' ~/.zshrc
chsh -s /bin/zsh
sudo reboot -h now
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
cd ohmyzsh/tools
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh install.sh
```