Canada  united states of america usa  linkedinfacebook   Call Us Today: 866.646.6461

Knowledge Base

Q. When setting a hostname in Ubuntu 18 (using traditional methods: /etc/hostname and hostnamectl), it reverts back after reboot.

A.The setting is being reset by the service: cloud-init. This service has to be either disabled or a value set to bypass the hostname reset:

To bypass:

Edit /etc/cloud/cloud.cfg and set the following to true:

Problem: When trying to access the samba share from a Windows 2019 server or Windows 11/Windows 10 system, you get the "Wrong Password error". Command line gives a more specific error, with a code:

System error 86 - The specified network password is not correct.


Add the following option into the Samba config file (/etc/samba/smb.conf):

ntlm auth = true

This should stop the wrong password prompts and allow the Windows system to access Samba.

Steps to convert a physical disk to a virtual one on a linux system:

Install qemu-utils:

apt-get install qemu-utils

Assuming the physical disk is plugged in and it is /dev/sda, the command is as following:

qemu-img convert -O vdi /dev/sda /full/path/output.vdi

The output.vdi can then be attached as a drive to VirtualBox

journald is systemd's logging service. It is a utility for querying and displaying logs from journald. The logs for this service are stored in /var/log/journal/, which can accumulate quickly. If you have a system that you need to clean up quickly, getting rid of old journals is one way. There are 2 ways to do it: 

By limiting the size of the journal:

journalctl --vacuum-size=200M

Or going by the number of days:

journalctl --vacuum-time=5d

Under normal circumstances, you should not have to touch these directories, as they rotate and space is freed on it's own.

In order to setup the Tomato Firmware router as an access point, the following steps have to be completed. This is a setup for a home environment. If you are setting this up for a workplace, the IP address range should be something other than (as it is too common). Same goes for the Subnet, it should be something other than, if you need more than 254 IPs.

Changing the domain name and hostname in Zentyal server (LDAP) will erase all users and user info (for email) once the Samba has been provisioned. Neverthless, the change can be done by going to System > General.

linux icon 19With the bigger disks that are no longer supported by MBR there's a constant need to convert to GPT.

We have done this using a live disk, however, it is always important to create system backups. The disk was 6TB, with 2 smaller live partitions. Without converting to GPT we could not take advantage of the entire disk capacity. Assuming that the disk is /dev/sdb (the first 2 partitions are /dev/sdb1 and /dev/sdb2). Below instructions are not for a bootable disk, rather a secondary partition.

linux icon 19On occasion you may get a nasty error like this (BadCRC generally means bad sectors):

[4530467.649165] ata2.00: exception Emask 0x10 SAct 0x60000000 SErr 0x280100 action 0x6 frozen
[4530467.649608] ata2.00: irq_stat 0x08000000, interface fatal error
[4530467.650043] ata2: SError: { UnrecovData 10B8B BadCRC }

But the problem is mapping the drive ata2 to an actual disk drive device. This can be achieved by running this command:

linux icon 19This is how you can find out which IP is assigned to a computer using dnsmasq. Unless you've specified a different log for dnsmasq, the output will go into syslog (/var/log/syslog).

A quick way to isolate the requests, is by running this command:

cat /var/log/syslog | grep "DHCPACK"

This will produce a list of IPs assigned, with a MAC address and hostnames:

linux iconThis is a nice little command to search and replace one type of content with another. It recursively parses through directories and files.

Be very careful when running this command, because it can do a lot of damage

Below is an example of replacing all "http" with "https" inside a directory /var/www:

postfix-emailSometimes we have emails going to a particular address, which cannot be stopped. There are many reasons, but most common is an invalid address, which pollutes the mail queue with invalid entries. The simplest way to solve this is by adding a DISCARD directive for postfix. 

If you don't have it already, add this line in

header_checks = regexp:/etc/postfix/header_checks

Let's say you've gotten a bigger disk (or just resized a VM partition) and now would like to use the extra space. Since for this example we are using LVM, the resizing has to be done using the following steps:

Assuming you want to use all of the free space, let's see what we got: 50Gb before resize

FFmpegThere are many tools, including free ones that allow for video conversion, however, many of them use GUIs and don't allow for automation of tasks. FFmpeg is a command line based tools which allows to do very neat video manipulations.

We would like to share this small script, which our IT specialists have used for one of our video conversion projects. It parses a directory, finds all flv (Flash video) files and converts them to mp4. This script can be added to a cronjob to run on a scheduled basis. Converted videos can be moved elsewhere upon completion. 

As mentioned, we've used ffmpeg to accomplish this task, running under Ubuntu 14.04. FFmpeg doesn't come with Ubuntu 14.04 and a package repository needs to be added manually first. 

ubuntu10The network configuration has changed in Ubuntu 18 from all the previous versions. The new version uses Netplan and it is somewhat harder if you don't know yaml. The discussion for pros and cons of this move by Ubuntu can be infinite (why change what's working; this is a tool, I don't want to learn the new ways, etc.), but this is a quick tutorial for quickly changing the IP address. (There's more information available on Netplan)

The network configuration files are located in /etc/netplan. Configuration file can be opened as below:

vim /etc/netplan/50-cloud-init.yaml

With comments removed, this is the configuration data for a simple DHCP setup:

Last updated Jun 4, 2024