Howto share application data using UNIX System V IPC mechanisms

Posted on in Categories Linux, Open source coding, UNIX last updated February 1, 2007

Learn how to use message queues, semaphores, and shared memory to connect your applications

UNIX provides several methods for IPC. The SysV IPC methods are message queues, semaphores, and shared memory. Message queues allow one application to submit a message that other applications can pick up later, even after the sending application has finished. Semaphores ensure that multiple applications can lock resources and avoid race conditions. Shared memory allows multiple applications to share a common segment of memory, which provides a fast method of communicating and sharing large amounts of data. You can also use these methods together. For example, you can use a semaphore to control access to a shared memory segment.

IPC methods are helpful to application developers because they provide a standard way to communicate between applications and are portable across different UNIX flavors. The next time you find yourself needing to lock resources or share data between processes, try the SysV IPC mechanisms.

Read more at IBM developerworks

Linux Driver Development Help available from Gurus

Posted on in Categories GNU/Open source, Linux, Open source coding last updated January 30, 2007

Linux Kernel hacker Greg is offering free help for Linux driver development.

From the announcement:
Yes, that’s right, the Linux kernel community is offering all companies free Linux driver development. No longer do you have to suffer through all of the different examples in the Linux Device Driver Kit, or pick through the thousands of example drivers in the Linux kernel source tree trying to determine which one is the closest to what you need to do.

All that is needed is some kind of specification that describes how your device works, or the email address of an engineer that is willing to answer questions every once in a while. A few sample devices might be good to have so that debugging doesn’t have to be done by email, but if necessary, that can be done.

In return, you will receive a complete and working Linux driver that is added to the main Linux kernel source tree. The driver will be written by some of the members of the Linux kernel developer community (over 1500 strong and growing). This driver will then be automatically included in all Linux distributions, including the “enterprise” ones. It will be automatically kept up to date and working through all Linux kernel API changes. This driver will work with all of the different CPU types supported by Linux, the largest number of CPU types supported by any operating system ever before in the history of computing.

Free Linux Driver Development!

Take action or execute a command based upon shell script name

Posted on in Categories Gentoo Linux, Howto, Linux, Open source coding, RedHat/Fedora Linux, Shell scripting, Tips, Ubuntu Linux, UNIX last updated January 23, 2007

You would like to run different commands or task based upon a single shell script name. For example script name is backup Instead of writing 3 different script write one script and softlink using ln command:

=> backup – original script

=> backup.nas – Script to backup data to NAS device

=> backup.ftp – Script to backup data to FTP Server

=> backup.scp – Script to backup data to Remote SSH server

Use ln command to make link between backup and other files
$ ln -s backup backup.nas
$ ln -s backup backup.ftp
$ ln -s backup backup.scp

Now use basename command strip directory and suffix from script name. $0 variable always print scriptname.
#!/bin/bash
echo My name is $(basename $0)

Output:

My name is backup

Let us store output to variable
#!/bin/bash
ME=$(basename $0)

Now simply use the case statement to get script name. The case statement allows you to match several values against $ME variable. Here is final script:

#!/bin/bash
ME=$(basename $0)
case $ME in
        backup.nas)
           echo "Write code to mount NAS using smbmount, use cp to copy data to NAS"
           ;;
        backup.ftp)
           echo "Write code to copy data using FTP"
           ;;
        backup.scp)
           echo "Write code to copy data using OpenSSH scp command"
           ;;
        *)
           echo "Syntax error - show some help"
           echo "Use $ME.nas or $ME.ftp or $ME.ftp"
           ;;
esac

To backup data to NAS just type
backup.nas

To backup data to FTP server just type
backup.ftp

Benefits

  • Ease of use
  • Saves time
  • Your work looks quite professional

See also:

Download of the day: Ajax Secure Service Layer

Posted on in Categories Download of the day, Open source coding last updated December 19, 2006

Finally we have Ajax Secure Service Layer.

From the project home page:
aSSL is a library distributed under MIT License thats implements a technology similar to SSL without HTTPS.

aSSL is composed from a file .js and a server component. Currently, the ASP and PHP components are ready. I’m developing Ruby and Java components and in the near future I will add components in all the principal web languages (Perl, Python, TKL, etc.).

aSSL enables the client to negotiate a secret random 128-bit key with the server using the RC4 algorithm. Once be connection has been established, the data will be sent and received using BlockTEA algorithm (a derivation of DES). aSSL 1.0 uses a 64-bit key. Version 1.1 uses a 128-bit key with a technique similar to Double Key Triple DES, that I call Double Key Quadruple DES. This allows a level of security closer to AES encryption. In fact, aSSL is moving towards AES.

=> Download Ajax Secure Service Layer

Understanding The Google PageRank Algorithm in 126 Lines of Python

Posted on in Categories Beyond nixCraft, Links, Open source coding last updated December 16, 2006

According to wikipedia
PageRank is a link analysis algorithm which assigns a numerical weighting to each element of a hyperlinked set of documents, such as the World Wide Web, with the purpose of “measuring” its relative importance within the set. The algorithm may be applied to any collection of entities with reciprocal quotations and references. The numerical weight that it assigns to any given element E is also called the PageRank of E and denoted by PR(E).

