Top 5 Linux DVD RIP Software

/* Posted February 9th, 2011 at 8:19am [Comments: none]    */
/* Filed under Linux    */

A DVD ripper software allows you to copying the content of a DVD to a hard disk drive. You transfer video on DVDs to different formats, or make a backup of DVD content, and to convert DVD video for playback on media players, streaming, and mobile phone. A few DVD rippers software can copy protected disks so that you can make discs unrestricted and region-free.

Please note that most of the following programs can rip encrypted DVDs, as long as you have libdvdcss2 installed as described here. Please check the copyright laws for your country regarding the backup of any copyright-protected DVDs and other media.

#1: AcidRIP

AcidRip is an automated front end for MPlayer/Mencoder (ripping and encoding DVD tool using mplayer and mencoder) written in Perl, using Gtk2::Perl for a graphical interface. Makes encoding a DVD just one button click! You can install it as follows under Debian / Ubuntu Linux:
$ sudo apt-get install acidrip

Fig.01: Linux Ripping And Encoding DVD's With AcidRip Software

Fig.01: Linux Ripping And Encoding DVD’s With AcidRip Software

On the Preview tab you can choose to watch a bit of a preview of the resulting movie:
Fig.02: Preview your DVD rip

Fig.02: Preview your DVD rip

And when you are ready, click the Start button to rip DVDs.

= Download acidrip

#2: DVD::RIP

dvd::rip is a full featured DVD copy program written in Perl i.e. fron end for transcode and ffmpeg. It provides an easy to use but feature-rich Gtk+ GUI to control almost all aspects of the ripping and transcoding process. It uses the widely known video processing swissknife transcode and many other Open Source tools. dvd::rip itself is licensed under GPL / Perl Artistic License. You can install dvd::rip as follows under Debian / Ubuntu Linux:
$ sudo apt-get install dvdrip

Fig.03: dvd::rip in action

Fig.03: dvd::rip in action

You need to configure dvd::rip before you actually start a project. See the documentation for more information.

= Download dvd::rip

#3: HandBrake

HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows. It can rip from any DVD or Bluray-like source such as VIDEO_TS folder, DVD image, real DVD or bluray (unencrypted — removal of copy protection is not supported), and some .VOB, .TS and M2TS files. You can install HandBrake under Debian or Ubuntu Linux as follows:
$ sudo apt-get install handbrake-gtk

Fig.04: HandBrake in action

Fig.04: HandBrake in action

= Download HandBrake

#4: k9copy

K9copy is a KDE DVD Backup tool. It allows the copy of a DVD9 to a DVD5. It is also known as a Linux DVD shrink. It supports the following features:

  • The video stream is compressed to make the video fiton a 4.7GB recordable DVD
  • DVD Burning
  • Creation of ISO images
  • Choosing which audio and subtitle tracks are copied.
  • Title preview (video only)
  • The ability to preserve the original menus.

To install k9copy, enter:
$ sudo apt-get install k9copy

Fig.05: k9copy - Linux dvd shrink in action

Fig.05: k9copy – Linux dvd shrink in action

= Download k9copy

#5: thoggen

thoggen is a DVD backup utility (‘DVD ripper’) for Linux, based on GStreamer and Gtk+ toolkit. Thoggen is designed to be easy and straight-forward to use. It attempts to hide the complexity many other transcoding tools expose and tries to offer sensible defaults that work okay for most people most of the time. It support the following features:

  • Easy to use, with a nice graphical user interface (GUI).
  • Supports title preview, picture cropping, and picture resizing.
  • Language Selection for audio track (no subtitle support yet though).
  • Encodes into Ogg/Theora video.
  • Can encode from local directory with video DVD files.
  • Based on the GStreamer multimedia framework, which makes it fairly easy to add additional encoding formats/codecs in future.

You can install thoggen as follows:
$ sudo apt-get install thoggen

Fig.06: Thoggen in action

Fig.06: Thoggen in action

= Download thoggen

Other Tools and Back-ends

= You need to install various libraries to use the above mentioned tools such as (yum or apt-get commands will install them automatically for you):

  • libdvdcss2 – Simple foundation for reading DVDs – runtime libraries.
  • libdvdnav4 – DVD navigation library.
  • libdvdread4 – library for reading DVDs.

= mencoder – Personally, I use mencoder to rip my DVDs into .avi files as follows:

mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate="1200" -vf scale -zoom -xy 640 -oac mp3lame -lameopts br=128 -o /nas/videos/my-movies/example/track2.avi

Please note that AcidRip, is a graphical frontend for mencoder.

= VLC – Yes, VLC can rip DVDs too.

= Transcode is a suite of command line utilities for transcoding video and audio codecs, and for converting between different container formats. Transcode can decode and encode many audio and video formats. Both K9Copy and dvd::rip are a graphical frontend for transcode.

