VirtualBox Build Essentials

When you insert the guest editions you get a warning about not being able to build the kernel

Run this first

sudo apt-get install build-essential gcc make perl dkms

Stop being prompted to unlock the ‘default’ keyring

The simplest way is to set the password for the keyring to an empty password -- you will not be prompted for a password then:

  • Open Applications -> Accessories -> Password and Encryption Keys.
  • Right-click on the "login" keyring.
  • Select "Change password"
  • Enter your old password and leave the new password blank.

Temporarily Force Ubuntu to IPV4

Refer: https://linuxconfig.org/how-to-disable-ipv6-address-on-ubuntu-20-04-lts-focal-fossa

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

The above commands will temporarily disable IPv6, meaning that the settings will not persist after reboot. To re-enable IPv6 reboot your system or execute the above commands again however reverse the logic and change 1 to 0

In case you need more permanent solution to disable IPv6 even after system reboot follow the steps below:

As an administrative user open up the /etc/default/grub file using your favourite text editor and make to following changes:

FROM:
GRUB_CMDLINE_LINUX_DEFAULT=""
TO:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

Once ready update Grub menu:

sudo update-grub

In case you need to re-enable the IPv6 network addresses simply remove the ipv6.disable=1 from the /etc/default/grub file and run the update-grub command.

Compress Ubuntu Disk Space in Parallels or VirtualBox

If you have setup your parallels as an expanding disk, which might perform a little less but our solid state drives can handles this. You can delete your snapshot and fill all of your deleted space with zeros. This allows the reclaim disk feature of parallels to work. I was able to recover about 20GB of disk space. My 65GB hard drive was taking 75GB of space due to snapshot.

Windows Tool

SDelete (Local Copy) SDelete.zip
https://technet.microsoft.com/en-us/sysinternals/bb897443 (Original Location)

sdelete.exe c: -z

Linux Tool

Then go into sudo and run the sfill command, let it run and you will get a warning about being out of space, but it will be okay.

sudo apt-get install secure-delete
sudo su -
sfill -l -l -z -v /

VirtualBox Compression

VBoxManage list hdds

VBoxManage modifymedium disk "/home/mruckman/VirtualBox VMs/Windows10/Windows10 Clone.vdi" --compact

VBoxManage modifymedium disk "/home/mruckman/VirtualBox VMs/Ubuntu 22.04/Ubuntu 22.04.vdi" --compact

VBoxManage modifymedium disk "/home/mruckman/VirtualBox VMs/Ubuntu 22.04 Docker/Ubuntu 22.04 Docker Machine.vdi" --compact

Windows

You need to open a command prompt and NOT a PowerShell terminal

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\Users\mruckman\VirtualBox VMs\Ubuntu 22.04\Ubuntu 22.04.vdi" --compact
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\Users\mruckman\VirtualBox VMs\Ubuntu 22.04 Docker\Ubuntu 22-disk001.vdi" --compact

After you're done, take a new snapshot.

You can try this method instead, it does not require any additional installation:

Refer: https://forum.parallels.com/threads/tip-how-to-compact-your-virtual-disks-when-using-linux-guests.29829/

$ dd if=/dev/zero of=deleteme bs=1M

Virtual Box is a bit different OLDER Deprecated

Refer: http://splatoperator.com/2012/07/compacting-a-vmdk-virtual-machine-disk-format-image/

Zero out the free space
Clone the VMDK
Attach new drive

$ VBoxManage clonehd $disk_name.vmdk clone.vmdk

$ /usr/local/bin/vboxmanage clonehd "/Users/mauriceruckman/VirtualBox VMs/Ubuntu-14.04-HAL-UI-35GB/Ubuntu-14.04-HAL-UI-35GB-disk1.vmdk" "/Users/mauriceruckman/VirtualBox VMs/Ubuntu-14.04-HAL-UI-35GB/Ubuntu-14.04-HAL-UI-35GB-20160812-disk1.vmdk"

Compare Two Text Files

Refer: https://stackoverflow.com/questions/746458/how-to-show-lines-in-common-reverse-diff" href="https://stackoverflow.com/questions/746458/how-to-show-lines-in-common-reverse-diff">https://stackoverflow.com/questions/746458/how-to-show-lines-in-common-reverse-diff

comm -1 -2 file1.sorted file2.sorted

where file1 and file2 are sorted and piped into *.sorted

Here's the full usage of comm:

comm [-1] [-2] [-3 ] file1 file2
-1 Suppress the output column of lines unique to file1
-2 Suppress the output column of lines unique to file2
-3 Suppress the output column of lines duplicated in file1 and file2

The comm command (short for "common") may be useful comm - compare two sorted files line by line

find lines only in file1

comm -23 file1 file2

find lines only in file2

comm -13 file1 file2

find lines common to both files

comm -12 file1 file2

The man file is actually quite readable for this.

comm -23 OLCI_K229.csv OLCI_EDOCS.csv

Split MP3 Audio and Convert M4B to MP3

Refer: https://askubuntu.com/questions/1264779/how-to-split-an-mp3-file-by-detecting-silent-parts

Use ffmpeg to convert m4b to mp3

Refer: Refer: https://superuser.com/questions/173571/how-to-convert-m4b-files-to-mp3

ffmpeg -i "file.m4b" -acodec libmp3lame -ar 22050 "file.mp3"

Install Software

sudo apt install -y mp3splt

Sample Usage:

mp3splt -s your.mp3

If it creates TOO MANY TRACKS

Mp3splt will try to automatically detect splitpoints with silence detection and will split all tracks found with default parameters.

mp3splt -s -p th=-50,nt=100 your.mp3

passing desired parameters, splitting 100 tracks (or less if too much) with the most probable silence points at a threshold of -50 dB.

In this example we are setting the minimum silence to 4.9 seconds and still

mp3splt -s -p th=-40,min=4.9,nt=100 'The Catcher in the Rye By Salinger.mp3'