Category: linux

Unable to query DNS with DOMAIN from `dnsmasq` server

Unable to query DNS with DOMAIN from dnsmasq server

When doing nslookup, dnsmasq server could not reply the DNS with DOMAIN, but able to reply short dns name only. Following message may appear.

# nslookup www
dnsmasq server can't find NXDOMAIN


The reason is that DNS entries in dnsmasq host file (default is banner_add_hosts) has no domain name  www

In dnsmasq.conf file

Following lines are required. The expand-hosts option allows appending the domain name defined in domain line to short hostname in host file,


Escape Percent-signs(%) in crontab

Escape Percent-signs (%) in crontab

In order to input % character as command parameter in cron task, it needs to be escaped using backslash ().

man (5) crontab:

Percent-signs (%) in the command, unless escaped with backslash (\), 
will be changed into newline characters, and all data after the 
first % will be sent to the command as standard input.

Exclude files when run `rmlint`

Exclude files when run rmlint

To exclude files, using find command, then pass the parameter - to rmlint as folder name

$ find /target/dir -type f ! -name '*.nib' ! -name '*.icon' ! -name '*.plist' | rmlint [options] -

For only search specific type of file, can use following command:

find /mm -iname "*.DFF" -type f | rmlint -T df --config=sh:handler=hardlink -


How do I exclude/ignore specific file types/extensions with rmlint?

Convert Oracle Linux 7.9 to Proxmox

Convert Oracle Linux 7.9 to Proxmox

This is to describe how to convert Oracle Linux 7.9 to Proxmox.

VM creation

Following hardware options can be considered

  • BIOS: SeaBIOS (Should be able to see Grub menu)
  • Machine: Default (i440fx)
  • SCSI Controller: VirtIO SCSI (It might not be used as sata0 to be considered for disk)
  • Hard Disk (sata0): disk_image_file
  • Network Device (net0): vmxnet3=<mac_address> (This is default for VMware, can use other type too)

Convert the VMware disk to Proxmox disk and attach the disk to new VM

qm importdisk 121 oracle18c.vmdk pool240ssd --format qcow2

Attach the disk as sata0.


Select item Oracle Linux Server (0-rescue-ed95572bd80641d79f83cd91e03c0283 with Linux) 7.9 from Grub menu to boot into rescue mode.

Note: Tried other option, all got error and unable to boot


Find Kernel Package

Login as valid user, then find out the kernel to be used

rpm -q -a | grep kernel | sort

Got following list


Choose the latest one, which is also Unbreakable Enterprise Kernel

Recreate Grub kernel files

Find scripts in Kernel package

rpm -q kernel-uek-5.4.17-2102.204.4.4.el7uek.x86_64 --scripts

Following posttrans scriptlet shown

posttrans scriptlet (using /bin/sh):
/usr/sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update 5.4.17-2102.204.4.4.el7uek.x86_64 || exit $?
/usr/sbin/new-kernel-pkg --package kernel --rpmposttrans 5.4.17-2102.204.4.4.el7uek.x86_64 || exit $?

Run above commands to rebuild Grub files, then reboot the system to the menu with kernel recreated.

Note: The error Unable to open file: /etc/keys/x509_ima.der (-2) can be ignored


You can reconfigure network interface the same as VMware, this is to avoid reconfiguration of network settings

Interface Type

Check VMWare vmx file to find disk type, then set the same in Proxmox

ethernet0.virtualDev = "vmxnet3"

Mac Address

You can change Mac Address using the value in VMWare configuration

ethernet0.generatedAddress = "00:11c:22:33:44:55"

Interface Name

Find out the interface in /etc/sysconfig/network-scripts as below.


The interface name is ifcfg-ens192

Create the file /etc/udev/rules.d/70-custom-ifnames.rules with the following contents:


Then reboot the server, then check the Interface and IP address using ip a command.


Consistent network interface device naming

Preset Tmux Windows

Preset Tmux Windows

To preset Tmux windows, following script can be used. It also issues ssh command to host which has same name as window name.


WINDOWS="window_name1 window_name2 window_name3"

for each in $WINDOWS
  if ! tmux has-session -t 0:$each; then
    tmux new-window -n $each ssh $each

tmux attach


Restore tmux session after reboot
Check If Window With a Specific Name Exists. If It Does Attach to it; Otherwise Create it and Run Command?