= Wine – It is an open source software for running Windows applications on other operating systems. You can use popular MS-Windows application such as DVDFab to rip encrypted DVD’s and DVD Shrink to shrink them to smaller size. I do not *recommend* and encourage this option as it goes against the FOSS philosophy. The following screenshot based on trial version of DVDFab:

Fig.07: Running DVDFab under Wine v1.2.2

Fig.07: Running DVDFab under Wine v1.2.2

See also:

Have a favorite Linux DVD ripper software or ripping tip? Let’s hear about it in the comments below.

Featured Articles:

Tags:

FAQ Updates – Feb/07/2010

/* Posted February 7th, 2011 at 8:18am [Comments: none]    */
/* Filed under Linux    */

Our FAQ section is updated in last few days with new howtos:

  1. HowTo: Upgrade Debian 5.0 (Lenny) To Debian 6.0 (Squeeze)
  2. regionset: Linux Set / Change DVD Region Code
  3. HowTo: Check Ram Size From Redhat Linux Desktop System
  4. Linux / UNIX: TZ Environment Variable
  5. Screen Command: Set Baud Rate [ Terminal Communication ]
  6. UNIX / Linux: Rsnapshot Restore Backups
  7. UNIX: Read a File Line By Line
  8. Debian Linux: Set a Serial Console
  9. Linux: Find Out My Group Name [ Group Memberships ]
  10. Howto: Call Shell Script function In echo statement
  11. Bash Infinite Loop Examples
  12. PHP: ? ? Tags Not Working in PHP 5.3.x under UNIX / Linux
  13. Linux / UNIX: Software Update Vs Upgrade – What’s the Difference?
  14. Linux: phpinfo() system’s timezone error date.timezone
  15. Explains: Linux linux-gate.so.1 Library / Dynamic Shared Object [ vdso ]
  16. Linux: rsync Copy Directories Structures Tree Only
  17. Debian Linux Configure Wireless Networking With WPA2
  18. HowTo: Upgrade Debian Lenny to Squeeze
  19. Linux: Check Network Connection Command
  20. Linux / UNIX: Kill User Session
  21. Linux exec-notify: Find Out Shell Escaping Applications [ Security Monitoring ]
  22. Linux / UNIX: Kill Unresponsive SSH Session
  23. Linux / UNIX: Speed up SSH X11 Forwarding
  24. Ubuntu: SIOCADDRT: File exists Error and Solution
  25. Mediawiki Fix Internal Server Host Names / Redirection In shared Hosting or Proxy Setup
  26. Linux / UNIX: mplayer Play mp3s From a Playlist File
  27. Linux: Block Port With IPtables
  28. nginx: Create HTTP 503 Maintenance Custom Page

FAQ Howtos RSS Feed

Get intimated about our new howtos / faqs as soon as it is released via RSS feed.

nixCraft is on Facebook!

Not our Fan yet? We suggest you become one right away! Just visit our Facebook Page. Click on the “like” button.

Featured Articles:

Tags:

HowTo: Configure Vbulletin To Use A Content Delivery Network (CDN)

/* Posted February 5th, 2011 at 8:18am [Comments: none]    */
/* Filed under Linux    */

The last time I wrote about CDN, I wrote about how to configure CDN for wordpress to speed up your wordpress blog to display content to users faster and more efficiently. However, a few regular readers like to know how to configure the Amazon CDN or other CDN network to use with Vbulletin forum software. In this quick tutorial, I will explains how to configure Vbulletin, Apache/Lighttpd webserver, Bind dns server to use a CDN to distribute your common files such as css, js, user uploaded files and lighten load on your web server.

Our Sample Forum Setup

  1. Forum URL : http://nixcraft.in/ - This is hosted on your own server using Apache, Lighttpd, or Nginx.
  2. Origin Pull URL : http://cdn-origin.nixcraft.in/ – This is hosted on your own server. You need to configure your web server, vbulletin and dns server to use this. This is called as “Origin Pull Host” which is a CDN method by which content is pulled from your web server.
  3. CDN URL : http://cdn.nixcraft.in/ – This is a cdn url hosted by your CDN provider such as Amazon. This url always point to an edge server via proprietary DNS hacks. cdn.nixcraft.in must be set as CNAME records which will point to domain names of CDN server.
  4. CDN DNS CNAME : cdn.nixcraft.in.example.com - example.com is your CDN provider. This is must be set as CNAME for cdn.nixcraft.in

Step # 1: Purchase CDN Service

As I said earlier the cost varies between CDN providers. Check CDN service providers website for more information. Next, you need to use service providers “control panel” to configure an “Origin Pull Host” for each domain. In other words configure cdn.nixcraft.in in origin pull mode. The control panel will also provide your an option to setup CDN dns CNAME. You need to use same CNAME in step # 2. Once the configuration is active and the CNAME is resolving, calls to cdn.nixcraft.in will be cached from cdn-origin.nixcraft.in.

Step # 2: Update Your DNS Server

I’m assuming that you are using BIND dns server edit your zone file and add entry as follows (you can skip this step and use your ISP’s dns hosting providers control panel to setup CNAME and origin host):

