Oct 26, 2014 in the Russian Federation time zone switching to whinter time will happiened.

The following command help to check is correct time zone patch installed:

# perl -e 'print scalar(localtime(1414305000))."\n"'

If patch is installed:

Sun Oct 26 09:30:00 2014

If not:

Sun Oct 26 10:30:00 2014

This is true for hosts with Moscow time zone set.
This checked on HP-UX, Solaris, AIX UNIXes and on RHEL, Debian Linuxes.


Store and run ex: commands in text file

Wed 25 June 2014 by Mikhail Basov

It is possible to store any ex: commands in text file and then execute them.
For example. I want to periodically insert current content of some file in other text file.

read more

Selectively set 'execute' permission for directories.

Mon 02 June 2014 by Mikhail Basov

Task:

Recursively change permissions:
user:
rwx - for directories
rw - for files
group:
rx - for directories
r - for files
other:
rx - for directories
r - for files

Solution:

chmod -R u+rwX,go+rX,go-w /directory

Explanation:

Quote from HP-UX chmod man page about 'X' (capital X) option:

X    Conditionally add ...
read more

Copy directory tree with access rights but without files

Tue 15 April 2014 by Mikhail Basov

To copy only directory structure with access rights from current directory (./) to target directory (../test1) issue the following command:

read more

Force Linux user to change password

Tue 15 April 2014 by Mikhail Basov
usermod -L user # lock user
chage -d 0      # set password expired
usermod -U user # unlock user

('chage' - change adge)

read more

Redirect STDERR to STDOUT and then to file

Thu 10 April 2014 by Mikhail Basov

How to redirect STDERR to STDOUT and then redirect to file?

some_tool >file.txt 2>&1
read more