Static and Shared library

Creating Shared library:
First, create the object files that will go into the shared library using the gcc -fPIC or -fpic flag.
The -fPIC and -fpic options enable “position independent code” generation, a requirement for shared libraries.

$ gcc -fPIC -Wall -g -c foo.c

Every shared library has a special name called the “soname”. The soname has the prefix “lib”,
the name of the library, the phrase “.so”, followed by a period and a version number.

We can use ‘ld’, the GNU linker to create our shared library. The ld combines a number of object and archive files,
relocates their data and ties up symbol references.

$ ld -shared -soname libfoo.so.1 -o libfoo.so.1.0 foo.o

Creating Static library:
Static libraries are simply a collection of ordinary object files; conventionally, static libraries end with the ‘.a’‘ .
To generate object file use ‘-c‘ flag with gcc.

$ gcc -c bar.c -o bar.o

Flags:
-c Compile or assemble the source files, but do not link. The compiler output is object files corresponding to each source file.
-o To specifiy the output file name.

A static library can contain more than one object files. We need to copy all object file in to a single file.
This single file is our static library. We can use archiver(ar) to create to create our static library.

$ ar rcs libbar.a bar.o

Options:
r – Insert the files into archive (with replacement).
c – Create the archive.
s – Write an object-file index into the archive, or update an existing one, even if no other change is made to the archive.

Compile the Linux kernel

Well, i’m on a debian box and  i have to upgrade my kernel, my actual version is 2.6.18 .
The debian repository suggests a kernel image version 2.6.26 and i can get it by a simple:
sudo apt-get install linux-image-2.6.26-1-686.
For more fun, we will try to get the latest version (2.6.28) of kernel and install it.

let’s start :
$ sudo apt-get install initramfs-tools ncftp
$ ncftp ftp://www.kernel.org/pub/linux/kernel/v2.6/
ncftp/pub/linux/kernel/v2.6>get linux-2.6.28.tar.gz
$ tar xzvf linux-2.6.28.tar.gz
$ cd linux-2.6.28
$ cp /boot/config-2.6.18-6-686 .config
$ make menuconfig
$ make
$ sudo make modules_install install
$ cd /boot
$ update-grub
$ sudo mkinitramfs -o /boot/initrd.img-2.6.28 2.6.28
$ sudo reboot

Card credit checker

Card credit checker, allows you instantly check credit card number for validity. It can verify Visa, MasterCard, Diners Club, Carte Blanche, American Express (AMEX), Discover, card numbers. CC Checker uses LUHN10 algorithm as well as first digits verification.Not a bad start, right? We’ve learned how to launch a Python application, something about the kinds of dialog support Python has built in, looked at a couple of sample applications, and then edited some source code not once but twice.
We’ll be producing more of these widgets on other aspects of Python’s use.

Dig it


The first step towards scripting is to choose something that you need to do and focus on.
Also, making design of application and reading the documentation, is the way to build a correct project.

In my case i’ve work out java and c, and i focus on python, a simple interpreter language object-oriented.Anyway, i was scripted that dig_it, a widget based on dnspython, and wxwidget to provide passive information from domain name server.