; CDN CNAME mapping for cdn.nixcraft.in
cdn                 3660       IN CNAME cdn.nixcraft.in.example.com.
; Your cdn-origin url (note nixcraft.in is also hosted on same server IP 123.1.2.3)
cdn-origin        3600       IN A 123.1.2.3

Save and close the file. Reload named:
# rndc reload tail -f /var/log/messages
To keep your configuration simple use the same web server for origin pull domain and main domain i.e. host both cdn-origin.nixcraft.in and nixcraft.in on same web server. This allows you to directly upload and map files to the CDN server.

Step # 3: Configure Origin Pull Web Server

You need to configure cdn-origin.nixcraft.in as follows:

  1. Origin pull DocumentRoot: /home/httpd/cdn-origin.nixcraft.in – All your .css, .js and uploaded files are hosted here.
  2. Server Forum DocumentRoot: /home/httpd/nixcraft.in – All your vbulletin files are hosted here.
  3. MaxAge: Set cache-lifetime headers for static files for cdn network.
  4. Etags: An ETag (entity tag) is part of HTTP, the protocol for the World Wide Web. It is a response header that may be returned by an HTTP/1.1 compliant web server and is used to determine change in content at a given URL. When a new HTTP response contains the same ETag as an older HTTP response, the client can conclude that the content is the same without further downloading.

Sample Apache Configuration

VirtualHost cdn-origin.nixcraft.in 
	ServerAdmin webmaster@nixcraft.in
	DocumentRoot /home/httpd/cdn-origin.nixcraft.in
	ServerName files.nixcraft.in
	ServerAlias file.nixcraft.in
	ErrorLog /var/logs/httpd/cdn-error_log
	CustomLog /var/logs/httpd/cdn-access_log common
 
	# Files in this directory will be cached for 1 week only.
	# After 1 week, CDN server will check if the contents has been modified or not.
	# If not modified, Apache will send 304 "Not Modified" header
	Directory "/userimages"
		Header set Cache-Control "max-age=604800, must-revalidate"
	/Directory
 
	# Disable ETag as we are on cluster Apache server
	Directory "/pdfs"
		Header unset ETag
		FileETag None
	/Directory
 
	# Do not cache
	Directory "/patches"
		Header Set Cache-Control "max-age=0, no-store"
	/Directory
/VirtualHost

Sample Lighttpd Configuration

# Configure ETags
etag.use-inode = "enable"
etag.use-mtime = "enable"
etag.use-size = "enable"
static-file.etags = "enable"
 
###### CDN FILES via WordPress Upload ##############
$HTTP["host"]  == "cdn-origin.nixcraft.in"{
        server.document-root = "/home/httpd/cdn-origin.nixcraft.in"
        accesslog.filename         = "/var/log/lighttpd/cdn.access.log"
	#  Set max age
        $HTTP["url"] =~ "^/" {
            expire.url = ( "" = "access 60 days" )
        }
}

Adjust documentroot as per your setup.

Step # 4: Create Required Directories

You need to configure files for cdn-origin.nixcraft.in:
# mkdir -p /home/httpd/cdn-origin.nixcraft.in
# cd /home/httpd/cdn-origin.nixcraft.in

Next, soft link your .css, .js, images, clientscripts files against original forum documentroot (i.e. /home/httpd/nixcraft.in/) as follows:
# ln -s ../nixcraft.in/clear.gif .
# ln -s ../nixcraft.in/clientscript/ .
# ln -s ../nixcraft.in/customavatars/ .
# ln -s ../nixcraft.in/customprofilepics/ .
# ln -s ../nixcraft.in/images/ .
# ln -s ../nixcraft.in/signaturepics/ .

Again, feel free to adjust paths according to your setup. Test your new cdn urls:
http://cdn.nixcraft.in/clientscript/vbulletin_important.css

Step # 5: Configure Vbulletin To Use a CDN Server

You need to edit your vbulletin style. Open admincp by visiting http://nixcraft.in/admincp/ Select Styles Templates Replacement Variable Manager:

Fig.01: Vbulletin Editing Styles And Templates

Fig.01: Vbulletin Editing Styles And Templates

Click on [Add New Replacement Variable] link and set it as follows:

  • Set Search for Text to href=”clientscript
  • Set Replace with Text to href=”http://cdn.nixcraft.in/clientscript

Sample outputs:

Fig.02: Vbulletin Adding Replacement Variable For CDN

Fig.02: Vbulletin Adding Replacement Variable For CDN

You need to repeat this step for images, javascript and other shared media as follows:

Avatars Pictures – Storage Type

Visit Avatars Storage Type and set them as follows to match your above CDN rules by moving all of them to file systems:

  • Avatars are currently being served from the filesystem at ./customavatars
  • Profile pictures are currently being served from the filesystem at ./customprofilepics
  • Signature pictures are currently being served from the filesystem at ./signaturepics

How Do I Test Images And Other Media Files Are Cached Or Not By CDN?

