Thursday, September 30, 2010

Ubuntu: How to backup a (copy protected) DVD to an ISO image

This is very helpfull to backup you cd and dvd into iso images:

dd if=/dev/dvd of=dvd.iso # for dvd

Saturday, July 17, 2010

How to convert an FLV file to MPG (DVD-ready format)

WinFF is a frontend for the all-mighty ffmpeg, it saves you all the command-line hassle. 

 



UBUNTU: How to convert an MPG file to a DVD movie ISO

Here's how to convert an MPG file to a DVD movie ISO ready for burning:

1- Create the DVD file structure

austin@austin-netbook:~/Videos$ dvdauthor -o dvd -t home.mpg.tovid_encoded.mpg
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt magick iconv freetype
Send bugs to

INFO: dvdauthor creating VTS
STAT: Picking VTS 01

STAT: Processing home.mpg.tovid_encoded.mpg...
STAT: VOBU 13952 at 3125MB, 1 PGCS
INFO: Video pts = 0.500 .. 5598.225
INFO: Audio[0] pts = 0.500 .. 5598.228
STAT: VOBU 13953 at 3125MB, 1 PGCS
INFO: Generating VTS with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 16:9
INFO: Resolution: 720x480
INFO: Audio ch 0 format: ac3/2ch, 48khz drc

STAT: fixed 13953 VOBUS                       


2- Close the DVD table of contents

austin@austin-netbook:~/Videos$ dvdauthor -o dvd -T
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt magick iconv freetype
Send bugs to

INFO: dvdauthor creating table of contents
INFO: Scanning dvd/VIDEO_TS/VTS_01_0.IFO


3- Create the ISO image

austin@austin-netbook:~/Videos$ mkisofs -dvd-video -o dvd.iso dvd/
I: -input-charset not specified, using utf-8 (detected in locale settings)
  0.31% done, estimate finish Sat Jul 17 15:12:49 2010
  0.62% done, estimate finish Sat Jul 17 15:10:10 2010
  0.94% done, estimate finish Sat Jul 17 15:09:16 2010
  1.25% done, estimate finish Sat Jul 17 15:10:10 2010
  1.56% done, estimate finish Sat Jul 17 15:09:38 2010
  1.87% done, estimate finish Sat Jul 17 15:09:16 2010
....
98.69% done, estimate finish Sat Jul 17 15:10:54 2010
 99.01% done, estimate finish Sat Jul 17 15:10:54 2010
 99.32% done, estimate finish Sat Jul 17 15:10:53 2010
 99.63% done, estimate finish Sat Jul 17 15:10:52 2010
 99.94% done, estimate finish Sat Jul 17 15:10:53 2010
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 4096
Path table size(bytes): 42
Max brk space used 1a000
1600895 extents written (3126 MB)

That's it. You're ready to burn this image using brasero.

Sunday, June 6, 2010

Ubuntu: Enable Ctrl-Alt-Backspace to restart the X server

By default, this key combination comes disabled. Here's an excerpt from ubuntugeek on how to enable it:
Since Ubuntu 9.04, the Ctrl-Alt-Backspace key combination to force a restart of X is now disabled by default, to eliminate the problem of accidentally triggering the key combination. In addition, the Ctrl-Alt-Backspace option is now configured as an X keymap (XKB) option, replacing the X server “DontZap” option and allowing per-user configuration of this setting.
As a result, enabling or disabling the Ctrl+Alt+Backspace shortcut can now be done easily from the desktop.
Enabling Ctrl-Alt-Backspace for Ubuntu 10.04
* Select “System”->”Preferences”->”Keyboard”
* Select the “Layouts” tab and click on the “Layout Options” button.
* Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

Saturday, June 5, 2010

Ubuntu: time command

The time command comes very useful for long running scripts. It lets you know among other thigs, how long a particular command takes to run.

# sudo time updatedb

0.27user 1.00system 0:40.50elapsed 3%CPU (0avgtext+0avgdata 4256maxresident)k
119752inputs+11560outputs (1major+367minor)pagefaults 0swaps

The command output shows you:
user avgerage load
system average load
command elapsed time
CPU average use
memory average use
I/O inputs & outputs
memory page faults

Ubuntu: checking for bad blocks on a hard drive

I have an old 80Gb disk I recovered from an old notebook, and it's been giving me read inconsistencies on some files, probably because of bad sectors. Since the disk it's mounted on a crappy USB craddle, it's not passing any SMART data. So I did this the old way.

# sudo time e2fsck -v -cc /dev/sdc1

e2fsck 1.41.11 (14-Mar-2010)
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern:   0.26% done, 1:42 elapsed

Wednesday, June 2, 2010

Ubuntu Lucid: VMWare player hangs on notebook

VMWare player was constantly hanging after about 5 minutes of running on the Ubuntu host. I found this problem is related to CPU frequency scaling (Intel Speedstep on my Lenovo T60).
This is easily solved by installing the CPU frequency scaling applet on Ubuntu, then click on it and select a fixed CPU frequency while running VMWare. I recommend switching it back to on demand when you're done to save power.