feed-image  Delivered by FeedBurner  ISSN 1836-5930





Poll

Which of following tutorials would you like to see on the Linuxconfig.org?
 
Partner Linux Sites
TuxMachines
DebianAdmin
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
FreeSoftwareLinux
Jam's Ubuntu Blog
All For Linux

LINUX ADMINISTRATION NOTES & CODE SNIPPETS

Reprogram keyboard keys with xmodmap

If you do not like your keyboard layout or the layout you are using is very close to perfection but some keys could be re-mapped to different location there is ...

Sunday, 21 March 2010

Read more ...

Synchronization of your camera with PC using rsync

rsync can be used in many ways. This small utility got its name from Remote Synchronization words. However the word remote does no have to be a remote location over ...

Sunday, 21 March 2010

Read more ...

xine was unable to initialize audio drivers

xine was unable to initialize audio drivers error message is an issue which bothers me for long time alredy. I have a feeling that it is not related to only ...

Saturday, 20 March 2010

Read more ...

Frequently used options for debian / ubuntu dpkg command

dpkg -l List all installed packages.EXAMPLES:dpkg returns a number of installed packages:$ dpkg -l | wc -l1209ask dpkg to return only packages related to php. This will include installed and non-installed ...

Saturday, 20 March 2010

Read more ...

Resize an image with OpenCV cvResize function

This is a small code to resize an image to a desired percentage from an original. New size of width and height are calculated from a percentage supplied as a ...

Thursday, 18 March 2010

Read more ...

Display Image Attributes with OpenCV

Here is a simple program to display image attributes like width, height, size and etc. This program assumes that you have OpenCV library alredy installed on you system. #include <iostream> #include <iomanip> #include ...

Thursday, 18 March 2010

Read more ...

C++ function to calculate Fibonacci number

Here is a small program to clalculate Fibonacci numbers using c++ language. No tampering with the code needed ( only iprovements ! ) just copy and compile with g++ FibonacciNumber.cpp ...

Thursday, 18 March 2010

Read more ...

Google offers free Mysql database

Search engine is very powerful tool but not just for search but also for beginner hacking. Some mysqladmin web tools are indexed with google which make them available for search. ...

Thursday, 18 March 2010

Read more ...

More in: LINUX ADMINISTRATION NOTES & CODE SNIPPETS

-
+
8

Linux News

Victoria expands Linux e-voting rollout

Victoria’s Electoral Commission has flagged plans to expand its use of electronic voting kiosks based on Linux software in the next state election in November this year. The state first ...

Sunday, 21 March 2010

Read more ...

Ten Years of OpenOffice.org

This year (2010) marks the 10th anniversary of a lot of things: Tuvalu’s entry into the United Nations, Israel’s withdrawal from Lebanon, and the debut of Windows ME, for example. ...

Saturday, 20 March 2010

Read more ...

Symbian Foundation Builds Cloud Platform on Red Hat Enterprise Linux

Red Hat, Inc., the world's leading provider of open source solutions, today announced that the Symbian Foundation, a global non-profit organization formed to foster an open source community around its ...

Tuesday, 16 March 2010

Read more ...

Try the Linux desktop of the future

For the tinkerers and testers, 2010 is shaping up to be a perfect year. Almost every desktop and application we can think of is going to have a major release, ...

Sunday, 7 March 2010

Read more ...

I-O Data Signs Linux Software Patent Agreement With Microsoft

Microsoft Corp. and I-O Data Device Inc. have entered into an agreement that will provide I-O Data’s customers with patent coverage for their use of I-O Data’s products running Linux ...

Friday, 5 March 2010

Read more ...

Microsoft and Amazon.com Sign Patent Agreement

Microsoft Corp. today announced that it has signed a patent cross-license agreement with Amazon.com Inc. The agreement provides each company with access to the other’s patent portfolio and covers a ...

Friday, 5 March 2010

Read more ...

When will Microsoft sue Google over Linux?

Microsoft once made the mistake of broad-brushing Linux as an intellectual property quagmire. It made Microsoft headlines, but few friends: lawyers didn't believe it, customers didn't want to hear it, ...

Monday, 1 March 2010

Read more ...

Amazon Ponies Up to Microsoft for Linux Rights

Microsoft and Amazon have entered into a patent cross-licensing deal that covers, among other things, Amazon's Kindle and its use of Linux-based servers. The agreement calls for Amazon to pay ...

Tuesday, 23 February 2010

Read more ...

Google's Android code deleted from Linux kernel

After removing Google's Android driver code from the Linux kernel, Novell Fellow and Linux developer Greg Kroah-Hartman has argued that the mobile OS is incompatible with the project's main tree. ...

Friday, 5 February 2010

Read more ...

Sold out: Microsoft's Linux business is booming

