Posted on April 30, 2008 by linuxconfig
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
$ [...]
Filed under: Bash, Linux, Scripting | Leave a Comment »
Posted on April 28, 2008 by linuxconfig
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.
Filed under: Linux, Perl, Programming | Leave a Comment »
Posted on April 28, 2008 by linuxconfig
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();
Filed under: Linux, Perl, Programming | Leave a Comment »
Posted on April 27, 2008 by linuxconfig
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: [...]
Filed under: C, Linux, Linux Programming Tutorial, Programming | Leave a Comment »
Posted on April 27, 2008 by linuxconfig
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 [...]
Filed under: C, Linux, Linux Programming Tutorial, Programming | Tagged: C, example, Howto, Linux, Programming, start | Leave a Comment »
Posted on April 17, 2008 by linuxconfig
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 [...]
Filed under: Administration, Linux, vmware | Tagged: build, how, install, kernel, Linux, module, problem, unable, vmmon, vmware | Leave a Comment »
Posted on April 17, 2008 by linuxconfig
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 [...]
Filed under: Administration, Linux, Networks, Ubuntu | Tagged: ethernet, forcedeth, gusty, hardy, Linux, MCP55, network, network card, nvidia, ping, problem, Ubuntu | Leave a Comment »
Posted on April 17, 2008 by linuxconfig
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 [...]
Filed under: Administration, Debian, KDE, Linux, Printing, Ubuntu | Tagged: access, browser, configure, cups, cups-pdf, file, firefox, Howto, KDE, Linux, pdf, Pdf to file, print, Printing, settings | Leave a Comment »
Posted on April 5, 2008 by linuxconfig
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.
Filed under: Administration, Fun and Linux, Linux, Ubuntu | Tagged: amarok, codec, enable, Linux, mp3, package, support, Ubuntu | 1 Comment »