If you are used to using Qemu for doing some experiments with different distro\’s then you would also understand the problem of having to do ftp/ssh to copy the files from virtual machine to local machine. Also you have to run the machine to do that. How would you like to have a application that can help you copy the files to and from the image without having to run the VM. That\’s exactly what the guestfish does. How to do it, quick demo here:
sudo yum install guestfish
Now once installed you can run guestfish by typing guestfish. Extensive help is available with help command so I am just giving pointers here to get you started:
First add the drive image with
add-drive <image name>
Start a qemu sub-process inside guestfish
Now mount the drive using
mount /dev/sda1 /
you can list the devices using
Now you can use upload, download, ls, mkdir, cat et. al. See help for more details.
if you want to open any document with the default document handler from the bash prompt or command prompt in linux then the simplest way to do that is use \”xdg-open\”.
This can also be used in bash scripts to allow users to select which document to open without worrying about if a particular application is installed or not. Example could be where you have list of documents in the current directory (same kind or of different format.) and you want the user to select the document. In such a scenario you can take the user input for the filename and user \”xdg-open filename\” to open the file irrespective of the file type or worrying about if xpdf is installed or abiword is installed or not.
Ever happened to you that you downloaded and installed a rpm and then deleted the package? If your answer is yes, then there is a solution.
Come to the fairyland of rpmrebuild. Create the rpm from the installed files and give a new number if required.
sudo yum install rpmrebuild
Simplest use is to
rpmrebuild <package name>
but I personally like the one mentioned below:
rpmrebuild -R -v -P –pug-from-db <package name>