Wednesday, August 29, 2012

Using rsync to Mirror Directories

The rsync utility can be used to mirror a directory locally or over a network. As the name implies, rsync synchronizes two directories. Key benefits of the utility include:
  • After the first copy, only differences in files are copied, not the entire file. This saves time and bandwidth.
  • rsync works with ssh so it can copy files securely over a network.
Command Basics and the slash

To copy a directory from one directory to another, they command line would be:
rsync -options --otherOptions sourceDir targetDir

Example 1: rsync -vaz ~/bk/ ~/test

This example copies the contents of the ~/bk directory to the test test directory.

Example 2: rsync -vaz ~/bk ~/test

This example creates a bk directory under the ~/test directory and recursively copies the contents of the ~/bk into this new directory. This is slighly different from the first example.

Command Line Options

A few command line options are listed in the previous example. Each of these options is described below.
Key rsync Options
Option Description
-v Turn on verbose mode
-a This turns on archive mode. Bascially this causes rsync to recurse the directory copying all the files and directories and perserving things like case, permissions, and ownership on the target. (Note: Ownership may not be preserved if you are not logged in as the root user.)
-z Turns on compression during the transfer. This option compresses the data as it is copied over the network.
 
Copying over ssh

To use ssh to copy the files over the network, just add the --rsh option to the command line. Simply specify the ssh command line as shown in the example. Also, to specify another machine as a target, precede the directory target with a host name and a colon.

Example 3: rsync -vaz --rsh="ssh -l username" ~/bk targetHost:~/test
After typing the command line, you will be prompted for your password. After entering the password, the command executes and your files are copied. You can also set the ssh command using the RSYNC_RSH environment variable. You can also avoid entering the ssh password if you use ssh keys.
 
The --exclude Option

This option allows you to exclude certain files and directories from the copy process. You can exclude by specific names or by using wildcards.
Example 4: rsync -vaz --exclude=log/ --exclude=*.xml ~/bk targetHost:~/test
In this example, the log directory is excluded from the copy as well as any file with a .xml extension.

The --delete Option

This option deletes any files that exist in your target directories but that do not exist in the source directory struction. Using this option truly keeps your files synchronized. However, use this option with caution. It can delete a lot of stuff on the target machine if you aren't careful.

Tuesday, August 28, 2012

Centos 6/RHEL install Deluge Bittorrent client from repo

Deluge is a full-featured cross platform  BitTorrent client created in Python. It makes use of libtorrent and features multiple user-interfaces including: GTK+, web and console

Deluge features a rich plugin collection providing much of its  functionality and is made freely available at

http://deluge-torrent.org/ although compiling from source is probably not the easiest way for the average user to obtain it.

It will work with multiple Desktops including, but not restricted to, GNOME, KDE, XFCE, FLUXBOX and others.

It has a large array of features as below

Core/UI split allowing Deluge to run as a daemon
Connect remotely to the Deluge daemon
Web UI
Console UI
GTK+ UI
BitTorrent Protocol Encryption
Mainline DHT
Local Peer Discovery (aka LSD)
FAST protocol extension
μTorrent Peer Exchange
UPnP and NAT-PMP
Proxy support
Web seed
Private Torrents
Global and per-torrent speed limits
Configurable bandwidth scheduler
Password protection
RSS (via Plugin)
Other  libtorrent feature

It has quite a number of dependendies, making it not such a great candidate for a quick compile and install from source, although you are welcome to try if you have a lot of spare time.

Fortunately, the guys at nux-dextop have seen fit to compile a nicely working rpm for Centos 6/RHEL,and this is how I'd recommend installing Deluge.

To obtain the repo first install wget if not installed.

$sudo yum -y install wget                           

$wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-1.el6.nux.noarch.rpm

or

$wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm

for the repo pack       

$sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm

to install it.

$sudo vi /etc/yum.repos.d/nux-dextop.repo   

set 'enabled' to '0'

$sudo yum -y --enablerepo=nux-dextop install deluge

After installing a few python packages you are set to go  

To run it just type

$deluge

Autostart

To have it autostart when rebooting (in Fluxbox)

$sudo vi /etc/X11/xinit/xinitrc             add the line

startfluxbox                                save it, then

$vi /home//.fluxbox/startup      add the line

/usr/bin/deluge &                        (with ampersand)

Just before the 'exec fluxbox' line         

If you check 'start in tray' in preferences it will autostart

already in your tray.

Other desktop users can check here

Set it up to open torrent files by default in your browser settings. Typically, when downloading a file in Firefox, just select the 'Open with Deluge' option which should appear. If you do download the torrent file then right click on it and do the same.

Go into preferences where you can set up port forwarding and adjust many other settings to ensure optimum performance of the program.

So this is the simple way to obtain Deluge thanks to the nux-dextop guys.

Monday, August 27, 2012

How to Configure RPMforge Repository on CentOS 6.3

