Blog

Blog

Install Windows Subsystem for Linux

Install Windows Subsystem for Linux

Download

  • Open Microsoft Store
  • Search Ubuntu
  • Install

Install WSL

  • Run following command in PowerShell
wsl --install

Create UNIX user and password

  • Run Ubuntu

References

How to install Windows Subsystem for Linux (WSL) on Windows 10
Install WSL

Proxmox Notification Email Error

Proxmox Notification Email Error

Proxmox is using postfix as email software, and the configuration of sender email uses local hostname+domain name as below in /etc/postfix/main.cf

myhostname=full qualified hostname

Issue

The postfix tries to look for email receiver's email server, and send emails directly to the email server using myhostname defined in /etc/postfix/main.cf as senders DNS name. But the server hostname normally isn't using the public valid domain name, which causes email server rejects notification emails.

Fix

Change the default myhostname in /etc/postfix/main.cf to a valid public email domain name.

SSH Proxy

SSH Proxy

When access remote servers, proxy server/jump host could be a good choice.

Two servers definition

jump_host

This is the proxy server, normally can be in the form of user@proxy_host.

target

This is the target server, has the form of target_user@target_host.

Jump host

This is the most simplest method which uses remote ssh command to login to target server. If just wants to use one SSH server to access another SSH server, run following command

ssh -t <jump_host> ssh <target>

Here -t is to create a pseudo-terminal, otherwise, the remote server could not display message because no tty can be used.

Proxy Jump

This is using SSH building proxy function.

ssh -o "ProxyJump <jump_host>" <target>

Proxy Command

This is to run an external command to build communication. For example, use nc command, and pass two parameters, %h is the target host, %p is the port.

ssh -o "ProxyCommand ssh <jump_host> nc %h %p" <target>

Use ssh client configuration

./ssh/cofig

Instead of using command, ProxyJump and ProxyCommand can be set in ssh client configuration file.

Host <connection_name>
  HostName <target_host>
  User <target_user>
  ProxyCommand ssh <jump_host> nc %h %p

For one server

Host target
  HostName 192.168.1.2
  User user1
  ProxyCommand ssh user2@proxy nc %h %p

For all servers

Host * !proxy
  HostName %h
  User target_user
  # ProxyCommand ssh proxy_user@proxy nc %h %p

/etc/ssh/ssh_config

This is the same as previous example, except it is a global setting.

References

4 ways to SSH & SCP via proxy (jump) server in Linux

List zfs Filesystems By Creation Date

List zfs Filesystems By Creation Date

There are many snapshots in Ubuntu system if using zfs as OS filesystem. In order to remove those old snapshots, need to list them by creation date using following command

zfs list -H -t snapshot -o name -S creation

To remove those old snapshots, for example, the oldest 18 snapshots can following command

zfs list -H -t snapshot -o name -S creation | tail -18 | xargs -n 1 zfs destroy

References

How to delete all but last [n] ZFS snapshots?

Disable Windows Defender

Disable Windows Defender

Note: These steps are not effective, the problem is still there.

Disable service

  • Run services.msc
  • Change Startup type to Stop for service Windows Defender Antivirus Service

Disable scheduler

  • Run Task Scheduler
  • Go to Microsoft\Windows\Windows Defender
  • Disable all tasks (4 tasks)

References

How to stop Antimalware Service Executable in Windows 10/11

TrueNAS k3s-server uses more than 10% CPU

TrueNAS k3s-server uses more than 10% CPU

The k3s supposed to be the lightweight k8s, but it used more than 10% when no container running. The problem was reported when TrueNAS running as VM.

This issue also caused high disk utilization, which caused whole system slow, huge IO wait.

Unset Pool

There is a zpool called ix-applications created for k3s. To stop k3s process, needs to unset pool in Apps => Settings => Unset Pool.

Result

After Unset Pool, the CPU utilization dropped from 70% to 5%.

References

k3s-server uses 10% CPU for no reason