Back up CD or DVD ie disk media with DD

So you need to find the device name by typing the “mount” command.  Below you can see the device that is type iso9660 which is a give away that it is a optical media device.

$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/user/.Private on /home/bab type ecryptfs (ecryptfs_check_dev_ruid,ecryptfs_sig=8d1c115a6a1982b4,ecryptfs_fnek_sig=48a424107752079f,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)
gvfs-fuse-daemon on /home/bab/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bab)
/dev/sr0 on /media/327 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500)

/dev/sr0 is the device name of the disk drive.

So as you can see below if= the source and of= is the destination.

$ dd if=/dev/sr0 of=/home/user/fileName.iso
54520+0 records in
54520+0 records out
27914240 bytes (28 MB) copied, 11.2879 s, 2.5 MB/s

Comments

Easily relay E-Mail through GMail.com on Linux

Today I will show you the easiest way to relay E-Mail from a Linux server through GMail.  There are several reasons why you would want to do this set up.  One is if you server is running at home, because most mail servers that act as realy’s will block your home IP, because home black listed in The Spamhaus Project and other black lists.  GMail is able to allow you sending mail because you are authenicationg with their server before they allow you to relay any mail.  I will also include some helpfull instructions for CentOS users.

 

So first step is installing ssmtp.

If you are running CentOS you will need to add the EPEL repositories, since SSMTP is not currently in the base package repository.

To install EPEL

# rpm -Uvh http://syslogserver.googlecode.com/files/epel-release-5-3.noarch.rpm
# yum -y install ssmtp

Then we want to install SSMTP

#yum install ssmtp
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* Webmin: download.webmin.com
* base: mirror.linux.duke.edu
* epel: mirror.symnds.com
* extras: mirror.metrocast.net
* updates: mirror.metrocast.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package ssmtp.i386 0:2.61-15.el5 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================
Package                     Arch                       Version                              Repository                  Size
==============================================================================================================================
Installing:
ssmtp                       i386                       2.61-15.el5                          epel                        52 k

Transaction Summary
==============================================================================================================================
Install       1 Package(s)

Total download size: 52 k
Installed size: 88 k
Is this ok [y/N]: y
Downloading Packages:
ssmtp-2.61-15.el5.i386.rpm                                                                             |  52 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ssmtp-2.61-15.el5.i386                                                                                     1/1

Installed:
ssmtp.i386 0:2.61-15.el5

Complete!
root@pbx:~ $

Now that SSMTP is install it is time to configure it.

 

# vi /etc/ssmtp/ssmtp.conf
AuthUser=username@gmail.com
AuthPass=GMail_password
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

Modify the AuthUser and AuthPass to match your account information.  The rest of the information can be kept the same.

Now make sure you do not have any other MTA running such as Postfix or Sendmail.

 

Now move the snedmail binary out of the way and link in the ssmtp binary so that it is used to send mail.

# mv /usr/sbin/sendmail /usr/sbin/no_runsendmail
# ln -s /usr/sbin/ssmtp /usr/sbin/sendmail

Now you can test it with mailx

$ mailx user@domain.com
Subject: Test message
body of test message
.
Cc:
bab@three:~$

Now you should of received a new E-Mail.

 

Comments

Which RPM package does a file belong to?

This trick is for systems such as Red Hat and Cent OS that use the RPM package management system.

So you have a file on your system but you want to figure out which package it belongs to.  The best way that I found to do this is the fowling

That command shows up what the name of the RPM is that is associated with the file /usr/libexec/fprintd

[user@server~]$ rpm -qf  /usr/libexec/fprintd
fprintd-0.1-19.git04fd09cfa.el6.x86_64

 

Now we can do a search to find the description of the package fprintd-pam.x86_64

[user@server~]$ yum search fprintd
Loaded plugins: refresh-packagekit, rhnplugin
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
========================================================================================== N/S Matched: fprintd ===========================================================================================
fprintd.x86_64 : D-Bus service for Fingerprint reader access
: PAM module for fingerprint authentication
Name and summary matches only, use “search all” for everything.

Comments

« Previous entries Next Page » Next Page »