-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuseful-commands
46 lines (37 loc) · 1.55 KB
/
useful-commands
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
41
42
43
44
45
46
#!/bin/bash
# don't run this, it's just for syntax highlighting
# manually importing a package key? (example)
gpg --recv-keys 5CC908FDB71E12C2
# installed yay?
yay # sync and update arch / aur
yay -Ps # stats for installed packages
yay -Yc # clean unneeded dependencies
# remove orphans
sudo pacman -Rns $(sudo pacman -Qtdq)
# check whether you fucked up and overwrote a partition table with a filesystem
sudo blkid -p /dev/sdf1 # should return gpt details -- if it's only vfat/ext4, then you forgot the number
lsblk -f # look over this and make sure it's ok
# find yourself stuck in fallback shell on boot?
mount /dev/sde2 new_root # might take some guesswork to find where your system is
ls new_root # verify that you mounted the right system
exit # continue booting
## now go and make sure your systemd-boot entry defines the root correctly!
# want to set some volume labels retroactively? (sample)
yay -S dosfstools
sudo fatlabel /dev/sde1 ESP
sudo e2label /dev/sde2 Arch
# systemd freezing at boot / no signal / black screen?
## press [e] to edit boot command, add "rescue" at the end
## if that doesn't work: press [e] and add "emergency"
## worst case scenario: replace the entire statement with "init=/bin/sh"
## in case of "emergency" shell:
modprobe igb
ip link set eth0 up
ip link set eth1 up
dhcpcd
# wanna install over ssh?
passwd
nano /etc/ssh/sshd_config # PermitRootLogin yes
systemctl start sshd
# link a systemctl service from somewhere else?
systemctl link /srv/minecraft/minecraft\@.service