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"

Google Chrome Recorder Tutorial – run Puppeteer tests from CLI

Refer: https://www.youtube.com/watch?v=DrUZmvS10Os

Use DistroBox to Install Locally

Refer: https://postsrc.com/code-snippets/how-to-install-latest-stable-chrome-version-in-ubuntu-puppeteer

Step 1: Download Setup with cURL

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

Step 2: Install Required Ubuntu Dependency

sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev libxshmfence-dev

Step 3: Install Puppeteer

sudo npm install --global --unsafe-perm puppeteer

Step 4: Run the file

node file-to-run.js


Older Instructions

sudo apt-get install -y nodejs
sudo apt-get install -y npm
npm i puppeteer

sudo apt-get install -y nodejs
sudo apt-get install -y npm

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'