2022年12月21日 星期三

新電腦安裝 (Gentoo) - 2022年12月


----------------------
比較執行 time emerge  portage 所花的時間

## 原來的電腦
CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (family: 0x6, model: 0x9e, stepping: 0xc)

real 0m32.807s
user 0m23.179s
sys 0m12.093s

## 新的電腦
CPU: 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (family: 0x6, model: 0xa7, stepping: 0x1)

real 0m12.307s
user 0m9.705s
sys 0m3.753s
----------------------


2022年12月15日 星期四

Arch-Linux 安裝

原來是使用 Gentoo,但是有些電腦只是拿來做普通的事情,要等待漫長的安裝和更新 ,是不切實際的。使用 Ubuntu 一陣子覺得不習慣,改試 Arch-Linux,好像和 Gentoo 比較接近,網路資源很豐富,就改用這個吧。

網路 IP 設定

# ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# pacman -S grub
# grub-install --target=i386-pc /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
# useradd -G wheel,audio,video -m ajax

# pacman -S networkmanager dhcpcd openssh
# systemctl start NetworkManager

# ip link set dev enp1s0 up
# ip a add 192.168.0.176/24 dev enp1s0
# ip route add default via 192.168.0.1

pacman -S xorg-server

pacman -S xfce4
# 一定要裝 lightdm-gtk-greeter 才能啟動
pacman -S lightdm lightdm-gtk-greeter

# 音效
pacman -S pulseaudio
pacman -S extra/pavucontrol
pacman -S extra/xfce4-pulseaudio-plugin

# 安裝 Nvidia 專有驅動,安裝後 nouveau 應會自動被黑名單。
pacman -S nvidia nvidia-utils

# 可以安裝純文字工具 nvtop, 用於查看顯示卡使用率
pacman -S nvtop

# 為了執行 appimage
pacman -S fuse

# 升級有衝突時
pacman -Sud

使用 AUR

# Using AUR
git clone https://aur.archlinux.org/pkgName.git
cd pkgName/
makepkg

安裝 yay
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si


# 使用 Yay – Yet another Yogurt
yay -S pkgName         ## 安裝
yay -Ss pkgName        ## 搜尋
yay -S pkgName=ver.xx  ## 安裝特定版本
要安裝 wine ==> why not simply enable multilib repo in pacman.conf and install the required libraries?

加速 yay 編譯的速度,makepkg#Parallel compilation

xrdp 設定

-----------------------
$ yay -S aur/xrdp aur/xorgxrdp

# 修改 /etc/xrdp/sesman.ini 中 [Xorg] 的區段的 param 參數
param=/usr/lib/Xorg

# 啟動 xrdp
sudo systemctl start xrdp
sudo systemctl enable xrdp
-----------------------

在個人的目錄下,建立 .xinitrc,內容如下

-----------------------
#!/bin/sh

exec dbus-launch --sh-syntax startxfce4
-----------------------

並且將其設成可執行 chmod a+x .xinitrc。


vmware-workstation

# pacman -S linux-headers
$ yay -S  --needed  vmware-workstation15
# modprobe -a vmw_vmci vmmon
# systemctl start vmware-networks
# systemctl start vmware-usbarbitrator
# systemctl start vmware-hostd

安裝 chrome-remote-desktop,下載時出現 404

網友回覆如下

----------------------------

All,

From comments in the Gentoo net-misc/chrome-remote-desktop ebuild:

# Use curl to find the answer:
#  curl -q https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages | grep ^Filename

As of 15:50 US Eastern Standard Time on 2023/3/3, the current version is:

pool/main/c/chrome-remote-desktop/chrome-remote-desktop_111.0.5563.12_amd64.deb

HTH :)

Clemmitt Sigler

--------------------------------

--------------------------------
# pacstrap -K /mnt base linux linux-firmware
error: openssl: signature from "Pierre Schmitz <pierre@archlinux.org>" is marginal trust
:: File /mnt/var/cache/pacman/pkg/openssl-3.0.8-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 

==== 修正 ====
# pacman -Sy archlinux-keyring
==== 還是失敗 ====
# pacman-key --init
--------------------------------

更新的問題

太久沒更新,導證憑證過期,無法更新。

參考 https://wiki.archlinux.org/index.php/Pa … mport_keys

 出現的錯誤如下:

:: Proceed with installation? [Y/n] error: i3-wm: signature from "Thorsten Töpper <atsutane@freethoughts.de>" is unknown trust
:: File /var/cache/pacman/pkg/i3-wm-4.11-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] error: failed to commit transaction (invalid or corrupted package (PGP signature))

可行方法之一是執行下面的指令,但可能沒用,而且可能花很久的時間。

sudo pacman-key --refresh-keys

解決辦法之一 https://bbs.archlinux.org/viewtopic.php?id=281914ue:

# rm -rf /etc/pacman.d/gnupg
# pacman-key --init
# pacman-key --populate archlinux
# pacman -Sy archlinux-keyring

後來解決了。




2022年12月8日 星期四

PhpStorm 試用

PhpStorm 是開發 PHP 程式的非常好用的程式,在 2021.1.4 版本之前,不用申請授權即可試用,之後則要申請試用的授權。這裡收集了網路上關於可以延長試用的方式,留作參考。

ide-eval-resetter  (僅適用 2021.1.4 版本)

 PhpStorm 的試用期為一個月,可能不足以了解其功能,想要延長其使用期限,有人提供了此功能。但該公司非常積極的防堵使用者各種揩油的途徑,後來的試用就改成必需申請才能用囉。因此這種裝好就能用的版本只到 2021.1.4 版本,之後就只能另想辦法了。

在此特別記錄一下當作參考。

PhpStorm 2021.1.4 is released -- PHP 2021.1.4 的 release note。支援到 PHP 8.0。

Jetbrains系列产品重置试用方法[归档] -- 說明,本项目已过时,自2021.2.3开始不再推荐使用。请支持正版!


0x1. 如何安装

1). 插件市场安装:

在Settings/Preferences... -> Plugins 内手动添加第三方插件仓库地址:https://plugins.zhile.io

搜索:IDE Eval Reset插件进行安装。如果搜索不到请注意是否做好了上一步?网络是否通畅?

插件会提示安装成功。

2). 下载安装:

点击这个链接(v2.3.5)下载插件的zip包 (ide-eval-resetter-2.3.5-c80a1d.zip)。(macOS可能会自动解压,然后把zip包丢进回收站)

通常可以直接把zip包拖进IDE的窗口来进行插件的安装。如果无法拖动安装,你可以在Settings/Preferences... -> Plugins 里手动安装插件(Install Plugin From Disk...)

插件会提示安装成功。

使用 ja-netfilter.jar

說實在的,我並不清楚這個東西是在做什麼,只是照著做,試試看能不能試用。試用結果是 2023.2 版本可以試用。詳情不多說,可以試著搜尋 uninstall-current-user.vbs,就能找到相關的作法。


網誌存檔