How to set session timeout

Step 1: Introduction

The utmpx and wtmpx files are extended database files that have superseded the obsolete utmp and wtmp database files.
The utmpx database contains user access and accounting information for commands such as who(1), write(1), and login(1). The wtmpx database contains the history of user access and accounting information for the utmpx database.

Step 2: Create Backup of wtmpx

In order to create a backup of wtmpx first check the disk space in /tmp and then copy the file in /tmp directory

# /usr/lib/acct/fwtmp < /var/adm/wtmpx > /tmp/wtmpx.orig

Step 3: Empty wtmpx file

To empty wtmpx file us the following command

# cat /dev/null > /var/adm/wtmpx

Step 4: Zip original wtmpx file

Create a zip of original wtmpx file using gzip command

# gzip /tmp/wtmpx.orig

Step 5: Copy original wtmpx

Copy original wtmpx file in /var/adm/ for audit purpose

# cp /tmp/wtmpx.orig.gz /var/adm/

Redirect Error Output To File in Linux

In Bash shell or other advance shell there are three file descriptors and these are:

  • stdin (0)
  • stdout (1)
  • stderr (2)

Redirect all error to file

# command 2> stderr.txt

Redirect output & errors to different files

# tecdistro > stdout.txt 2> stderr.txt

Redirect output and errors to same file

# tecdistro > allout.txt 2>&1

How to Zip a file/folder

Zip a Single File

To make a zip of single file, execute the below command:

#zip file.zip file1 file2

Zip Multiple Files

To make a zip of multiple files, execute the below command:

#zip file.zip file1 file2

Zip Single Folder

To make a zip of folder/directory, execute the below command:

#zip file.zip dir1

To make a optional zip of folder/directory, execute the below command:

#zip -option file.zip dir1

CentOS & SUSE & Ubuntu Distributions

It’s Halloween week, and the big names in Linux are determined not to disappoint the trick-or-treaters. No less than three mainline distributions have released new versions this week, led by perennially-loved-and-hated crowd favorite Ubuntu.

Ubuntu 14.10, better-known by its nom de womb “Utopic Unicorn”, hit the streets last Thursday. It appears to be a mostly update release, with more of the release announcement’s ink devoted to parent-company Canonical’s than to Utopic’s “latest and greatest open source technologies”. Among those, the v3.16 kernel has been included, as well as updated versions of GTK, Qt, Firefox, LibreOffice, Juju, Docker, MAAS, and of course, Unity. Full details can be found in the official release notes.

Not to be outdone, the chameleons at SUSE have released their first new version in five years, SUSE Linux Enterprise 12. SUSE 12’s grandest new features appear to be a universally-available full system rollback, and live kernel patching, the height of innovation…in 2009. The release also includes the — shall we say, “much discussed” — a variety of system-specific improvements, and a new customer control centre for managing the proprietary bits of SUSE’s system.

Speaking of proprietary bits, Tuesday also brought a new version of CentOS, the de-proprietarified version of Red Hat Enterprise Linux. Highlights of the CentOS 6.6 release include:

  • Enhanced SCSI unit attention handling to enable responding to certain unit commands.
  • The OpenvSwitch module is now available as a kernel module.
  • keepalived and haproxy are now fully supported.
  • Support added for the Intel Wildcat platform.
  • OpenJDK 8 has been added as technology preview.

According to CentOS developer Johnny Hughes, “There are many fundamental changes in this release, compared with the past CentOS-6 releases, and we highly recommend everyone study the upstream Release Notes as well as the upstream Technical Notes about the changes and how they might impact your installation.”

And, not to ignore the smaller side of the distro world, this week saw the release of not one but three new versions of Puppy Linux. First out of the kennel was built from packages in the Ubuntu 14.10 repositories. Following that were Tahrpup 6.0 CE, built from Ubuntu 14.04, and a 64-bit version of Puppy based on Linux From Scratch which uses Slackware-style packages.

Top 10 Linux Distributions

Linux is omnipresent, even if you don’t realize it. I have been using Linux as my only OS since 2005 and with every passing year I come to realize that it has much more to offer than I initially, back in 2005, understood. There is something for everyone. In this article, I have picked some of the best Linux distros to help you get the job done.

1. Linux Mint

Linux Mint, a distribution based on Ubuntu, was first launched in 2006 by Clement Lefebvre, a French-born IT specialist living in Ireland. Originally maintaining a Linux web site dedicated to providing help, tips and documentation to new Linux users, the author saw the potential of developing a Linux distribution that would address the many usability drawbacks associated with the generally more technical, mainstream products. After soliciting feedback from the visitors on his web site, he proceeded with building what many refer to today as an “improved Ubuntu” or “Ubuntu done right”.

2. Ubuntu

The launch of Ubuntu was first announced in September 2004. Although a relative newcomer to the Linux distribution scene, the project took off like no other before, with its mailing lists soon filled in with discussions by eager users and enthusiastic developers. In the years that followed, Ubuntu grew to become the most popular desktop Linux distribution and has greatly contributed towards developing an easy-to-use and free desktop operating system that can compete well with any proprietary ones available on the market.

3. Debian

Debian GNU/Linux was first announced in 1993. Its founder, Ian Murdock, envisaged the creation of a completely non-commercial project developed by hundreds of volunteer developers in their spare time. With sceptics far outnumbering optimists at the time, it seemed destined to disintegrate and collapse, but the reality was very different. Debian not only survived, it thrived and, in less than a decade, it became the largest Linux distribution and possibly the largest collaborative software project ever created!

4. Mageia

