UBUNTU disk size increase

To increase disk size, first we need to see disk status;

df -h

If it’s a VM, make sure VM has allocated enough space before performing next actions.

Here’s the list of steps for a simple scenario where you have two partitions, /dev/sda1 is an ext4 partition the OS is booted from and /dev/sdb2 is swap. For this exercise we want to remove the swap partition an extend /dev/sda1 to the whole disk.

  1. As always, make sure you have a backup of your data – since we’re going to modify the partition table there’s a chance to lose all your data if you make a typo, for example.
  2. Run sudo fdisk /dev/sda
    • use p to list the partitions. Make note of the start cylinder of /dev/sda1
    • use d to delete first the swap partition (2) and then the /dev/sda1 partition. This is very scary but is actually harmless as the data is not written to the disk until you write the changes to the disk.
    • use n to create a new primary partition. Make sure its start cylinder is exactly the same as the old /dev/sda1 used to have. For the end cylinder agree with the default choice, which is to make the partition to span the whole disk.
    • use a to toggle the bootable flag on the new /dev/sda1
    • review your changes, make a deep breath and use w to write the new partition table to disk. You’ll get a message telling that the kernel couldn’t re-read the partition table because the device is busy, but that’s ok.
  3. Reboot with sudo reboot. When the system boots, you’ll have a smaller filesystem living inside a larger partition.
  4. The next magic command is resize2fs. Run sudo resize2fs /dev/sda1 – this form will default to making the filesystem to take all available space on the partition.

That’s it, we’ve just resized a partition on which Ubuntu is installed, without booting from an external drive.

https://askubuntu.com/questions/116351/increase-partition-size-on-which-ubuntu-is-installed

JavaScript Promises

“I Promise a Result!”

“Producing code” is code that can take some time

“Consuming code” is code that must wait for the result

A Promise is an Object that links Producing code and Consuming code

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

https://www.geeksforgeeks.org/promise-vs-callback-in-javascript/

https://www.w3schools.com/js/js_promise.asp

How to Convert OBS MKV to MP4 Efficiently on Windows?

There are two ways.

1> Activate Automatically remux to MP4 setting

Step 1. Open OBS and tap on File. Find the Settings and head to Advanced in the pop-up Settings window.
Step 2. Move to the Recording section and check the “Automatically remux to MP4” box.
Step 3. Hit OK to save the changes, and the auto MKV to MP4 is activated now!

2> Manually remux OBS MKV to MP4

Step 1. Run OBS and click File on the top menu bar, then select the Remux Recordings option.
Step 2. Add the MKV recording to the interface by clicking the three-dotted button under the OBS Recording section.
Step 3. Click the three-dotted button under the Target File to select an output path and rename the recording.
Step 4. Press Remux to start the process.

Reference

https://www.videoconverterfactory.com/tips/obs-mkv-to-mp4.html

Knockout fromJS simple example

Define a view model;

var mappedViewmodel = ko.mapping.fromJS({
            name: 'Shahzad Khan',
            age: 55
        });
        ko.applyBindings(mappedViewmodel, document.getElementById("simpleData"));

Display on page;

<div class="col-sm-6">
    <h3 class="text-left">Knockout fromJS simple example</h3>
        <div id="simpleData">
            <p>name: <label data-bind="text: name" /></p>
            <p>age: <label data-bind="text: age" /></p>
        </div>
</div>

Another good tutorial is here

https://bsscommerce.com/confluence/knockout-js/

Read more here