Friday, November 25, 2011

Tuesday, March 1, 2011

How to run process in background then logout

In linux, if you want to run a process in the background without stopping when you logout then you can do it with this command:

# nohup [program_name] [arguments] &

Don't forget the ampersand.

Sunday, February 20, 2011

How to truncate video using command line

Here are two method, using ffmpeg and mencoder. Choose which one you want:

$ ffmpeg -vcodec copy -acodec copy -i [inputfile] -ss [start] -t [duration] [outputfile]

or

$ mencoder -ss [start] -endpos [duration] -oac copy -ovc copy [inputfile] -o [outputfile]

Friday, February 11, 2011

How to unix touch recursively

Since unix touch utility cannot operate recursively, so if you want to unix touch recursively:

# find . -exec touch {} \;

Wednesday, February 9, 2011

How to setup unoconv in Ubuntu Lucid

If you want to convert between any document format that OpenOffice understands especially for non-interactive conversion of documents.

You will need openoffice.org:
# apt-get install openoffice.org
# apt-get install openoffice.org-writer2latex

Install unoconv:
# apt-get install unoconv

Running unoconv:
# unoconv --listener &

Test:
# unoconv -f pdf myfile.ppt

Done.

Monday, February 7, 2011

How to set up tesseract-ocr from Google

You need the following library (Ubuntu):

# apt-get install libpng12-dev
# apt-get install libjpeg62-dev
# apt-get install libtiff4-dev
# apt-get install zlib1g-dev

Set up leptonica:

# wget http://www.leptonica.com/source/leptonlib-1.67.tar.gz
# tar xfz leptonlib-1.67.tar.gz
# cd leptonlib-1.67
# ./configure
# make
# make install

Setup tesseract-ocr (version 3.0):

# svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract
# cd tesseract
# ./configure
# make
# make install
# ldconfig -v

Testing tesseract-ocr:

# tesseract eurotext.tiff result

Check result:

# cat result.txt

Done.

How to set up or adding alias to network interface in Ubuntu

Edit /etc/network/interfaces:

# vi /etc/network/interfaces

Append text below:

auto eth0:1
iface eth0:1 inet static
address 192.168.1.7
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0

Restart networking:

# /etc/init.d/networking restart

Tuesday, February 1, 2011

How to resume broken download with .part file in Firefox

Here is how to resume broken download with .part file in Firefox:
  1. You must already have two files from the broken download. One is the filename and the other with extra .part extension. Move both of these files to other directory (please do not copy).
  2. Start download again from the beginning, but you have to make sure that it must have exactly the same name.
  3. Let it download for a few bytes just to have those files created again. Now pause this download.
  4. Go to the folder where you backed up those old files. Copy both of these files to your download folder and replace the new created files when asked.
  5. Now go to Firefox's Downloads and resume the download.
This solution come from this forum. Thanks to orion188.

Enjoy :)