Fedora Linux (HCL) hardware compatibility list

last updated in Categories

If you are not able to obtained Fedora Core HCL then it is available online via Red Hat site. Whatever HCL supported by Redhat Linux (RHEL) is also suppored by Fedora core linux. Here are direct links to Red Hat Hardware compatibility List as well as other site that will help you to make your final decsion:

How to identify format and characteristics of image file

last updated in Categories

To identify format and characteristics of image file you need to use command called identify.

It will also report if an image is incomplete or corrupt. The information displayed includes the scene number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.), and finally the number of seconds it took to read and process the image

If you are looking to provide scripting solution to automate task then this command is the best one.

$ identify -verbose snap-S25-20060218-235000-1.ppm | less

Output:

Image: snap-S25-20060218-235000-1.ppm
Format: PNM (Portable anymap)
Geometry: 768x576
Class: DirectClass
Colorspace: RGB
Type: TrueColor
Depth: 8 bits
Endianess: Undefined
Channel depth:
  Red: 8-bits
  Green: 8-bits
  Blue: 8-bits
Channel statistics:
  Red:
    Min: 0
    Max: 255
    Mean: 87.5478
    Standard deviation: 89.9707
  Green:
    Min: 0
    Max: 255
    Mean: 73.0576
    Standard deviation: 84.7219
  Blue:
    Min: 0
    Max: 255
    Mean: 53.6681
    Standard deviation: 73.7701
Colors: 163423                                        
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 1.3mb
Interlace: None
Background Color: grey100
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
signature: ad1ac5b547203e393117aab
Tainted: False
User Time: 0.020u
Elapsed Time: 0:01

Shell: How to wrap text files to fit specified width

last updated in Categories

You can use command called fold. It wrap each input line (or lines from file) to fit in specified width. Width can be specified in columns or bytes size. By default Wrap input lines in each FILE from standard input (keyboard ), writing to standard output (screen).

Syntax
fold -b size -w width file-name

Where,

  • -b : Use bytes rather than columns
  • -w : use WIDTH columns instead of 80 (which is default)

Examples

$ fold -w 40 file.txt
$ cat file.txt | grep something | fold -b 20

How do I Create files needed to build and use DLLs under Linux?

last updated in Categories

You need to use command called dlltool. It create files needed to build and use DLLs. dlltool reads its inputs, which can come from the -d and -b options as well as object files specified on the command line. It then processes these inputs and if the -e option has been specified it creates an exports file. If the -l option has been specified it creates a library file and if the -z option has been specified it creates a def file. Any or all of the -e, -l and -z options can be present in one invocation of dlltool.

Here is an example of creating a DLL from a source file dll.c:

$ gcc -c dll.c
$ dlltool -e exports.o -l dll.lib dll.o
$ gcc dll.o exports.o -o dll.dll

Where,

  • -c : Specifies that when dlltool is creating the exports and library files it should omit the “.idata5” section. This is for compatibility with certain operating systems.
  • -e: Specifies the name of the export file to be created by dlltool.
  • -l : Specifies the name of the library file to be created by dlltool.

Creating a program (from an object file called program.o) that uses that DLL:

$ gcc program.o dll.lib -o program

Read the man page of dlltool for more information.

Open MS-Word and MS-PowerPoint file under Linux/UNIX

last updated in Categories , , , ,

You can use program like OpenOffice.org office application to open Ms-Word, Excel, and PowerPoint files under Linux, FreeBSD and other Unixish oses. If you are looking for command line based utilities then try out catdoc or catppt:

catdoc : Reads MS-Word file and puts its content as plain text on standard output. catdoc doesn’t attempt to extract formatting information other than tables from MS-Word document, so different output modes means mainly that different characters should be escaped and different ways used to represent characters, missing from output charset
Examples:
$ catdoc filename.doc
$ catdoc filename.doc > /tmp/output.txt

catppt : Reads MS-PowerPoint file and puts its content on standard output
Examples:
catppt filename.ppt
catdoc filename.ppt > /tmp/output.txt

You may need to install catdoc and catppt using apt-get, yum or FreeBSD ports collection:
# apt-get install catdoc catppt