RPMforge repository is a collaboration of Dag, Dries, and other packagers. The default RPMforge repository does not replace any CentOS base packages. This post covers the steps to configure RPMforge repository on linux CentOS 6.3. This steps has been tested on CentOS 6.3 and should be working on Redhat linux Enterprise 6.
1. Download the rpmforge-release package and DAG’s GPG key :
[root@centos63 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
[root@centos63 ~]# wget http://apt.sw.be/RPM-GPG-KEY.dag.txt
2. Install DAG’s GPG key :
[root@centos63 ~]# rpm --import RPM-GPG-KEY.dag.txt
3. Verify the rpmforge-release package that you have downloaded :
[root@centos63 ~]# rpm -K rpmforge-release-0.5.2-2.el6.rf.i686.rpm
rpmforge-release-0.5.2-2.el6.rf.i686.rpm: (sha1) dsa sha1 md5 gpg OK
4. If ok, proceed to install the rpmforge-release package using this command :
[root@centos63 ~]# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]
5. Proceed to configure RPMforge repository. Open the RPMforge configuration file and insert “priority=3″ after “enabled = 1″ in the [rpmforge] section as below :
[root@centos63 ~]# vi /etc/yum.repos.d/rpmforge.repo
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
priority = 3
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
 
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
 
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/testing
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
6. Check the updated repository list in /etc/yum.repos.d using the following command :
[root@centos63 ~]# yum repolist
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirrors.hostemo.com
 * extras: mirrors.hostemo.com
 * rpmforge: mirror.oscc.org.my
 * updates: mirrors.hostemo.com
repo id                                    repo name                                          status
CentOS6.3-Repository                       DVD-CentOS6.3 repository                           4,776
base                                       CentOS-6 - Base                                    4,776
extras                                     CentOS-6 - Extras                                      4
rpmforge                                   RHEL 6 - RPMforge.net - dag                        4,448
updates                                    CentOS-6 - Updates                                   202
repolist: 14,206
7. You can start using RPMforge Repository on your RHEL 6 or CentOS 6 linux server :
[root@centos63 ~]# yum install clamd -y

How to Configure EPEL Repository on CentOS 6.3

This post will covers on how to install and configure the Extra Packages for Enterprise Linux (EPEL) repository on CentOS 6.3. EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server. To install the repository, you can follow this steps :


1. First, we download and import the GPG keys for EPEL software packages:
# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
# rpm --import RPM-GPG-KEY-EPEL-6
# rm -f RPM-GPG-KEY-EPEL-6

2. Download EPEL repository for 32-bit CentOS :

# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

3. Install EPEL repository on 32-bit CentOS :
# rpm -ivh epel-release-6-7.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

Saturday, August 25, 2012

Renumber ethernet interface on CentOS Linux to eth0

When changing network cards (either physical or virtual) it’s often the case that the new card gets a higher interface number. For example, your old card was identified as ‘eth0′ and the new card gets identified as ‘eth1′. This may cause problems in your scripts (networking scripts, iptables settings, network traffic counters, etc.). But it’s also not as clean as you would want (you’re obsessive about these things, admit it!). Fortunately, we can easily renumber the ethernet interfaces!

http://www.syn-ack.org/centos-linux/renumber-ethernet-interface-eth0/

CentOS 6.3 VMware ESXi 5 network interface problem

In case that you have network problems with combination of CentOS 6.3 and VMWare ESXi 5, please look on this excellent explanation how to fix it....

http://www.syn-ack.org/vmware/centos-6-3-vmware-esxi-5-network-interface-problem/

Wednesday, August 22, 2012

Fedora 12 Linux on HP dv4-2155dx with qualcomm gobi2000 03f0:241d 03f0:251d

Good post how to enable gobi2000 based WWAN cards:

http://bisque.linuxsoup.com/?q=node/57

Will try on my un2420 EV-DO-HSDPA and with CentOS 6.3 ...

Keep you posted ...

Thursday, August 9, 2012

Cloning individual virtual machine disks via the VMware ESX host terminal

Purpose

This article provides instructions on how to clone individual virtual machine disks via a VMware ESX host's terminal.

Text can be found HERE


Tuesday, August 7, 2012

Windows Server Backup Step-by-Step Guide for Windows Server 2008

The Windows Server Backup feature provides a basic backup and recovery solution for computers running the Windows Server® 2008 operating system. Windows Server Backup introduces new backup and recovery technology and replaces the previous Windows Backup (Ntbackup.exe) feature that was available with earlier versions of the Windows operating system.
 
What is Windows Server Backup?
 
The Windows Server Backup feature in Windows Server 2008 consists of a Microsoft Management Console (MMC) snap-in and command-line tools that provide a complete solution for your day-to-day backup and recovery needs. You can use four wizards to guide you through running backups and recoveries. You can use Windows Server Backup to back up a full server (all volumes), selected volumes, or the system state. You can recover volumes, folders, files, certain applications, and the system state. And, in case of disasters like hard disk failures, you can perform a system recovery, which will restore your complete system onto the new hard disk, by using a full server backup and the Windows Recovery Environment.
You can use Windows Server Backup to create and manage backups for the local computer or a remote computer. You can also schedule backups to run automatically and you can perform one-time backups to augment the scheduled backups.

Original text can be found on technet.microsoft.com

Backup Basics in Windows Server 2008 R2

A free tool from Microsoft can make backing up data in Windows Server 2008 R2 efficient and almost hassle-free. Here's how to use it effectively.

Back in the day, Microsoft's free backup tool was the now venerable NTBackup. However, that utility has gone to the great recycle bin in the sky.
Windows Server 2008 offers a new set of backup tools, and I want to show you how easy it is to use them with the new Windows Server 2008 R2. Be aware that the new backup feature can't manage backups created with NTBackup.

Original text can be found on location:

http://redmondmag.com/articles/2010/04/01/backup-basics-in-windows-server-2008-r2.aspx

How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...