Mageia might be the newest distribution on this list, but its roots go back to July 1998 when Gaël Duval launched Mandrake Linux. At the time it was just a fork of Red Hat Linux with KDE as the default desktop, better hardware detection and some user-friendly features, but it gained instant popularity due to positive reviews in the media. Mandrake was later turned into a commercial enterprise and renamed to Mandriva (to avoid some trademark-related hassles and to celebrate its merger with Brazil’s Conectiva) before almost going bankrupt in 2010. It was eventually saved by a Russian venture capital firm, but this came at a cost when the new management decided to lay off most of the established Mandriva developers at the company’s Paris headquarters. Upon finding themselves without work, they decided to form Mageia, a community project which is a logical continuation of Mandrake and Mandriva, perhaps more so than Mandriva itself.

5. Fedoro

Although Fedora was formally unveiled only in September 2004, its origins effectively date back to 1995 when it was launched by two Linux visionaries — Bob Young and Marc Ewing — under the name of Red Hat Linux. The company’s first product, Red Hat Linux 1.0 “Mother’s Day”, was released in the same year and was quickly followed by several bug-fix updates. In 1997, Red Hat introduced its revolutionary RPM package management system with dependency resolution and other advanced features which greatly contributed to the distribution’s rapid rise in popularity and its overtaking of Slackware Linux as the most widely-used Linux distribution in the world. In later years, Red Hat standardised on a regular, 6-month release schedule.

6. Open Suse

The beginnings of openSUSE date back to 1992 when four German Linux enthusiasts — Roland Dyroff, Thomas Fehr, Hubert Mantel and Burchard Steinbild — launched the project under the name of SuSE (Software und System Entwicklung) Linux. In the early days, the young company sold sets of floppy disks containing a German edition of Slackware Linux, but it wasn’t long before SuSE Linux became an independent distribution with the launch of version 4.2 in May 1996. In the following years, the developers adopted the RPM package management format and introduced YaST, an easy-to-use graphical system administration tool. Frequent releases, excellent printed documentation, and easy availability of SuSE Linux in stores across Europe and North America resulted in growing popularity for the distribution.

7. Arch Linux

The KISS (keep it simple, stupid) philosophy of Arch Linux was devised around the year 2002 by Judd Vinet, a Canadian computer science graduate who launched the distribution in the same year. For several years it lived as a marginal project designed for intermediate and advanced Linux users and only shot to stardom when it began promoting itself as a “rolling-release” distribution that only needs to be installed once and which is then kept up-to-date thanks to its powerful package manager and an always fresh software repository. As a result, Arch Linux “releases” are few and far between and are now limited to a basic installation CD that is issued only when considerable changes in the base system warrant a new install media.

8. CentOS

Launched in late 2003, CentOS is a community project with the goals of rebuilding the source code for Red Hat Enterprise Linux (RHEL) into an installable Linux distribution and to provide timely security updates for all included software packages. To put in more bluntly, CentOS is a RHEL clone. The only technical difference between the two distributions is branding – CentOS replaces all Red Hat trademarks and logos with its own. Nevertheless, the relations between Red Hat and CentOS remain amicable and many CentOS developers are in active contact with, or even employed directly by, Red Hat.

9. PCLinuxOS

PCLinuxOS was first announced in 2003 by Bill Reynolds, better known as “Texstar”. Prior to creating his own distribution, Texstar was already a well-known developer in the Mandrake Linux community of users for building up-to-date RPM packages for the popular distribution and providing them as a free download. In 2003 he decided to build a new distribution, initially based on Mandrake Linux, but with several significant usability improvements. The goals? It should be beginner-friendly, have out-of-the box support for proprietary kernel modules, browser plugins and media codecs, and should function as a live CD with a simple and intuitive graphical installer.

10. FreeBSD

FreeBSD, an indirect descendant of AT&T UNIX via the Berkeley Software Distribution (BSD), has a long and turbulent history dating back to 1993. Unlike Linux distributions, which are defined as integrated software solutions consisting of the Linux kernel and thousands of software applications, FreeBSD is a tightly integrated operating system built from a BSD kernel and the so-called “userland” (therefore usable even without extra applications). This distinction is largely lost once installed on an average computer system – like many Linux distributions, a large collection of easily installed, (mostly) open source applications are available for extending the FreeBSD core, but these are usually provided by third-party contributors and aren’t strictly part of FreeBSD.

Linux World

The history of Linux began in 1991 with the commencement of a personal project by Finnish student Linus Torvalds to create a new free operating system kernel. Since then, the resulting Linux kernel has been marked by constant growth throughout its history. Since the initial release of its source code in 1991, it has grown from a small number of C files under a license prohibiting commercial distribution to the 3.18 version in 2015 with more than 18 million lines of source code under the GNU General Public License

In 1991, in Helsinki, Linus Torvalds began a project that later became the Linux kernel. He wrote the program specifically for the hardware he was using and independent of an operating system because he wanted to use the functions of his new PC with an 80386 processor. Development was done on MINIX using the GNU C compiler. The GNU C Compiler is still the main choice for compiling Linux today. The code however, can be built with other compilers, such as the Intel C Compiler.

As Torvalds wrote in his book Just for Fun,[10] he eventually ended up writing an operating system kernel. On 25 August 1991 (age 21), he announced this system in a Usenet posting to the newsgroup “comp.os.minix.”:

Hello everybody out there using minix –

I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).

I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them 🙂

Linus (torvalds@kruuna.helsinki.fi)

PS. Yes – it’s free of any minix code, and it has a multi-threaded fs. It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that’s all I have :-(.

—Linus Torvalds