In short it is based upon mathematically formula which use uses links as votes (more votes mean you are at top of the Google search engine).

This article explains
=> The myth
=> The algorithm
=> And the actual 126 line python code for Pagerank.

A great read to understand both math and Python code behind Pagerank. More information about PageRank can be found at following location:
=> PageRank from Wikipedia, the free encyclopedia
=> How Google Finds Your Needle in the Web’s Haystack

Download Open Source Google Web Toolkit

Posted on in Categories Download of the day, Open source coding last updated December 12, 2006

The Google Web Toolkit is a free toolkit by Google, as part of the Google Code initiative, to develop Ajax applications in the Java programming language. GWT supports rapid client/server development and debugging in any Java IDE

From the project home page:
Google Web Toolkit (GWT) is an open source Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don’t speak browser quirks as a second language. Writing dynamic web applications today is a tedious and error-prone process; you spend 90% of your time working around subtle incompatibilities between web browsers and platforms, and JavaScript’s lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile.

GWT lets you avoid many of these headaches while offering your users the same dynamic, standards-compliant experience. You write your front end in the Java programming language, and the GWT compiler converts your Java classes to browser-compliant JavaScript and HTML.

Google Web Toolkit Features

  • Dynamic, reusable UI components
  • Really simple RPC
  • Browser history management
  • Real debugging
  • Browser compatible
  • JUnit integration
  • Internationalization
  • Interoperability and fine-grained control
  • Completely Open Source

=> Download Google Web Toolkit for Windows/MAC OS X/Linux (Apache 2.0 license).

Download of the day: Linux or Solaris Java Standard Edition 6 (SE 6)

Posted on in Categories Download of the day, Linux, Open source coding, Suse Linux, Ubuntu Linux, UNIX, Windows last updated December 12, 2006

It is better, easier, and faster…

Sun has announced the release of Java Platform, Standard Edition (SE) 6

Whether working on Solaris, Linux, or Windows operating systems, Java applications can be deployed with confidence when you leverage our new developer services featuring Java MultiPlatform Support.

New features

Improved graphical user interface libraries along with the design tools in NetBeans IDE 5.5 simplify rich client application development and expand native platform support.

Complete, lightweight platform to develop and deploy .NET compatible web services.

Improved diagnostic facilities for tracking memory usage, thread behavior, and native system interactions helping identify the cause of application bugs and performance bottlenecks faster and easier than ever before.

The first pieces of source code for Sun’s implementation of Java SE platform are now freely available under GPL(v2) via NetBeans and Java.net communities, with a buildable JDK in the first quarter of 2007.

Download Java Standard Edition 6

Earn money solve open source software problem

Posted on in Categories GNU/Open source, Make money with Linux, News, Open source coding last updated December 4, 2006

The OpenLogic Expert Community is a group of open source software developers committed to the success of open source. They are dedicated to solving the problems encountered by open source software users and are working with OpenLogic to support open source software projects in the enterprise.

While the benefits of open source software are clear, many companies have lingering concerns about obtaining the level of support they require. Although there are a myriad of support options available for open source, navigating those choices is not easy. Yes you will find discussion forums and mailing lists for open source software but these free supports do NOT solves the problem for sure.

OpenLogic and the OpenLogic Expert Community bridge that gap by providing a single avenue for obtaining expert support on over 160 open source projects. OpenLogic’s internal technical support team acts as the frontline of support, answering customer questions and investigating incidents. For more complex issues, OpenLogic turns to the OpenLogic Expert Community. These open source experts work in partnership with OpenLogic to troubleshoot and resolve customer problems. Through the Expert Community, OpenLogic is connecting enterprises users with committed, passionate and expert developers dedicated to the success of open source.

As a thank you for their time, Open Logic Expert Community members can earn points redeemable for cash or rewards through the OpenLogic Rewards program. Check out their FAQ page for more information. You can apply here.

The first 75 people to join will receive an Xbox 360 after they solve the first tier 3 or tier 4 issue that is sent to them. Woot! 😀

Please note that this for open source software development and bug related work. This is not your usual sys admin work. You need some sort of programming skills and you must be associated with any one of the project mentioned on their website.

How to debug make: tips for debugging makefiles

Posted on in Categories Beyond nixCraft, C Programming, Linux, Open source coding, UNIX last updated October 25, 2006

The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them.

To prepare to use make, you must write a file called the makefile that describes the relationships among files in your program, and the states the commands for updating each file.

Sometime makefiles become so large, you need to debug them.

This article helps you to get make to work for you, not against you i.e. debugging make and its makefiles.

From the article:
Make and utilities like it are fundamental tools for streamlining the application build process. Learn the structure of the makefile, how to avoid common mistakes in its creation, and how to solve or work around portability issues and other problems as they crop up.

Most UNIX and Linux programs are built by running make. The make utility reads a file (generally named either “makefile” or “Makefile,” but hereafter merely referred to as “a makefile”) that contains instructions and performs various actions to build a program. In many build processes, the makefile is itself generated entirely by other software; for instance, the autoconf/automake programs are used to develop build routines. Other programs may ask you to directly edit a makefile, and of course, new development may require you to write one.

Read more at IBM developerworks [ibm.com]