Assume you have a complex bash script named 'run_q.sh' (containing good number of loops, Awk statements, multiple lines of code etc) that you need to run against one or more remote servers via SSH. One way would be to copy (i.e. scp) the script to the remote server(s) and then do something like this: e.g. $ scp -2 run_q.sh email@example.com:/tmp/.$ ssh -2 firstname.lastname@example.org sh /tmp/run_q.sh
By using is isinstance(var, type) function we can check a given value/variable is integer or not. isinstance will either written True or False.
Here is and an example:
>>> isinstance(10, int)
>>> isinstance(var_a, int)
>>> isinstance('a', int)
To check if variable is a number use following example:
To get epoch time stamp in Python we need to time.time() function.
time.time() will returns a float value with double precision counting seconds since epoch and to convert it to milliseconds multiply it with 1000.
With below example code I will show how to get epoch time stamp in milliseconds:
>>> import time
>>> int(time.time() * 1000)
In above example int(time.time() * 1000) will return epoch time in milliseconds.
When you initially install Linux, you specify the machine's timezone. After the install, you can manually change the timezone. The following procedure applies to Debian and Ubuntu systems. Before you change the timezone, let's find out what timezone your system is currently in. $ dateTue Dec 2 13:53:11 PST 2014
If you use rsyslog's devel packages on your system, you will receive errors soon. Be sure to read the complete posting to avoid trouble!As part of rsyslog's new release schedule and version naming, devel releases will no longer be named according to the "normal" numbering scheme. This also means that the previous "devel" branches will disappear, as git master branch now is the always-current devel version.
With today's release of rsyslog 8.6.0, we start a new release schedule and versioning scheme. In a nutshell, we will be doing stable releases every six weeks now, and devel releases will be distributed via git exclusively.