Apple OS X: Write Protect File From Command Line

To write-protect a file on macOS (formerly OS X) from the command line, you can use the chflags command with the uchg flag. Here’s an example command to write-protect a file named “example.txt” in the current directory: sudo chflags uchg example.txt The sudo command is used to run the chflags command with administrative privileges, which … Read more

CentOS / Redhat: Setup NFS v4.0 File Server

Here is how you can set up an NFS v4.0 file server on CentOS or Red Hat: Install the NFS server software: sudo yum install nfs-utils Create a directory that you want to share as the NFS file system: sudo mkdir /path/to/nfs/shared/directory Change the ownership and permissions of the directory: sudo chown nfsnobody:nfsnobody /path/to/nfs/shared/directory sudo … Read more

KVM Virsh: Redirect FreeBSD Console To A Serial Port

To redirect the console of a FreeBSD virtual machine running on KVM to a serial port, you can use the virsh tool. The steps are as follows: Create a serial port in your virtual machine configuration file: <serial type=’pty’> <target port=’0’/> </serial> Define the virtual machine with the updated configuration file: virsh define /path/to/your/vm.xml Start … Read more

CentOS / Redhat: Install KVM Virtualization Software

To install KVM virtualization software on CentOS or Red Hat systems, you can follow these steps: Check if your system supports hardware virtualization by running the following command: grep -E –color ‘vmx|svm’ /proc/cpuinfo If the output shows the vmx or svm flags, your system supports hardware virtualization. Install the KVM and related packages by running … Read more

Linux NFS Mount: wrong fs type, bad option, bad superblock on fs2:/data3 Error And Solution

The error message “wrong fs type, bad option, bad superblock on fs2:/data3” typically indicates that the NFS share cannot be mounted because there is a problem with the file system type, mount options, or the superblock of the NFS share. Here are some possible solutions for this error: Check NFS server configuration: Make sure that … Read more

Linux KVM: Disable virbr0 NAT Interface

To disable the virbr0 NAT interface in Linux KVM, you can edit the network configuration file for the virtual network. Here are the steps to disable the virbr0 NAT interface in Linux KVM: Locate the network configuration file: The network configuration file is typically stored in the /etc/libvirt/qemu directory, and has a .xml extension. Look … Read more

In Redhat Linux, the network interface configuration files are stored in the /etc/sysconfig/network-scripts/ directory. Each network interface is represented by a separate file with a .cfg extension. The file name corresponds to the name of the network interface, for example, ifcfg-eth0 for the first Ethernet interface. Here’s an example of what a typical network interface … Read more