Use curl to test HTTP headers (look for Etags, max-age and Expires headers):
$ curl -I 'http://cdn.nixcraft.in/clientscript/vbulletin_important.css?v=385'
$ curl -I http://cdn.nixcraft.in/customavatars/avatarx_y.gif

Conclusion

The forum home page loading (rendering) time went from 8.5 seconds to 2.2 seconds and average thread loading time went from 14.3 seconds to 5 seconds:

Fig.03 Speed Improvements With CDN

Fig.03 Speed Improvements With CDN

See 6 tools to test web site speed for more information.

Recommend readings:

Featured Articles:

Tags:

The Story Behind The Largest Distributor Of The Linux Operating System

/* Posted February 3rd, 2011 at 8:17am [Comments: none]    */
/* Filed under Linux    */

Interesting read and I wasn’t aware of some of the facts behind the open-source entrepreneur Bob Young. From the BBC article:

Bob Young is a self-confessed contrarian with a strong desire to change the world by allowing people to share and collaborate. The approach has served him well and has helped turn the Canadian into a multi-millionaire. Bob YoungFrom the outset, his software company Red Hat bucked the trend set by the big players like Microsoft which stubbornly guarded every line of code and charged whopping fees to maintain it.


And don’t forget to check out the video which explains how Red Hat got its name.

Featured Articles:

Tags:

HowTo: Speed Up Linux Software Raid Building And Re-syncing

/* Posted February 1st, 2011 at 1:34am [Comments: 1]    */
/* Filed under Linux    */

It is no secret that I am a pretty big fan of excellent Linux Software RAID. Creating, assembling and rebuilding small array is fine. But, things started to get nasty when you try to rebuild or resync large size array. You may get frustrated when you see it is going to take 22 hours to rebuild the array. You can always increase RAID resync performance using the following technique.

Recently, I build a small NAS server running Linux for one my client with 5 x 2TB disks in RAID 6 configuration for all in one backup server for Mac OS X and Windows XP/Vista clients computers. Then whey I cat /proc/mdstat it reported that md0 is created and resync is in progress. The resync speed was around 4000K/sec and resync will complete in approximately in 22 hours. I wanted to finish this early.

/proc/sys/dev/raid/{speed_limit_max,speed_limit_min}

The /proc/sys/dev/raid/speed_limit_min is config file that reflects the current “goal” rebuild speed for times when non-rebuild activity is current on an array. The speed is in Kibibytes per second, and is a per-device rate, not a per-array rate . The default is 1000.

The /proc/sys/dev/raid/speed_limit_max is config file that reflects the current “goal” rebuild speed for times when no non-rebuild activity is current on an array. The default is 100,000.

To see current limits, enter:
# sysctl dev.raid.speed_limit_min
# sysctl dev.raid.speed_limit_max

To increase speed, enter:

 
echo value  /proc/sys/dev/raid/speed_limit_min
 

OR

 
sysctl -w dev.raid.speed_limit_min=value
 

In this example, set it to 50000 K/Sec, enter:
# echo 50000 /proc/sys/dev/raid/speed_limit_min
OR
# sysctl -w dev.raid.speed_limit_min=50000
If you want to override the defaults you could add these two lines to /etc/sysctl.conf:

dev.raid.speed_limit_min = 50000
dev.raid.speed_limit_max = 200000

Bitmap Option

Bitmaps optimize rebuild time after a crash, or after removing and re-adding a device. Turn it on by typing the following command:
# mdadm --grow --bitmap=internal /dev/md0
Once array rebuild or fully synced, disable bitmaps:
# mdadm --grow --bitmap=none /dev/md0

Result

My speed went from 4k to 51k:
cat /proc/mdstat
Sample outputs:


Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md5 : active raid1 sde2[2](S) sdd2[3](S) sdc2[4](S) sdb2[1] sda2[0]
      530048 blocks [2/2] [UU]

md0 : active raid6 sde3[4] sdd3[3] sdc3[2] sdb3[1] sda3[0]
      5855836800 blocks level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]
      [============........]  resync = 61.7% (1205475036/1951945600) finish=242.9min speed=51204K/sec

References:

  • man page md and mdadm

Featured Articles:

Tags:

List: Linux Compatible USB Wireless Adapter (WUSB)

/* Posted January 30th, 2011 at 1:34am [Comments: none]    */
/* Filed under Linux    */

A regular question from my mailbag:

I am in the process of up grading my computer. Where can I get a list of the WUSB for Linux?

Wireless USB adapters are pretty popular for desktop and laptop usage in home. It is capable of sending 480 Mbit/s at distances up to 3 meters and 110 Mbit/s at up to 10 meters. Newer N series can work at 270Mbit/s at up to 300 meters. However, 50-100 meters are acceptable ranges. Unfortunately, finding Linux compatible USB wireless adapter is a big challenge due to driver issues. Over a past few years, I’ve used and installed various USB wireless adapters and created my own small HCL for it. In this quick blog post I will list all working USB wireless adapter.

Buffalo WLI-UC-G300N

