Linux Scroll

Just another WordPress.com site

Monthly Archives: November 2010

Ubuntu Virtualbox add USB printer

By default in Virtualbox, we cannot add usb printer to host.It show grey when you want to add usb printer.
We need to add user to lp group.

System > Administration > Users and Groups > Unlock > Manage Groups > lp > 

%username% (Check)

Logout and login again.

Advertisements

SCP – Secure Copy Remote File

Copy a file to remote host:

$ scp -P sshport /path/file1 remotehostusername@remotehostIP:/tmp/file1

Example:

$ scp -P 22 /tmp/doc root@192.168.1.1:/tmp/doc

Note: Using ssh to copy doc to remote host at /tmp/doc.

Copy file on remote host to my computer:

$ scp -r -P sshport remotehostusername@remotehostIP:/tmp/file2 /tmp/file2

Example:

$ scp -r -P 22 root@192.168.1.1:/tmp/doc2 /home/%username%/Desktop/doc2

Note: Using ssh to copy doc2 from remote host to my computer at Desktop/doc2.

Manage Tape Drive in Linux

Using mt command to control magnetic tape drive operation.

Rewind tape drive:

$ mt -f /dev/st0 rewind

Backup directory /www and /home with tar command (z – compressed):

$ tar -czf /dev/st0 /www /home

Find out what block you are at with mt command:

$ mt -f /dev/st0 tell

Display list of files on tape drive:

$ tar -tzf /dev/st0

Restore /www directory:

$ cd /

$ mt -f /dev/st0 rewind
$ tar -xzf /dev/st0 www

Unload the tape:

$ mt -f /dev/st0 offline

Display tape info:

$ mt -f /dev/st0 status

Erase the tape:

$ mt -f /dev/st0 erase

Send email via telnet

In Terminal:

$ telnet mail.domain.com 25

Connected to mail.domain.com.

Escape character is '^]'.
220 emg-ax02.localdns.com Axigen ESMTP ready
ehlo mail2.example.com
mail from: yourname@domain.com
rcpt to: receipient@domain.com
data
Subject: Testing
Your test.
.
quit

Note: 25 is SMTP port, you many change to 587 if 25 is not allow.

Ubuntu update archives

Ubuntu update files keep in:

/var/cache/apt/archives

Webmin – GUI Administration For Linux

Webmin – A web-based interface for system administration for Unix.