Prevent bash redirection to overwrite existing files

Using a bash command “set” we can prevent bash redirection to overwrite existing files. If the file bash.txt exist this command will overwrite it:
ls > bash.txt
To prevent it we can run command:
set -C
to disable run command:
set +o noclobber
Example:
$ ls > bash.txt
$ set -C
$ ls > bash.txt
bash: bash.txt: cannot overwrite existing file
$ [...]

Perl script code example to create temporary file-tempfile()

Here is a perl script example how to create temporary file on the file system:
TEMPLATE DIR AND SUFIX are option !

#!/usr/bin/perl
my $tempfile = new File::Temp ( TEMPLATE => ‘tempfile_XXX’, DIR => ‘/tmp/’, SUFIX => ” );

this will create a temporary file in /tmp/ directory with name tempfile_XXX where X is random generated character.

Perl script code example to create temporary directory-tempdir()

Here is a perl script example how to create temporary directory on the file system:

#!/usr/bin/perl
use File::Temp qw/ tempdir /;
my $perl_temporary_directory = tempdir();

Basic example of simple C program include static library compilation-source code

install gcc compiler:
apt-get install gcc
All following steps are done in the same directory !! NO need to have an root permissions.
create library1 and save it as liblibrary_1.c:
#include
void library_1(char *val)
{
printf(“Passed value to library_1: %s\n”, val);
}
create library2 and save it as liblibrary_2.c:
#include
void library_2(char *val)
{
printf(“Passed value to library_2: %s\n”, val);
}

Compile both c libraries source codes:
gcc -c liblibrary_1.c liblibrary_2.c
NOTE: [...]

My First Linux C Program Example- Hello world

Here is how you can create linux hello world program. First make sure that you have gcc ( c programming language compiler ) package installed. On debian or on ubuntu you would do:
apt-get install gcc
save this code as linux_program_hello.c
#include
#include
int main()
{
printf(“My First Linux Program – Hello World\n”);
exit(0);
}
now its compile time:
gcc -o linux_program_hello linux_program_hello.c
run your first c [...]

vmware install problem on kernel 2.6.24-16-Unable to build the vmmon module

Following error message can appear during vmware installation due to incompatible kernel version and vmware installation package:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
/tmp/vmware-config0/vmmon-only/linux/driver.c:198: warning: initialisation from incompatible pointer type
make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic’
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only’
Unable to build [...]

Ubuntu-gutsy/hardy-Ethernet (nVidia MCP55 forcedeth) not working

This is a know issue in Ubuntu Linux ( gutsy , hardy ) with nVidia MCP55 Ethernet card.  This  card uses forecedeth module. forecedeth module  is loaded, network card seem to be up and running however it can not ping outside the box. Here is a quick fix for this problem, as a root [...]

Linux Debian-Ubuntu/KDE-Howto Print to a PDF file from firefox using cups-pdf

Here is a small howto print to a PDF file using KDE and firefox. First we need to install cups PDF support:
apt-get install cups-pdf
Then navigate you with mouse to:
KDE -> Control Center -> Select Peripherals -> Printers
From here we need to add new printer click on:
ADD -> Add Printer/Class ( do not select Add [...]

Enable amarok mp3 codec support with ubuntu linux package

By default mp3 support is not enabled for amarok music player. In order to enable amarok mp3 codec support on ubuntu linux you need to install the following package:

apt-get install libxine1-ffmpeg
Once package and its prerequisites are installed may need to restart amarok.