Buffalo’s Wireless-N WLI-UC-G300 compact USB 2.0 adapter is fully compatible with Linux. Currently I’m using this device with Ubuntu Linux 10.4 and it works out of box. No driver installation is required. Simply add your wireless WPA2 password and you will be hooked up to wireless network. The driver in latest version of Ubuntu kernel is broken and you need to install the driver from source code. (Driver Link for RT2870)

Asus USB-N13

Asus USB-N13 802.11n/g/b network adapter supports USB 2.0 wireless and speed up to 300Mbps Wireless data rates. I get superb connection speed upto 270Mbps and it was auto detected by Linux. (Driver Link for RT2870)

Belkin F5D8053 N Wireless USB Adapter (ver 3)

Belkin F5D8053 version 3 also works with Linux. It supports USB 2.0 wireless and speed up to 300Mbps at up to 300 meters. I’ve tested this one with Fedora Linux. (Driver Link for RT2870)

AboCom WU-5204

AboCom WU-5204 is another compact adapter which is fully compatible with Linux. It complies with IEEE 802.11n draft 3.0 and IEEE 802.11 b/g standards and works with USB 2.0/1.1. interface. This one worked and detected, however after some time it started to drop traffic for multimedia stuff. If possible avoid this one due to poor performance.

D-Link DWA-140

The D-Link RangeBooster NUSB Adapter (DWA-140) is a 802.11n compliant wireless client for your Linux desktop or notebook PC. I’ve tested this one with Fedora and Debian Linux. Like all other adapter it supports WPA and WPA2 security features. (Driver Link for RT2870)

EDIMAX EW-7718Un

