Hello Navi

Tech, Security & Personal Notes

Here's something encrypted, password is required to continue reading.

Here's something encrypted, password is required to continue reading.

Here's something encrypted, password is required to continue reading.

Here's something encrypted, password is required to continue reading.

Here's something encrypted, password is required to continue reading.

Here's something encrypted, password is required to continue reading.

device and version

1
2
3
4
5
6
7
8
9
10
11
12
13
❯ fastfetch
OS: Arch Linux x86_64
Kernel: Linux 6.12.9-arch1-1
Shell: zsh 5.9
Locale: en_US.UTF-8

#version
❯ unzip -v
UnZip 6.00 of 20 April 2009

# file
❯ file NT2_GamePatch.zip
NT2_GamePatch.zip: Zip archive data, at least v2.1 to extract, compression method=deflate64

解压失败

1
2
3
4
5
6
7
8
❯ unzip NT2_GamePatch.zip
Archive: NT2_GamePatch.zip
warning [NT2_GamePatch.zip]: 808664702 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [NT2_GamePatch.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)

It appears to be corrupt or improperly formatted. Maybe something is wrong with transferring.

尝试修复

1
❯ zip -FF NT2_GamePatch.zip --out repaired.zip

再次解压,成功

1
2
3
4
5
❯ unzip repaired.zip -d ./temp
Archive: repaired.zip
inflating: ./temp/movie/b4n0m8s3t6.dat
inflating: ./temp/movie/c8r3x6v1p0.dat
# ...

save your time

使用7z直接解压,成功

1
❯ 7z x NT2_GamePatch.zip -oNT2 

7z usage

1
2
3
E[x]tract an archive to [o]utput directory:

7z x archive.7z -ooutput

可能有用

unzip解压缩中文名乱码问题

title

平时使用中发现zsh启动延迟大到需要等上好几秒,翻过改的乱七八糟的zshrc发现是conda在拖慢启动速度。

虽然最便捷的方法是不用conda,但作业又经常用到conda的环境。

这里选择为conda绑定alias,在需要时启动。

1
2
3
# in .zshrc add

alias ci='source ~/.config/zsh/conda.zsh'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# in conda.zsh

#!/usr/bin/zsh
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

my device

1
2
3
Host: RedmiBook Pro 15
CPU: 11th Gen Intel i5-11300H (8) @ 4.400GHz
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics]

USB drive install ventory

copy archlinux image to ventory push USB driver in target computer # Enter BIOS(UEFI) reboot from USB driver, then choose archlinux grub2

Here CLI

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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# if font small
setfont ter-132n

systemctl stop reflector.service

iwctl
device list
station wlan0 scan
station wlan0 get-networks
station wlan0 connect WIFI
exit

ping www.bilibili.com
timedatectl set-ntp true

lsblk
parted /dev/nvme0n1
(parted)mktable
New disk label type? gpt
quit

cfdisk /dev/nvme0n1
# then set partition and its type
# set 1G EFI system
# set 4G swap
# set [the rest space] linux root x86-64
# quit
fdisk -l

# linux root x86-64
mkfs.ext4 /dev/nvme0n1p3
# swap
mkswap /dev/nvme0n1p2
# EFI system
mkfs.fat -F 32 /dev/nvme0n1p1

# keep linux root x86-64 first
mount /dev/nvme0n1p3 /mnt
mkdir /mnt/efi
mount /dev/nvme0n1p1 /mnt/efi
swapon /dev/nvme0n1p2

vim /etc/pacman.d/mirrorlist
# Put in the first line
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch

pacstrap /mnt base base-devel linux linux-headers linux-firmware
pacstrap /mnt dhcpcd iwd vim bash-completion

genfstab -U /mnt >> /mnt/etc/fstab

arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc

vim /etc/locale.gen
# uncomment en_US.UTF-8 an zh_CN.UTF-8

locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
vim /etc/hostname
ark233
vim /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 ark233

passwd root
pacman -S intel-ucode
# or pacman -S amd-ucode
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
vim /etc/default/grub
# set GRUB_CMDLINE_LINUX_DEFAULT loglevel=5
# i missed this command in the first installation xD
grub-mkconfig -o /boot/grub/grub.cfg

exit
umount -R /mnt
# pull out USB driver
reboot

# accomplished

after installation

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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
setfont -d

vim ~/.bash_profile
export EDITOR='vim'

useradd -m -G wheel -s /bin/bash arch
passwd arch
# still in CLI
EDITOR=vim visudo
# uncomment %wheel ALL=(ALL:ALL) ALL

vim /etc/pacman.conf
# unmount [multilib] section
# add these
[archlinuxcn]
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
Server = https://mirrors.hit.edu.cn/archlinuxcn/$arch
Server = https://repo.huaweicloud.com/archlinuxcn/$arch

sudo pacman-key --lsign-key "farseerfc@archlinux.org"
sudo pacman -S archlinuxcn-keyring
sudo pacman -S paru

pacman -Syyu


# learn from https://medium.com/@mynameised/using-keyd-in-hyprland-to-rebind-your-right-alt-key-to-escape-linux-782086c81c75
sudo paru -S keyd
sudo vim /etc/keyd/default.conf
[ids]

*

[main]
# hold is control, tap is esc
capslock = overload(control, esc)

vim ~/.config/hypr/hyprland.conf
# add these
exec-once = sudo keyd

paru -S fcitx5-im fcitx5-chinese-addons fcitx5-pinyin-zhwiki
# add pinyin
# ctrl+space switch

vim /etc/environment
GTK_IM_MODULE=fcitx
# or choose setting as https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#GTK_IM_MODULE
QT_IM_MODULE=fcitx5
XMODIFIERS=@im=fcitx

# from https://www.bilibili.com/read/cv24998287/
paru -S xorg-xrdb
vim ~/.config/hyprland.conf
monitor = ,highres,auto,2
# exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
# exec-once = echo 'Xft.dpi:192' | xrdb -merge
env = GDK_SCALE,2
env = XCURSOR_SIZE,32

# Chrome
# Go to chrome://flags and search for Preferred Ozone platform. From the drop-down menu, select Wayland and restart Chrome.
# enable Wayland text-input-v3

paru -S sof-firmware linux-firmware

dotfiles

myDotfiles