Kamis, 02 September 2010

Add a swap file or expand existing swap space

It’s a myth to say that Ubuntu (or any Linux) needs a swap partition.
This is certainly the preferred way of working, and is most efficient,
but Linux can also use a single swap file located in the root partition,
just like Windows or Mac OS X. There are times when this is advan-
tageous, such as if you’re only able to create one partition for Ubuntu
(for example, Apple’s BootCamp software only allows the creation of a
single non-Mac partition when dual-booting).
To create a swap file, you need to first create a dummy file of sufficient
size, then format it as a swap file, and finally ensure that Ubuntu uses
it at boot-up. The following steps do just that (be extremely careful
entering these commands):
1. Open a terminal window and create an empty file in the root of the
file system using the dd command, as follows (this creates a 1GB
file—you should ideally adjust the count= figure to at least match
the size of your memory, bearing in mind that there is 1,024MB in
a 1GB):

$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

2. Now we need to format it as a swap file:

$ sudo mkswap /swapfile

3. The final step is to make Ubuntu mount it at boot, which is done
by editing /etc/fstab:

$ gksu gedit /etc/fstab

Then make a new line at the bottom of the file and add the follow-
ing:

/swapfile none swap sw 0 0

You can align the entries on the line under the column headings
in fstab, like the other entries in the file, but it doesn’t matter so
long as there is at least one space between each entry on the line.
Once done, save the file and reboot your computer.
Once the computer has rebooted, you can test to see if the swapfile is
being utilized by typing cat /proc/meminfo|grep Swap.
The steps above can also be used to add more swap space to a system
that has an existing swap partition. You might want to do this if you’re
editing extremely high-resolution photographs, for example, or working
with large video files.

Add RAR file compression support to Ubuntu

While Zip is the main compression file format used on most desktop
computers, some people prefer to use the RAR format. To install sup-
port for extracting files from a RAR archive, use Synaptic to search for
and install unrar. Following this, File Roller—Ubuntu’s default archive
manager—will be able to extract files from RAR archives. You can also
use the command from the prompt by simply typing unrar e filename.rar,
replacing filename.rar with that which you downloaded. Note that unrar
doesn’t require a dash before the e command option.

Taken From ubuntu Kungfu

Rabu, 01 September 2010

Take photos or record videos with your webcam

Use Synaptic to search for and install cheese and you’ll be able to
turn your computer into a virtual photobooth and/or camcorder! Once
installed you’ll find the program on the Applications → Graphics menu.
Using it is simple and self-explanatory, especially if you’ve ever used
Mac OS X’s Photobooth software, which it is clearly modeled upon.
Once you’ve taken a snap, right-click it and select Save As to write it
to the hard disk.

Instantly search for files in Nautilus

What this tip describes is very obvious yet almost nobody knows it’s
possible. To quickly search through a list of files in a Nautilus window,
simply ensure the window is top-most and start typing the search term.
A small search text field will appear near the bottom-right of the window
and files/folders will be matched as you type.

Have Ubuntu speak to you

Ubuntu includes a built-in speech synthesizer called espeak. It’s there
to work in partnership with the Orca screen reader, which provides
support for those who are partially-sighted,2 but it can also be called
from the command-line, as follows:

$ espeak "Ubuntu Kung Fu"

As you’ll be able to tell it’s not the most sophisticated speech synthe-
sizer in the world (it has a feel of Speak & Spell about it), but it can be
fun to play around with.
By simply typing espeak, and then hitting Enter , whatever you type
after this will be spoken. To quit, type Ctrl + d .
To switch voices, use the -v command option, but first you’ll need to
find-out the available voices, which can be done by typing espeak --
voices=en. For example, to have the phrase “How about a nice game of
chess?” spoken in a Jamaican voice, you could type:

$ espeak -s 140 -v en-westindies "How about a nice game ←֓
of chess?"

In the above example I also added the -s command option, by which
you can specify the speech speed in words per minute. The default
value of 170 tends to be a little fast, especially when it comes to longer
sentences.

Taken From Ubuntu Kungfu

View all of a digital photo’s technical information

Most pictures taken by digital cameras are saved in EXIF JPEG format.
This means that they record technical details about the shot along with
the actual image data. The information includes the exposure time, the
aperture used, whether the flash was active, and so on.
In Ubuntu you can view this information by right-clicking any image,
clicking Properties, and then looking at the Image tab. To view even more
information, double-click the image so it opens in Eye of GNOME (the
default Ubuntu image viewer) and then click File → Properties. Then
click the Metadata tab and click the Details fold-down. Remember that
even dialog boxes within Ubuntu can be enlarged by clicking and drag-
ging the corners—this can really help view all the available information.
To view the information at the command-line, use Synaptic to install
the exif package. Then, to view the EXIF information, simply type exif
photo.jpg, replacing photo.jpg with the name of the file.

Shrink or enlarge images at the command line

GIMP can do just about anything to an image but it can be time-consuming
to fire it up just to resize an image. For ultra-quick manipulation, con-
sider Imagemagick, a command-line image manipulation program. It
doesn’t come installed by default and you’ll need to install it via Synap-
tic (search for and install imagemagick). Once installed, the convert com-
mand should be used with the addition of the -resize command option.
For example, the following will shrink filename.bmp to half its original
size:

$ convert -resize 50% filename.bmp filename_small.bmp

The following will enlarge filename.bmp to twice its original size (although
there will be an obvious degradation in quality):

$ convert -resize 200% filename.bmp filename_larger.bmp