dnspython provides a detailed interface into DNS. In its simplest form, it’s possible to perform queries in only a couple of lines of code. Here’s a commented example:
import dns.resolver #import the module myResolver = dns.resolver.Resolver() #create a new instance named 'myResolver' myAnswers = myResolver.query("google.com", "A") #Lookup the 'A' record(s) for google.com for rdata in myAnswers: #for each response print rdata #print the data
The results in my case are:
By using nc(Netcat) command we can check if a port in remote machine is opened or closed.
Here is an example to check if remote port is opened or closed:
STATUS=$(nc -z you_remote_host 80 ; echo $?)
if [ $STATUS -eq 0 ]
echo "Port is opened"
echo "Port is opened"
To get previous command status in bash use “$?” variable.
echo $? will return zero if previous command is success & if its non zero it indicates failure.
$ ls ; echo $?
Output of the above command is list of files, directories and next line it will return number.
We can use condition for check if previous command is success or failure:
Depending on the size of the databases you have in mysql innodb the time it takes mysql to restart can be horribly slow (for very big innodb databases). There are some tricks that can speed this up, but the most effective one that I’ve found and use all the time in similar situations is to pre-flush the dirty pages right before shutdown; this can be done like this:
You didn’t make it to this year’s Xen Project User Summit in New York City? Or you didn’t catch all the sessions you wanted to see because of scheduling conflicts (it happens when you have too much of a good thing…)? Don’t fret; you can catch up on the action on a computer, tablet, or phone near you!
On one of my personal laptops (Dell Inspiron 17R), my attempts at using the function key combinations to change the brightness did not yield any results on Fedora 20, Linux Mint 17, or Ubuntu 14.10. The LCD brightness was stuck at "can barely see, but must conserve battery because I'm stuck on an island mode" (not a real setting, but might as well be).
The system has an integrated Intel graphics card, and if you're not sure what your system has you can check it here:
Run the command below in terminal to know what video card is used for the backlight/brightness:
The Web Server Gateway Interface (WSGI) is a standardized interface
between web servers and Python web frameworks or applications. Many
frameworks including Django support WSGI.
This post is a brief how-to about configuring Apache's mod_wsgi
with Python's cx_Oracle driver for Oracle Database. The steps are for
Getting your storage repositories right is one of the more important aspects of planning and deploying Oracle VM. Throwing everything into one or two different storage repositories is not very robust nor is it conducive to backups, routine maintenance, high availability or disaster recovery. Conversely, allocating a storage repository for each individual Oracle VM guest is not scalable or practical.