EW-7718Un complies with 802.11n draft 2.0, the next generation wireless standard. With the advanced MIMO technology, it can support the data transmission rate up to 300Mbps. EW-7718Un stable wireless connection and high bandwidth enable you enjoying the network applications without any interruption with Linux based systems. (Driver Link for RT2870 #2 # 2 link)

TRENDNET TEW 664UB

TEW-664UB is 300Mbps dual band wireless N USB adapter. It is compliant with IEEE 802.11n standard and backwards compatible with IEEE 802.11g, IEEE 802.11b and IEEE 802.11a devices. It supports both WPA and WPA2 security.

SMC WUSBS-N3

The EZ Connect N 150Mbps Wireless USB2.0 Adapter (SMCWUSBS-N3) enables wireless connectivity to your desktop or notebook computer and provides improved throughput and range while maintaining full backwards compatibility with the Wireless-G (802.11g) and Wireless-B (802.11b) standards.

ZyXEL NWD-211AN and NWD-270N

ZyXEL NWD-211AN and NWD-270N both works with Linux operating systems. It complies with 802.11n (2.4GHz and 5GHz) and backwards compatible with IEEE 802.11a/b/g. It supports wireless security transmission with WPA/WPA2 and 802.1x.

Sparklan WUBR-501

Sparklan WUBR-501 use USB 2.0 interface and speed up to 300Mbps. It support WPA and WPA2 security.

AirLink101 AWLL6090

AWLL6090 Wireless 300N USB Adapter delivers speeds up to 300Mbps. This USB adapter is fully backward compatible with 802.11b/g and RoHS compliant.

ConnectGear WU260N

ConnectGear WU260N Wireless N USB Adapter 802.11n/g/b supports speed upto 300Mbps with USB 2.0 or 1.1 ports. It’s also backward compatible with the existing IEEE802.11g and 802.11b standards for existing wireless networks. Both WPA and WPA2 are supported by this device.

Notes

Most of the above devices are automatically installed. If not try updating your kernel version. I hope this post will save some time for readers while purchasing USB wireless adapter for Linux operating systems.

The list is for information and ready references only. Please do your own research before purchasing any device listed here.

See also:

Featured Articles:

Tags:

HowTo: Migrate / Move MySQL Database And Users To New Server

/* Posted January 28th, 2011 at 1:34am [Comments: none]    */
/* Filed under Linux    */

I already wrote about how to move or migrate user accounts from old Linux / UNIX server to a new server including mails and home directories. However, in reality you also need to move MySQL database which may host your blog, forum or just your data stored in MySQL database. The mysqldump command will only export the data and the table structure but it will not include a users grants and privileges. The main function of the MySQL privilege system (which is stored in mysql.user table) is to authenticate a user who connects from a given host and to associate that user with privileges on a database such as SELECT, INSERT, UPDATE, and DELETE.

Our Sample Setup

  +-----+
  | db1 | ------------------------- -+
  +-----+                             |
   old mysql server                   |
   (192.168.1.8)                      |
  +-----+                             |        ///////////////////////////////
  | db2 | ------------------------- -+------ // Internet (ISP router      //
  +-----+                             |        // with port 80 forwarding)  //
   new mysql server                   |        ///////////////////////////////
   (192.168.1.10)                     |
  +-----+                             |
  | www1| ------------------------- -+
  +-----+
    Apache web server
    (192.168.1.5)

You need to move db1 server database called blogdb and its users to db2 server.

Install MySQL On DB2

Use the apt-get or yum command to install mysql on DB2 server:
$ sudo apt-get install mysql-server mysql-client
$ sudo service mysql start
# set root password for new installation
$ mysqladmin -u root password NEWPASSWORD

OR
$ sudo yum install mysql-server mysql
$ sudo chkconfig mysql on
$ sudo service mysql start
# set root password for new installation
$ mysqladmin -u root password NEWPASSWORD

Make sure OpenSSH server is also installed on DB2.

Get Current MySQL, Usernames, Hostname, And Database Names

Type the following command at shell prompt to list username and hostname list, enter:

mysql -u root -B -N -p -e "SELECT user, host FROM user" mysql

Sample outputs:

vivek	192.168.1.5
tom	192.168.1.5
blog	192.168.1.7
root	localhost
	db1.vm.nixcraft.net.in
root	db1.vm.nixcraft.net.in

The first column is mysql username and second one is network host names. Now, type the following command to get exact details about grants and password for each user from above list:

mysql -u root -p -B -N -e"SHOW GRANTS FOR 'userName'@hostName"
mysql -u root -p -B -N -e"SHOW GRANTS FOR 'vivek'@192.168.1.5"

Sample outputs:

GRANT USAGE ON *.* TO 'vivek'@'192.168.1.5' IDENTIFIED BY PASSWORD 'somePasswordMd5'
GRANT ALL PRIVILEGES ON `blogdb`.* TO 'vivek'@'192.168.1.5'

Where,

  • vivek – MySQL login username
  • 192.168.1.5 – Another server or workstation to access this mysql server
  • somePasswordMd5 – Password stored in mysql database which is not in a clear text format
  • blogdb – Your database name

Now, you’ve all info and you can move database and users to a new server called db2 as follows using the combination of OpenSSH ssh client and mysql clients as follows:

ssh user@db2 mysql -u root -p'password' -e "create database IF NOT EXISTS blogdb;"
ssh user@db2 mysql -u root -p'password' -e "GRANT USAGE ON *.* TO 'vivek'@'192.168.1.5' IDENTIFIED BY PASSWORD 'somePasswordMd5';"
ssh user@db2 mysql -u root -p'password' -e "GRANT ALL PRIVILEGES ON `blogdb`.* TO 'vivek'@'192.168.1.5';"
mysqldump -u root -p'password' -h 'localhost' blogdb | ssh user@db2 mysql -u root -p'password' blogdb

You can test it as follows from Apache web server:
$ mysql -u vivek -h 192.168.1.10 -p blogdb -e 'show tables;'

A Note About Web Applications

Finally, you need to make changes to your application to point out to new a database server called DB2. For example, change the following from:

 
        $DB_SERVER = "db1.vm.nixcraft.net.in";
        $DB_USER = "vivek";
        $DB_PASS = "your-password";
        $DB_NAME = "blogdb";
 

To:

 
        $DB_SERVER = "db2.vm.nixcraft.net.in";
        $DB_USER = "vivek";
        $DB_PASS = "your-password";
        $DB_NAME = "blogdb";
 

A Sample Shell Script To Migrate Database

#!/bin/bash
# Copyright (c) 2005 nixCraft project http://cyberciti.biz/fb/
# This script is licensed under GNU GPL version 2.0 or above
# Author Vivek Gite vivek@nixcraft.com
# ------------------------------------------------------------
# SETME First - local mysql user/pass
_lusr="root"
_lpass="MySQLPassword"
_lhost="localhost"
 
# SETME First - remote mysql user/pass
_rusr="root"
_rpass="mySQLPassword"
_rhost="localhost"
 
# SETME First - remote mysql ssh info
# Make sure ssh keys are set
_rsshusr="vivek"
_rsshhost="db2.vm.nixcraft.net.in"
 
# sql file to hold grants and db info locally
_tmp="/tmp/output.mysql.$$.sql"
 
#### No editing below #####
 
# Input data
_db="$1"
_user="$2"
 
# Die if no input given
[ $# -eq 0 ]  { echo "Usage: $0 MySQLDatabaseName MySQLUserName"; exit 1; }
 
# Make sure you can connect to local db server
mysqladmin -u "$_lusr" -p"$_lpass" -h "$_lhost"  ping /dev/null || { echo "Error: Mysql server is not online or set correct values for _lusr, _lpass, and _lhost"; exit 2; }
 
# Make sure database exists
mysql -u "$_lusr" -p"$_lpass" -h "$_lhost" -N -B  -e'show databases;' | grep -q "^${_db}$" ||  { echo "Error: Database $_db not found."; exit 3; }
 
##### Step 1: Okay build .sql file with db and users, password info ####
echo "*** Getting info about $_db..."
echo "create database IF NOT EXISTS $_db; "  "$_tmp"
 
# Build mysql query to grab all privs and user@host combo for given db_username
mysql -u "$_lusr" -p"$_lpass" -h "$_lhost" -B -N 
-e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM user" 
mysql 
| mysql  -u "$_lusr" -p"$_lpass" -h "$_lhost" 
| grep  "$_user" 
|  sed 's/Grants for .*/#### /'  "$_tmp"
 
##### Step 2: send .sql file to remote server ####
echo "*** Creating $_db on ${rsshhost}..."
scp "$_tmp" ${_rsshusr}@${_rsshhost}:/tmp/
 
#### Step 3: Create db and load users into remote db server ####
ssh ${_rsshusr}@${_rsshhost} mysql -u "$_rusr" -p"$_rpass" -h "$_rhost"  "$_tmp"
 
#### Step 4: Send mysql database and all data ####
echo "*** Exporting $_db from $HOSTNAME to ${_rsshhost}..."
mysqldump -u "$_lusr" -p"$_lpass" -h "$_lhost" "$_db" | ssh ${_rsshusr}@${_rsshhost} mysql -u  -u "$_rusr" -p"$_rpass" -h "$_rhost" "$_db"
 
rm -f "$_tmp"
 

How Do I Use This Script?

Download the above script and edit it to set the following as per your setup:

# SETME First - local mysql DB1 admin user/password
_lusr="root"
_lpass="MySQLPassword"
_lhost="localhost"

# SETME First - remote mysql DB2 admin user/password
_rusr="root"
_rpass="mySQLPassword"
_rhost="localhost"

# Remote SSH Server (DB2 SSH Server)
# Make sure ssh keys are set
_rsshusr="vivek"
_rsshhost="db2.vm.nixcraft.net.in"

In this example, migrate a database called wiki with wikiuser username:
$ ./script.sh wiki wikiuser

Server moved – 14/July/2010

Dear User,

In the last two days nixcraft moved to the new server (details about our older setup are here). No data is lost and most of the stuff is back as usual. The new server is much more stable. However, required libraries for RSS feed and PDF file generation code are not installed. I will fixed it ASAP. If any one see any other errors or 404 errors, please send me an email at vivek@nixcraft.com. Please ignore rss feed which is currently showing all old entires in your feed. My apologies for the temporary inconvenience and flooding your rss feed and inbox. The IPv6 AAAA entries will be published later on this weekend.

Thanks for all your support!

–Vivek Gite

Featured Articles:

Tags:

The Best Open Source Graphics And Design Software

/* Posted January 26th, 2011 at 1:33am [Comments: none]    */
/* Filed under Linux    */

A few years ago Novell conducted an online public survey to determine which MS-Windows apps need to be ported on Linux desktop. Adobe Photoshop and other graphics application that user want ported to Linux. However, Linux comes with the sheer numbers of open source software projects produced by the community. You may overwhelmed by the choices available under Linux and not know where to begin.
This blog post covers Vector-based editors, Raster-based editors, Photo editing, Specialty, Desktop publishing (DTP), Web design, 3D modeling, Animation Typography and other softwares:

Even when looking at just a subset — such as graphics applications — if you are not already familiar with the options, the volume can make it hard to track down the application that fits your needs. The major categories tend to break down the same way, however — just a few major players; the large projects often catering to slightly different design goals, and a second set of smaller projects each of which has a smaller team and a more narrow focus.

Let’s examine each design field in turn. We’ll start by describing the leading program or programs in each, followed by the smaller or younger projects, and end with the special-purpose tools.

Read more: Periodic table of the open source graphics and design apps

Featured Articles:

Tags:

Top 5 Open Source Linux Server Provisioning Software

/* Posted January 24th, 2011 at 1:32am [Comments: 1]    */
/* Filed under Linux    */

Server provisioning is nothing but load the Linux or UNIX like operating systems automatically with actual operating systems, device drivers, data, and make a server ready for network operation without any user input. Typically you select a server from a pool of available servers, load the operating systems (such as RHEL, Fedora, FreeBSD, Debian), and finally customize storage, network (IP, gateway, bounding etc), drivers, applications, users etc. Using the following tools you can perform automated unattended operating system installation, configuration, set virtual machines and much more. These software can be used to install a lot (say thousands) of Linux and UNIX systems at the same time.

Kickstart

From the official Redhat guide:

Many system administrators would prefer to use an automated installation method to install Red Hat / CentOS / Fedora Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical Red Hat Linux installation. Kickstart provides a way for users to automate a Red Hat Enterprise Linux installation.

Kickstart Configurator allows you to create or modify a kickstart file using a graphical user interface, so that you do not have to remember the correct syntax of the file.

Fig.01: RHEL - Kickstart Configurator

Fig.01: RHEL – Kickstart Configurator

Fully Automatic Installation (FAI)

FAI is a non-interactive system to install, customize and manage Linux systems and software configurations on computers as well as virtual machines and chroot environments, from small networks to large-scale infrastructures and clusters. It is a tool for fully automatic installation of Debian and other Linux Distributions such as Suse, Redhat, Solaris via network, custom install cd, or into a chroot environment. Some people also use it to install Windows.

FAI Features

  1. Installs and updates Debian, Ubuntu, SuSe, RHEL, CentOS, Fedora, Mandriva, Solaris, etc
  2. Centralized deployment and configuration management
  3. Integrated disaster recovery system
  4. Easy set up of software RAID and LVM
  5. Installs XEN domains, VirtualBox and Vserve
  6. Every stage can be customized via hooks
  7. Full remote control via ssh during installation

See the official project website and wiki for more information.

Cobbler

Cobbler is a Linux provisioning server that centralizes and simplifies control of services including DHCP, TFTP, and DNS for the purpose of performing network-based operating systems installs. It can be configured for PXE, reinstallations, and virtualized guests using Xen, KVM or VMware. Again it is mainly used by Redhat and friends, but you can configure a PXE server to boot various non-RPM boot images such as Knoppix and other flavors of Debian such as Ubuntu.

There is also a lightweight built-in configuration management system, as well as support for integrating with configuration management systems like Puppet. Cobbler has a command line interface, a web interface, and also several API access options.

Fig.02: Cobbler WebUI (image credit: Fedora project)

Fig.02: Cobbler WebUI (image credit: Fedora project)

See the official Cobbler project home page and wiki for more information.

Spacewalk

From the official website:

Spacewalk is an open source (GPLv2) Linux systems management solution. It is the upstream community project from which the Red Hat Network Satellite product is derived. Spacewalk manages software content updates for Red Hat derived distributions such as Fedora, CentOS, and Scientific Linux, within your firewall. You can stage software content through different environments, managing the deployment of updates to systems and allowing you to view at which update level any given system is at across your deployment. A clean central web interface allows viewing of systems and their software update status, and initiating update actions.

Features:

  1. Inventory your systems (hardware and software information)
  2. Install and update software on your systems
  3. Collect and distribute your custom software packages into manageable groups
  4. Provision (kickstart) your systems
  5. Manage and deploy configuration files to your systems
  6. Monitor your systems
  7. Provision and start/stop/configure virtual guests
  8. Distribute content across multiple geographical sites in an efficient manner.

Fig.03: Spacewalk Server Provisioning System

Fig.03: Spacewalk Server Provisioning System

See the official project website for more information.

OpenQRM

From the official website:

openQRM is the next generation, open-source Data-center management platform. Its fully pluggable architecture focuses on automatic, rapid- and appliance-based deployment, monitoring, high-availability, cloud computing and especially on supporting and conforming multiple virtualization technologies. openQRM is a single-management console for the complete IT-infra structure and provides a well defined API which can be used to integrate third-party tools as additional plugins.

Features

  1. Complete separation of “hardware” (physical servers and virtual machines) from “software” (server-images)
    Support for different virtualization technologies
  2. Fully automatic Nagios configuration (single click) to monitor all systems and services
  3. High-availability : “N to 1″ fail-over
  4. Integrated storage management
  5. Distribution support – openQRM 4.x comes with a solid support for different linux distribution like Debian, Ubuntu, CentOS and openSuse. A single openQRM server can manage the provisioning of servers from those different linux distributions seamlessly.

Fig.04: OpenQRM Dashboard

Fig.04: OpenQRM Dashboard (image credit: OpenQRM project)

See the official project website for more information.

DIY: Provisioning Server

You can build your own server using PXE, TFTP server, and DHCP software. PXE allows you to boot up a system and have it automatically get an IP address via DHCP and start booting a kernel over the network. See the following articles for more information:

Conclusion

There are many proprietary software solutions available to automate the provisioning of servers, services and end-user devices from vendors such as BladeLogic, IBM, or HP. But open source software gives you more freedom to automate the installation of the Linux server. Some of the above software support UNIX and Windows operating systems too.

I’m wondering if you use Server Provisioning Software regularly. Drop your discussion below and share what works for you in the comments.

Featured Articles:

Tags:

Open Source Photography Software

/* Posted January 22nd, 2011 at 1:32am [Comments: none]    */
/* Filed under Linux    */

I recently brought Canon EOS 500D mid-range DSLR cameras with good promotional discounts. My photography interests date back to my school days but I did not take photography seriously until recently. Now, I’m researching for quality open source photo-software which may be available to photographers. This blog post gives a quick and dirty view of the different photo applications available for Linux operating systems:

Photography on the free software desktop has come a long way in recent years. All of the major desktop environments support camera import and provide image management and editing applications, including the all-important raw file conversion. But the desktop defaults are really geared towards casual users, optimized for point-and-shoot cameras and sharing photos online. Don’t be fooled by that, though; open source can and does offer the tools to support professional photographers and high-end enthusiasts.

Rather than drop in a long, bulleted list of applications, though, let’s take a look at what the open source alternatives are, task-by-task, to get a better feel for how the pieces fit together into a normal photographic workflow.

Read more: Photography with Open Source / Linux

Featured Articles:

Tags:

Page 3 of 71234567