Blog

Blog

2021-12-26 – Changed to cheap shoes got better performance – First time

2021-12-26 - Changed to cheap shoes got better performance - First time

After changed shoes, which is only SGD15, from Decathlon, performance is quite good compare with my old Nike, quite surprise. In fact, the distance should be also a bit longer as recorded in other days, I always jogging in same route.

Result

Just changed cheap shoes

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?