Saturday, January 30, 2010

Unix notes #2

Grab flash Video from YouTube

1.
Wait for flash video to load

2.
List latest flash cache files
ls -tl /tmp |grep Flash
Output looks like this
-rw------- 1 eorlovsky eorlovsky 468171 2010-01-23 14:12 FlashwaLUEM

3.
Than just copy
cp /tmp/FlashwaLUEM /home/eorlovsky/Desktop/part2.flv

One more way to list flash cache
find /tmp -name Flash* -print |xargs -n 1

Ubuntu & SAMBA


To get access to sharing folder under Windows network
smbmount can be used
for example,

mkdir /tmp/testdir
smbmount //172.30.128.32/share /tmp/testdir/ -o user=username

username - user to login, password will be promted

To umount type,
sudo umount /tmp/testdb

Clone VBox machine


Recently I faced with task to clone my virtual machine hosted on VBox
It seems not so difficult to do.
Firstly,
clone master virtual hard drive (.vdi) file. By default it is located /homedir/.VirtualBox/HardDisks/
VBoxManage clonehd --type VDI --variant fixed /source /destination
--variant fixed for fixed size hard drives

Then,
create new virtual machine using VBox GUI. It is easy to copy/paste vm options in the GUI

If needed
add slave disks under VM configuration

Mount .VDI to ubuntu


It seems not possible to mount VirtualBox hard drive to host environment

vditool can be used, but as for me it is the trick way

Usefull comment comes from [1] "Its not RAW format, you have to convert it to RAW format, an you can mount and browse, but you have to re-convert to VBOX format to use it again, its not very safe for data integrity versus daily usage. Maybe a better option is to use Qemu+KQemu it can run on RAW format, and mount it directly, KVM support it too, and its a better technology, a nice GUI to KVM is Convirt 1.0 "

Reference
http://ubuntuforums.org/showthread.php?t=1196784

Ubuntu time sync


To make Ubuntu sync with time server - NTP (Network time protocol ) package should be installed
sudo apt-get install ntp ntpdate
This will run start ntp daemon
Setting up ntp (1:4.2.4p4+dfsg-7ubuntu5.1) ... * Starting NTP server ntpd

Nice to use NTP Pool project based on the region f.e.
ru.pool.ntp.org

To update time from CLI
sudo ntpdate ru.pool.ntp.org

References:
https://help.ubuntu.com/community/UbuntuTime

0 comments: