May 11, 2017

VMware: How to merge vmdk files

Multiple vmdk file

You might end up in situation where you will find xxx-000001.vmdk , xxx-000002.vmdk and so on (these are quite big files) in your virtual machine (vm) folder, they are usually accompanied with .vmsd or Snapshot1.vmsn files

Something like this:
28/04/2017  16:31           210,055 vmware-0.log
27/04/2017  17:02           201,055 vmware-1.log
27/04/2017  12:20           205,308 vmware-2.log
11/05/2017  10:41           192,162 vmware.log
06/02/2017  10:52             4,380 vprintproxy-0.log
02/02/2017  17:06             4,380 vprintproxy-1.log
02/02/2017  16:19             4,383 vprintproxy-2.log
06/02/2017  11:44             4,380 vprintproxy.log
11/05/2017  10:41    14,624,489,472 virtual_machine-000002.vmdk
02/03/2016  16:11        43,488,006 virtual_machine-Snapshot1.vmsn
11/05/2017  10:41             8,684 virtual_machine.nvram
02/03/2016  16:09    14,404,091,904 virtual_machine.vmdk
04/03/2016  13:39               471 virtual_machine.vmsd
11/05/2017  10:41             4,121 virtual_machine.vmx
04/03/2016  13:39             3,300 virtual_machine.vmxf


Merging the vmdk 

First thing you need to do is backup the entire vm folder!

There is a tool to merge these vmdk - but it belongs to VMware Workstation, so if you only have VMware player you will have to download this tool from Vmware at this link
You will have to move this file into c:\Program Files (x86)\VMware\VMware Player\vmware-vdiskmanager.exe
otherwise it will dump with this error:
SSLLoadSharedLibrary: Failed to load library libeay32.dll:126
Win32 object usage: GDI 4, USER 1

After you will have to move into the vm folder and launch the utility as:

C:\Users\user1\Documents\Virtual Machines\vm11>"c:\Program Files (x86)\VMware\VMware Player\vmware-vdiskmanager.exe" -r "virtual_machine-000002.vmdk" -t 0 singleDiskFile.vmdk
Creating disk 'singleDiskFile.vmdk'
  Convert: 1% done.

The conversion will take some time to write the new vmdk file, when it is finished you can delete all the previous vmdk and snapshot file and rename it as the previous name.

the result will be something like this:

11/05/2017  12:52    21,381,054,464 virtual_machine-000002.vmdk
11/05/2017  12:52             8,684 virtual_machine.nvram
11/05/2017  12:47                 0 virtual_machine.vmsd
11/05/2017  12:52             4,202 virtual_machine.vmx
11/05/2017  12:47               274 virtual_machine.vmxf

I also removed the log files during the process - but that is totally optional

Apr 13, 2017

SQLite: showing a random record from a table

Random record

If many occasion developer want to get a random record(s) from a table, because they are programming a quizz, or a game - it turns out there is no native instructions for that in SQLite
but you can use this workaround:

SELECT
*, random() as R
FROM Table
ORDER BY R
LIMIT 1 ;

Why it works

It insert a random number (R) for each record and then using the order by there is going to be a selection of the smaller number (R)  - you can even change the LIMIT to get more than one record - let say 3

SELECT *, random() as R FROM Table ORDER BY R LIMIT 3 ;

Mar 30, 2017

Seamonkey: How to watch Youtube video the old fashion way

Youtube is now using html5

This is great obviously, because it means by default the internet browser doesn't need any plugin.
But let say you want to read your video the old fashion way using adobe Flash
well you actually can ... just by adding the url &nohtml5=1

for example:
https://www.youtube.com/watch?v=4h_OSURFicY&nohtml5=1

This will open the video and use adobe flash (instead of html5)
if you are not sure - just right click on the video and you should see this:


LinkWithin

Related Posts Plugin for WordPress, Blogger...