The SD Times reports that Microsoft has sold nearly all of its SUSE Linux Enterprise Server (SLES) support coupons. Microsoft purchased the $240 million worth of coupons from Novell as ...

Friday, 5 February 2010

Read more ...

Symbian OS Takes on Android, Linux in Massive Open Source Move

In a dramatic strategic move, the Symbian Foundation has made source code for the world’s most widely used mobile OS completely free and completely open. In addition, the Foundation says ...

Friday, 5 February 2010

Read more ...

Ubuntu Firefox shuns Google for Yahoo! search

The next release of Ubuntu will scrap Google as the default search engine on its Firefox browser in favor of Yahoo!, thanks to a new revenue-sharing deal between Yahoo! and ...

Thursday, 28 January 2010

Read more ...

2009's Five Most Popular & Important Linux Stories

Before jumping into this, let me say that's what popular isn't the same thing as what's important. So, I'm giving you a twofer list. The first is the most popular ...

Tuesday, 5 January 2010

Read more ...

Shuttleworth steps down as Ubuntu 10.04 alpha steps up

Canonical announced that Mark Shuttleworth will be stepping down as CEO in March to be replaced by Canonical COO Jane Silber, reports eWEEK. Meanwhile, the Ubuntu project has released its ...

Friday, 18 December 2009

Read more ...

Microsoft/Linux Milestones

Microsoft Monday made an historic move by submitting device drivers to the Linux kernel under a GPLv2 license. Microsoft has had a checkered past with both Linux and its open ...

Tuesday, 15 December 2009

Read more ...

More in: Linux News

-
+
4
Linuxconfig.org
touch

Author: Lubos Rendek

Date: 21.03.2010


Name

touch [man page] - change file timestamps

Usage

When working with a Linux operating system, sometimes a need arises to create an empty file. Some service, which an administrator is configuring, requires a certain file to be created before the service can start and what is more this file may need to have certain access time stamp. If you are, for example, running a photo album web application which automatically adds your images to the album and sorts them according to the image creation time, the images you upload must have set accurate creation time in order this can work. What if the time set in your camera is incorrect?

A tool which comes handy in both scenarios is the touch command. Touch command not only provides a simple way to create files, but it also allows a user to alter access and modification time for a given file.

NOTE: Linux system does not store a file creation time. The information stored instead is the access time. The access time does not necessarily represent creation time and in many situations it represents access time only. This is because access time gets updated every time a file is accessed / read.

NOTE: In this article, we are going to use the stat command to observe changes to file's access and modification time made by touch command.

File creation

As it was already mentioned a touch command provides a simple way of creating empty files. The syntax is rather simple:

linuxconfig.org:~$ ls
linuxconfig.org:~$ touch fileA
linuxconfig.org:~$ ls
fileA
linuxconfig.org:~$

Execution of touch command with an argument fileA will produce a single empty file named fileA. Touch command can accept more than one argument and as result:

linuxconfig.org:~$ touch fileB fileC fileD
linuxconfig.org:~$ ls
fileA fileB fileC fileD
linuxconfig.org:~$

it will create three additional files called fileB fileC and fileD. It is important to understand that all files created by touch command are empty, which means that touch command does not add any characters to newly created files.

Change file timestamps

At this point, we need to have a close look at earlier created files. stat command will return verbose information associated to a file given to it as its argument.

