Friday, February 6, 2015

sharing folder host and guest


=========================
Sharing folders and files from Host to KVM guest(both linux);

install samba server on Host. (system-config-samba)


Do the configuration required using system-config-samba. (adding directory to share, user name , password). (in Host) use same system-config-samba.

// to set rw permission on all folders uncomment this in /etc/samba/smb.conf

setsebool -P samba_export_all_rw on


sudo service smb restart

=========================
Then, do mount from KVM guest.
mount -t cifs //192.168.122.1/workspace   /mnt/samba  -v

Note, here workspace should be last directory name of the past you shared.
For example in path /home/to/path/workspace.
=========================

to mount permanently using fstab add this entry :
 //192.168.122.1/workspace /home/gfuser/workspace/ cifs username=username,password=whatever_password,iocharset=utf8,sec=ntlm 0 0


then run ,
mount -a

for best practices , use this guide
https://wiki.ubuntu.com/MountWindowsSharesPermanently







dd for creating a file with specific size

dd for creating a file with specific size

trying to create file: first used random - didn't work. then tried, urandom, worked fine. for non-cryptographic uses like this :) use only urandom.

http://vinitsworld.blogspot.in/2008/10/difference-between-devrandom-and.html

renaming a file in git


want to rename a file in git ?

use
git mv