Search This Blog

Thursday, November 28, 2013

Force 'rm' to use Trash instead of removing files completely

This one's great.
Just realized that Linux system, by default, does not move data to Trash/Bin folders. It's the Desktop Environment that does so.
So when you 'rm -rf file', it does not send the files to Trash. If you have deleted some important files by mistake or you want to recover some files which had been accidentally removed using 'rm', you could be in trouble.

Here is what you can do to avoid such situations:
Replace 'rm' with a simple bash script which will move the deleted files to .Trash folder:

Note: Shamelessly copied as is from the forum link in the references below.

1. Backup original 'rm' command.

user@ubuntu:~$ sudo mv /usr/bin/rm /usr/bin/rm.bak


2. Edit /usr/bin/rm in your favorite editor and put this in:

#!/bin/bash

mkdir ~/.Trash &> /dev/null

while [ ! -z "$1" ]; do
    mv "$1" ~/.Trash/
    shift
done


..............Done!!!

Reference(s):
http://www.linuxforums.org/forum/newbie/69673-not-possible-recover-files-deleted-using-rm.html#post364949

Sunday, November 24, 2013

VMware Player missing Virtual Network Manager

This should work with VMware Player 6.0.1.

VMware no longer provides Virtual Network Editor with VMware player from version 5.0 onwards.
And apart from only vmnetcfg.exe, one more file is needed, vmnetcfglib.dll for VMware Player 6.0.1.
Here we go:

  1. Download VMware Workstation X (10 in my case at the time of writing). Do not install.
  2. Extract files from command prompt from the downloaded location:
    C:\Users\user\Downloads\> VMware-workstation-full-10.0.1-1379776.exe /e vmware_extract\
    vmware_extract is the name of directory in which files will be extracted to.
  3. Go to vmware_extract folder, and open core.cab using any extracting software (Winzip, Winrar, 7zip or even Windows default will open it if you double click on it).
  4. Copy vmnetcfg.exe and _vmnetcfglib.dll to VMware Player's installation folder which is "C:\Program Files (x86)\VMware\VMware Player" in my case.
  5. Rename _vmnetcfglib.dll to vmnetcfglib.dll (Remove beginning underscore '_' character).
  6. Open vmnetcfg.exe. :-)


..............Done!!!


Reference(s):
https://communities.vmware.com/message/2305040
http://alexduan.com/2012/10/15/vmware-player-5-0-network-editor/