Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Wednesday, August 24, 2011

Chrome doesn't display tamil fonts properly

I have faced a problem when am working with chrome under ubuntu. Browser doesn't display the tamil fonts properly. I solve this by removing "FreeSans" font. You found this file under

Path: /usr/share/fonts/truetype/freefont under this path you will found FreeSans.ttf file just remove it. Now Chrome will display all tamil fonts properly.

Saturday, February 12, 2011

unzip tarball files:

usually to unzip a *.tar.gz file i used 'tar' command. The syntax of the tar command is:

Syntax:
tar -option file_name.tar.gz

tar -xzfvp file_name.tar.gz
the above command will unzip a tarball file.

but when i tries to unzip it says error 'vp can not open file', so am unable to unzip a file. Then i found a alternative command to unzip a tar.gz files. Its gzip command i command i used to unzip my tarball. The command i used is as follows:

gzip -dc file_name.tar.gz | tar xf -

Sunday, February 6, 2011

stack smashing detected

'stack smash'-"buffer overflow...." when i tried to run a array sort program the following error shows.


*** stack smashing detected ***: ./a.out terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x50)[0x215970]
/lib/libc.so.6(+0xe591a)[0x21591a]
./a.out[0x8048520]
/lib/libc.so.6(__libc_start_main+0xe7)[0x146ce7]
./a.out[0x8048381]
======= Memory map: ========
00130000-00287000 r-xp 00000000 08:09 1574075    /lib/libc-2.12.1.so
00287000-00289000 r--p 00157000 08:09 1574075    /lib/libc-2.12.1.so
00289000-0028a000 rw-p 00159000 08:09 1574075    /lib/libc-2.12.1.so
0028a000-0028d000 rw-p 00000000 00:00 0
00828000-00829000 r-xp 00000000 00:00 0          [vdso]
0085f000-0087b000 r-xp 00000000 08:09 1574071    /lib/ld-2.12.1.so
0087b000-0087c000 r--p 0001b000 08:09 1574071    /lib/ld-2.12.1.so
0087c000-0087d000 rw-p 0001c000 08:09 1574071    /lib/ld-2.12.1.so
0089a000-008b4000 r-xp 00000000 08:09 1572944    /lib/libgcc_s.so.1
008b4000-008b5000 r--p 00019000 08:09 1572944    /lib/libgcc_s.so.1
008b5000-008b6000 rw-p 0001a000 08:09 1572944    /lib/libgcc_s.so.1
08048000-08049000 r-xp 00000000 08:09 655695     /root/a.out
08049000-0804a000 r--p 00000000 08:09 655695     /root/a.out
0804a000-0804b000 rw-p 00001000 08:09 655695     /root/a.out
0962d000-0964e000 rw-p 00000000 00:00 0          [heap]
b781e000-b781f000 rw-p 00000000 00:00 0
b7832000-b7835000 rw-p 00000000 00:00 0
bfbbd000-bfbde000 rw-p 00000000 00:00 0          [stack]
Aborted

when i tries to found why this error happens, then i found i tried to access the array bound limit in my program. when i surf, i found a gcc command, for stack protection,

gcc -fno-stack-protector file_name.c

this command protects the stack overflow...and produces the result when you runs the program,if the error still precedes your program tries to access illegal memory location...

Wednesday, January 26, 2011

Solution:changing directory delimits to white space.

while changing directory, cd command delimits to white spaces.

syntax:
cd directory_name

is the syntax for changing directory. cd command workout with directory without whitespace.

example:
cd Documents

this will workout. But if the directory name is 'pdf files' cd command

cd pdf files

will wont work out 'cd: pdf no such file or directory' will be the result if there is no 'pdf' directory this is because cd command takes 'pdf' as a directory, which delimits to white space. The cd command resolved by '\' before whitespace. The above example can resolved as,

cd pdf\ files

suppose the directory contains two whitespace i.e,'pdf  files', the command will be,

cd pdf\ \ files.

if your directory is 'pdf\files', then the command for changing directory is

cd pdf\\files.

Saturday, January 1, 2011

Shell Environment.

To find all available shells in our system type following command.

syntax: 
cat /etc/shells


To find our current shell type following command.

syntax:

echo $SHELL

Sunday, December 26, 2010

Compiling C Program Under Unix

To compile the C program under Unix environment. We need C Compiler to compile C program. Some C compilers are cc, gcc and etc., In this cc compiler is available under any environment. To compile:
cc file_name.c
this will compile C program. To run,
./a.out

Example:
cc sample.c

To run this,
./a.out

Another way,
cc -o output_file file_name.c

To run this,
./output_file

Example:
cc -o sampleout sample.c

To run,
./sampleout

Linux Filesystem

As a Linux system boots, the filesystem that becomes available is the top level, or rot filesystem, denoted with a single forward slash(/). The root filesystem /, also known as root directory, shouldn't be confused with the root superuser account or the superuser's home directory, / root. In a installation, the root filesystem could contain nearly everything on the system. As the Linux kernel boots, the partitions are mounted to the root filesystem, and together create a single unified filesystem. Everything on the system that is not stored in a mounted partition is stored locally in the / partition. The mounted filesystem are placed on separate partitions and possibly multiple disk drives. Here is the list of directories the root filesystem contains:

/ (the root directory): Since the only filesystem mounted at the start of the boot process is /, certain directories must be part of it to be available for the boot process. These include:

/bin and /sbin: Contains required system binary programs.

/dev: Contains device files.

/etc: Contains configuration information used on boot.

/lib: Contains shared libraries. These directories are always part of the single / partition.

/boot: This directories holds static files used by the boot loader, including kernel images. On system where kernel development activity occurs regularly, making /boot a partition eliminates the possibility that / will fill with kernel images and associated files during development.

/home: User files are usually placed in a partition. This is often the largest partition on the system and may be located on a separate physical disk or disk array.

/tmp: This directory is often a separate partition used to prevent temporary file from filling the root filesystem.

/var: Log files are stored here. This is similar to the situation with /tmp, where user files can fill any available space if something goes wrong or if the files are not cleaned periodically.

/usr: This directory hold a hierarchy of directories containing user commands, source code, and documentation. It is often quite large, making it a good candidate for its own partition. Because much of the information stored under /usr is static, some users prefer that it be mounted as read-only, making it impossible to corrupt.

In addition to the preceding six partitions listed, a swap partition is also necessary for a Linux system to enable virtual memory.