linuxconfig.org:~$ stat fileA
File: `fileA'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 802h/2050d Inode: 1867780 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1001/linuxconfig) Gid: ( 1001/linuxconfig)
Access: 2010-03-21 06:22:52.000000000 +1100
Modify: 2010-03-21 06:22:52.000000000 +1100
Change: 2010-03-21 06:22:52.000000000 +1100
linuxconfig.org:~$

stat command returned detailed information about fileA status in regard to a present file system. The only interesting bit connected to this article is access and modify time.

Access time

Access time refers to a time when to file was last time accessed. In other words, every time some utility reads a content of fileA, fileA will change its access time. Following example demonstrates this point:

linuxconfig.org:~$ date
Sun Mar 21 06:23:08 EST 2010
linuxconfig.org:~$ stat -c %x fileA
2010-03-21 06:22:52.000000000 +1100
linuxconfig.org:~$ cat fileA
linuxconfig.org:~$ stat -c %x fileA
2010-03-21 06:23:19.000000000 +1100
linuxconfig.org:~$

First, we have used the date command to retrieve a current date and time. Next command executed is stat command which returns an access time of fileA. Cat command is used to access / read a content of fileA. There is no output since fileA is an empty file. Executing a stat command again with fileA as an argument indicates that access time has been changed.

Modify time

Modify time is altered when the content of a file itself has been modified. In the following example, we use echo command to modify a content of fileA:

linuxconfig.org:~$ date
Sun Mar 21 06:23:23 EST 2010
linuxconfig.org:~$ stat -c %y fileA
2010-03-21 06:22:52.000000000 +1100
linuxconfig.org:~$ echo addline > fileA
linuxconfig.org:~$ stat -c %y fileA
2010-03-21 06:23:35.000000000 +1100
linuxconfig.org:~$

Once again, we have used a date command to show a current system time. Next command executed was a stat command which in this case displayed modify time of a fileA. Next, we have used an echo command to add new line into fileA. Lastly, stat command confirms that modify time has been changed. As a side-note it should be mentioned that modifying content of file will alter also file's change time.

Change time

In regard to a touch command, we are not interested in change time. Nevertheless, just for a completeness we shortly examine also change time. Change time holds a time when file's meta data or inode information is altered. Meta data includes change of permissions or file ownership. Following example illustrates this idea:

linuxconfig.org:~$ date
Sun Mar 21 06:23:40 EST 2010
linuxconfig.org:~$ stat -c %z fileA
2010-03-21 06:23:35.000000000 +1100
linuxconfig.org:~$ chmod +x fileA
linuxconfig.org:~$ stat -c %z fileA
2010-03-21 06:23:51.000000000 +1100
linuxconfig.org:~$

Same as in both preceding examples date command displays a current date and time. stat command reveals a current value of file's change time. chmod command added executable permissions to a file. When comparing both time values, it is clear that a modification of fileA's permissions resulted in updating a change time value to a current system time.

Video

Read more...
 
Introduction to Computer Vision with the OpenCV Library on Linux

Author: Lubos Rendek


Abstract

The purpose of this document is to help a reader to get started with Computer Vision library OpenCV on Linux system. OpencCV is a multi-platform library, but this article will be focused only on OpenCV using Linux operating system ( although, just the installation of the OpenCV library and video camera is platform-specific, all examples in this article should compile on any platform where OpenCV is properly installed such as  Mac OS, MS Windows and etc.).  Reader will be guided through a step-by-step guide on how to install and use some of the basic functions of OpenCV library such as displaying images, playing a video or using a video camera to process a video input stream.

Conventions used in this article:

  • $ - execution on the command line by a non-privileged user
  • # - execution on the command line by a superuser
  • the actual command to be executed on the command line or code of program to be compiled
  • OUTPUT: output produced on the command line by command execution
  • NOTE: general notes and additional information

Introduction

In simple words a Computer Vision is a scientific field which attempts to provide a sight to the machine. This scientific field has expanded rapidly in recent years. Among researchers this growth is because of many improvements of vision algorithms and among the computer vision hobbyists this is due to the cheaper hardware components and processing power.  OpenCV library plays a great role in the Computer Vision field as it helps greatly to reduce cost and preparation time of computer vision research environment needed by university students, hobbyists and professionals. OpenCV also provides a simple to use functions to get the work done in a simple, effective and elegant manner.  OpenCV was started by Intel, and later it was transformed to an open source project now available on SourceForge.net. OpenCV library has multi-platform availability,  and it is partially written in C++ and C language. Despite the fact that this library is available on many Linux distributions from its relevant package repositories, in this article we will attempt to install and use OpenCV library compiled from a source code downloaded from SourceForge.net web site.


The reasons for compiling a source code may include:
  • new version 2.0.0 recently released and more features available
  • some bugs fixed which affected Linux OpenCV 1.0.0 versions ( such as cvGetCaptureProperty() etc. )
  • more support is available for OpenCV 2.0.0 version than for former 1.0.0 version

This article will start with installation of OpenCV on Debian 5.0 ( Lenny ). Later a reader will be guided through a number of examples on how to use OpenCV to display an image, play a video and use camera to capture the video input stream.

Read more...
 
C++ : Understanding pointers

Author: Lubos Rendek

Date: 10.09.2009

Update: 04.03.2010 - Section 7.2 created clarify relation between Pointers and Arrays in C++


Introduction

This article is intended to all programing enthusiasts on all levels who do wish to understand pointers in C++ language.  All code presented here is not a compiler specific and all examples will be written in plain ANSI C++. Debate about pointers can stretch for miles, and you would need to go really far to master it all. If you really want to run that far, this article gives you a clear understanding of fundamental concepts about pointers and prepares you for that journey. However, those who are new to C++ programming make sure that  you are able to write and run your own C++ “hello world” program, and also it is recommended that you have a basic understanding of C++ functions and classes. If you need to refresh your knowledge about how to compile and run C++ program, use functions and classes, please read an appendix at the end of this document before you continue reading this article.

What is a Pointer?

Pointer is a variable that stores a memory address. OK, that is simple ! But, what is a memory address then? Every variable is located under unique location within a computer's memory and this unique location has its own unique address, the memory address. Normally, variables hold values such as 5 or “hello” and these values are stored under specific location within computer memory. However, pointer is a different beast, because it holds the memory address as its value and has an ability to “point” ( hence pointer ) to certain value within a memory, by use of its associated memory address.

Retrieving a Variable's Memory Address

OK, enough talking and let's get down to the pointer business. To retrieve a variable's memory address, we need to use address-of operator &.

#include <iostream>
int main()
{
using namespace std;
// Declare an integer variable and initialize it with 99
unsigned short int myInt = 99;
// Print out value of myInt
cout << myInt << endl;
// Use address-of operator & to print out
// a memory address of myInt

cout << &myInt << endl;

return 0;
}

OUTPUT:

99
0xbff26312

The first line of the output contains an integer value 99 and on the second line, there is a memory address of myInt printed out. Please note that your output will be different.

 

Assigning a Variable's Memory Address to a Pointer

Before we can assign a memory address to a pointer, we need to declare one. Declaring a pointer in C++ is as simple as to declare any other variable with one single difference. Asterix symbol " * " needs to be add and located after variable type and before a variable name. One rule has to be followed when assigning memory address to a pointer: pointer type has to match with variable type it will point to. One exception is a pointer to void, which can handle different types of variables it will point to. To declare a pointer pMark of type unsigned short int a following syntax is to be used:

#include <iostream>

int main()
{
using namespace std;

// Declare and initialize a pointer.
unsigned short int * pPointer = 0;
// Declare an integer variable and initialize it with 35698
unsigned short int twoInt = 35698;
// Declare an integer variable and initialize it with 77
unsigned short int oneInt = 77;
// Use address-of operator & to assign a memory address of twoInt to a pointer
pPointer = &twoInt;
// Pointer pPointer now holds a memory address of twoInt

// Print out associated memory addresses and its values
cout << "pPointer's memory address:\t\t" << &pPointer << endl;
cout << "Integer's oneInt memory address:\t" << &oneInt << "\tInteger value:\t" << oneInt << endl;
cout << "Integer's twoInt memory address:\t" << &twoInt << "\tInteger value:\t" << twoInt << endl;
cout << "pPointer is pointing to memory address:\t" << pPointer << "\tInteger value:\t" << *pPointer << endl;

return 0;
}

OUTPUT:

pPointer's memory address:              0xbff43314
Integer's oneInt memory address: 0xbff43318 Integer value: 77
Integer's twoInt memory address: 0xbff4331a Integer value: 35698
pPointer is pointing to memory address: 0xbff4331a Integer value: 35698

C++ pointer example diagram

The diagram above is a high level visual abstraction of how are variables stored within a computer memory. Pointer pPointer starts at memory address 0xbff43314 and takes 4 bytes. Pointer pPointer holds as a value a memory address of a short int twoInt ( 2 bytes ) which is 0xbff4331a. This address is stored as a binary data within a pointer's memory space allocation. Therefore, dereferencing a pointer with a memory address 0xbff4331a will indirectly access a value of twoInt which is in this case a positive integer 36698.

Read more...
 
APACHE web server and SSL authentication

Author: Jaroslav Imrich


apache mod SSLThis article describes configuration techniques of module mod_ssl, which extends a functionality of Apache HTTPD to support SSL protocol. The article will deal with authentication of server (One-way SSL authentication), as well as it will also include authentication of clients by using certificates (Two-way SSL authentication).

Introduction

If you have decided to enable a SSL ( Secure Sockets Layer ) protocol on your web server it may be because you would like to extend its functionality to achieve an integrity and confidentiality for a data transferred on unsecured networks. However, this protocol with the combination of PKI ( Public Key Infrastructure ) principles can also along the side of integrity and confidentiality provide authentication between both sides involved in the client-server communication.

One-way SSL authentication allows a SSL client to confirm an identity of SSL server. However, SSL server cannot confirm an identity of SSL client. This kind of SSL authentication is used by HTTPS protocol and many public servers around the world this way provides services such as webmail or Internet banking. The SSL client authentication is done on a “application layer” of OSI model by the client entering an authentication credentials such as username and password or by using a grid card.

Two-way SSL authentication also known as mutual SSL authentication allows SSL client to confirm an identity of SSL server and SSL server can also confirm an identity of the SSL client. This type of authentication is called client authentication because SSL client shows its identity to SSL server with a use of the client certificate. Client authentication with a certificate can add yet another layer of security or even completely replace authentication method such us user name and password.

In this document, we will discuss configuration of both types of SSL authentication one-way SSL authentication and two-way SSL authentication.

Read more...
 
«StartPrev1234567NextEnd»

Page 1 of 7