Posts in category “Linux”

Setup PiVPN on a Vagrant virtual machine that is running Ubuntu 20.04

PiVPN should be easy to setup at any debian/ubuntu family distribution. However, my case wasn't.

  1. The first issue I met is Can't call method "set" on an undefined value at /usr/share/perl5/Debconf/FrontEnd.pm line 126, line 5., and I found a useful anwser from https://github.com/pivpn/pivpn/issues/718, which is
apt-get install --reinstall debconf

it worked! though I don't know the root cause.

  1. The second issue is rather weird, it simple stuck after showing ::: Backing up the openvpn folder... message. What's wrong with that on earth? Unfortunately, I couldn't find anything useful from google/stackoverflow.... I have to find out the root cause by myself.

ps -ef command shows there is a wget -qO- https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz process running. Why it is running so long and looks never end? I copied the wget command and run it manually. aha, I found the cause!

wget https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz
--2021-10-10 23:01:15--  https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz
Resolving github.com (github.com)... 52.64.108.95
Connecting to github.com (github.com)|52.64.108.95|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-releases.githubusercontent.com/4519663/0fa24e00-72ba-11ea-9afe-6e5829eec4a4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211010%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211010T230115Z&X-Amz-Expires=300&X-Amz-Signature=1acb19fd17e7cb4f74c5695b194dc2040b13d9649da64b191a53591758471718&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=4519663&response-content-disposition=attachment%3B%20filename%3DEasyRSA-3.0.7.tgz&response-content-type=application%2Foctet-stream [following]
--2021-10-10 23:01:15--  https://github-releases.githubusercontent.com/4519663/0fa24e00-72ba-11ea-9afe-6e5829eec4a4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211010%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211010T230115Z&X-Amz-Expires=300&X-Amz-Signature=1acb19fd17e7cb4f74c5695b194dc2040b13d9649da64b191a53591758471718&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=4519663&response-content-disposition=attachment%3B%20filename%3DEasyRSA-3.0.7.tgz&response-content-type=application%2Foctet-stream
Resolving github-releases.githubusercontent.com (github-releases.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8003::154, 2606:50c0:8001::154, ...
Connecting to github-releases.githubusercontent.com (github-releases.githubusercontent.com)|2606:50c0:8002::154|:443... ^C

You could see, all of the IP addresses wget used are in IPV6 format while my network doesn't support IPV6 . So it is easy to fix. According to this question from stackoverflow, I added the following line at the end of /etc/wgetrc and the issue has gone!

inet4_only = on

Solved: XPS 15 on Pop OS 20.04 gui got stuck after updating firmware

Previously, I have updated the firmware several times, so when I saw there's a new update, I clicked the "Update" button without too much thoughts. Yes, I got trouble this time. I got a black screen while the system is not dead. I can log into the system by pressing Alt+Ctrl+F2, no gui, but I can do something to fix it. It is good enough. I searched on my cellphone to try find something. And the following article helped me.

System76 login-loop-pop

In my case, I guess that the root cause could be the nvidia driver, so I followed the [Reinstall NVIDIA Driver] section in that article and it did save my life.

# remove current driver
sudo apt purge ~nnvidia
sudo apt autoremove
sudo apt clean
# reinstall it
sudo apt update
sudo apt full-upgrade
sudo apt install system76-driver-nvidia

In case someone else got trapped into the same situation, I wrote my solution here and hope it helps.

PopOS/Ubuntu fcitx-rime setup

By my recommendation, my new workmate He (贺) moved to Ubuntu from windows, and he was annoyed of one thing: cannot input Chinese. And I have to google again to find out the answer. This is why I wrote this list for him like people and myself.

sudo apt install fcitx fcitx-rime
im-config  # and select fcitx as the input engine
fcitx-configtool # > Add input method, remember to tick off `Only Show Current Language`

A simple nfs server on centos

At the server end

choose a server as the nfs-server, do things below in root role

dnf -y install nfs-utils
mkdir /mnt/nfs-share
chown -R nobody /mnt/nfs-share/

vim /etc/exports
add a line
/mnt/nfs-share 192.168.178.0/255.255.255.0(rw,sync,all_squash)
save and exit

systemctl enable nfs-server
systemctl start nfs-server

At the client end

dnf -y install nfs-utils
mkdir /mnt/nfs-local
chown -R nobody /mnt/nfs-local/

vim /etc/hosts
add a line, replace 192.168.xxx.yyy to the IP addr of your NFS server
nfs-server 192.168.xxx.yyy 

vim /etc/fstab
add a line
nfs-server:/mnt/nfs-share  /mnt/nfs-local   nfs defaults   0 0
save and exit
 
mount -a # to confirm what you have done is right

other utils:

You could use showmount -e 192.168.xxx.yyy to get a share list from the nfs server.

flameshot: a better screenshot tool with editing support for ubuntu