Sunday, September 27, 2015

Installing only security updates in Ubuntu

Use the command unattended-upgrade possibly with the following syntax

#sudo apt-get install unattended-upgrades

Refer this up as well. /usr/share/doc/unattended-upgrades/

Monday, July 20, 2015

Terminal fix - desirable output

Use if clear does not work or the terminal does not show the output in the screen in a clear manner use this following command to fix this.

TERM=vt100; export $TERM

Wednesday, June 17, 2015

NTP leap second fix - Red Hat stuff

Resolve Leap Second Issues in Red Hat Enterprise Linux

Leap seconds are a periodic one-second adjustment of Coordinated Universal Time(UTC) in order to keep a system's time of day close to the mean solar time. However, the Earth's rotation speed varies in response to climatic and geological events, and due to this, UTC leap seconds are irregularly spaced and unpredictable. This article seeks to provide information regarding the leap seconds themselves, along with addressing how Red Hat Enterprise Linux handles the insertion of one.

The next leap second insertion is scheduled for June 30th, 2015 at 23:59:60 UTC.

Systems running any version of Red Hat Enterprise Linux should automatically account for leap second corrections if they are using the NTP (Network Time Protocol) daemon to synchronize their local timekeeping with an NTP server. During the last day before a leap second correction, NTP servers should notify their clients that a leap second will occur, and at 23:59:59 UTC, the Linux kernel should add or remove an extra second by making the 60th second occur twice or removing it entirely.

Tuesday, May 26, 2015

Delete the file and checking the error status - shellscript

This script uses command line arguments ($1 and  $?) and tail out the /root/error.txt file.

#usage of command line arguments
rm $1 2>>/root/error.txt
if [ $? -eq 0 ]
echo " Success "
tail -1 /root/error.txt

Sleep command - an example shell script

The following script clear screen and update the date every second. So it seems like the running digital clock.

#running digital clock
while [ : ]
sleep 1

Saturday, May 23, 2015

Simple one line script for checking the file existence.

A single line script / command to find the particular file exists or not.
# test -f a.txt && echo "File exists" || echo "File does not exist"

Simple shell script to find out the file exists or not

#simple script to find out the file exists or not
if [ -f $1 ]
echo " $1 exists "
echo " $1 does not exist"
Script usage: ./filecheck filename