Tag Archives: system

Set TimeZone on Centos

CentOS update breaks another thing – the logwatch perl timezone manipulation. The exact error message is:
ERROR: Date::Manip unable to determine TimeZone.

Execute the following command in a shell prompt:
perldoc Date::Manip
The section titled TIMEZONES describes valid TimeZones and where they can be defined.

You could fix it modify /etc/localtime. You could use tzconfig command line and follow its questions or:
cp /usr/share/zoneinfo/Europe/Rome /etc/localtime
If your localtime is different, you could choose your zoneinfo in /usr/share/zoneinfo/.

Referece: fullo.net

rdate

NAME
rdate – get the time via the network
SYNOPSIS
rdate [-p] [-s] [-u] [-l] [-t sec] [host...]
EXAMPLE
rdate -s ntp0.cornell.edu

If you want syncronize date, then you could add this line into crontab:
* * * * 0 rdate -s ntp0.cornell.edu

How to add a directory to my PATH statement or variable

When you type the name of an executable file, GNU/Linux searches for that executable in all the directories specified in the PATH environment variable.
By default, your GNU/Linux distribution probably set up a default PATH variable during install. To see what your current PATH variable is set to, in a terminal window, type:
echo $PATH
and press ENTER. The system should respond by writing out the current value of the PATH variable. That probably looks something like:
/usr/bin:/usr/sbin
To add a directory to the PATH statement is a relatively straight forward process, but first a question needs to be answered:
Note that these instructions are for a bash shell which is very common n GNU/Linux systems. If you are running another shell, please consult the directions for that shell.
Which users do you want to be affected by this new PATH value?
1. In a home GNU/Linux system, it’s likely that there is only one user and therefore the answer is: me and my root account.
2. If you are running a multi-user system, then the answer is likely: everybody and root.
3. Possibly the third answer is: only ‘joe’ or some other single user on the system.
Regardless of which user(s) are to affected, the same line(s) need to be added to a profile file. The only variable is: which file?
The line(s) or code to add are:
PATH=$PATH:/directory/you/want/to/add
export PATH

NOTE: The export command need only be called once in the profile file and after all the PATH statements in that file. If an export command is already present in the applicable profile file (see below), then you need not add another one.
You are going to add these lines to the following location depending on which user(s) you want to affect:

1. To add that PATH to every user but root, add the line(s) to /etc/profile
2. To add that PATH to root, add those line(s) to /root/.bash_profile
3. To add that PATH to a specific user(s), add the line(s) to /home/user/.bash_profile

PATH=$PATH:$HOME/bin
PATH=$PATH:/home/flebber/Python
export PATH

Reference: everyjoe.com, linuxforums.org

kill

NAME
kill – send a signal to a process
SYNOPSYS
kill [ -signal | -s signal ] pid ...
kill [ -L | -V, --version ]
kill -l [ signal ]

EXAMPLE
kill -9 pidnumber

strace

NAME
strace – trace system calls and signals
SYNOPSYS
strace [ -dffhiqrtttTvxx ] [ -acolumn ] [ -eexpr ] ... [ -ofile ] [ -ppid ] ... [ -sstrsize ] [ -uusername ] [ -Evar=val ] ... [ -Evar ] ... [ command [ arg ... ] ]
strace -c [ -eexpr ] ... [ -Ooverhead ] [ -Ssortby ] [ command [ arg ... ] ]