MySQL accepts network connections

Make sure skip-networking is commented out in my.cnf file.

Test with: netstat -antulp | grep LISTEN

tcp        0      0     *                   LISTEN      2297/snmpd          
tcp        0      0      *                   LISTEN      4485/mysqld         
tcp        0      0 :::22                       :::*                        LISTEN      2334/sshd

The mysqld entry will not be listed if MySQL is not accepting network connections.



 nmap -sR -p 1-65535 servername (RPC scan on all TCP ports)
 nmap -sR -sU -p 1-65535 servername (RPC scan on all UDP ports)

 Find hosts on a network
 nmap -sL network
 Find if host is up on a network
 nmap -sP network
 Find open TCP ports on a host without pinging and determine host OS
 sudo nmap -sT -PN -O serverIP

Cisco ASA 0 SYN Timeout

The following solution was found here:

I was having issues connecting to my load balancers and we seeing in the Cisco logs that the TCP connection was being built but then getting torn down with the following error:

Teardown TCP connection 90 for outside: to inside: duration 0:00:30 bytes 0 SYN Timeout

The syslog message indicates the connection closed because the of SYN timeout. This tells the administrator that no application X server responses were received by the ASA. Syslog message termination reasons can vary.

The SYN timeout gets logged because of a forced connection termination after 30 seconds that occurs after the three-way handshake completion. This issue usually occurs if the server fails to respond to a connection request, and, in most cases, is not related to the configuration on PIX/ASA.

Sure enough my load balancers had an incorrect default gateway!

Apache Virtual Hosts Examples

If you want multiple VirtualHosts on the same IP address and port you are going to require a NamedVirtualHost directive.

If you are configuring multiple virtual hosts on different IP addresses but all on the same port you do NOT require the NamedVirtualHost directive.

If you are configuring multiple virtual hosts on the same IP address but different ports you do not require the NamedVirtualHost directive.

NOTE: You can run a combination of all of the above if you wish!

You can specify a range of port to listen on as well.

Listen 40000:40500

Putting /etc Under Subversion (SVN)

Instructions taken from here:

A Google for the above took some work to locate the exact recipe I wanted for this. The problem is that one really needs to do an ‘in-place’ import. The solution was fromSubversion‘s own FAQs (specifically this) which is reproduced here with some changes:

# svn mkdir svn+ssh://user@host/srv/svn-repository/hosts/host1/etc \
         -m "Make a directory in the repository to correspond to /etc for this host"
# cd /etc
# svn checkout svn+ssh://user@host/srv/svn-repository/hosts/host1/etc .
# svn add *
# svn commit -m "Initial version of this host's config files"

The commit is failing due to propset eol-style errors.  To set the native svn properties for all files under etc you can run this command:

find . -type f -exec svn propset svn:eol-style native {} \;

There was a pre-commit script that was blocking uploading of files with svn:special property set.  Excluding svn:special files out of the check allowed me to commit! Sweet!

Here’s a handy script to add multiple new files to the svn repo by having installed many packages or something that would cause a bunch of files to be added to /etc.

svn st | grep "^?" | awk '{ print $2}' | while read f; do svn add $f; done
svn ci -m "Adding files after extracted tar from prod server"
svn st | grep "^A" | awk '{ print $2}' | while read f; do svn propset svn:eol-style native $f; done

To set svn:special property on a symbolic link:

svn propset svn:special native path/to/symlink

Do NOT set svn:special on actual directories or you will get an:

Svn error: .. has unexpectedly changed special status

To resolve this remove the svn:special property on all directories:

svn st | grep "^~" | awk '{print $2}' | while read f; do svn propdel svn:special $f; done

Remove a directory from subversion control

find /path/to/directory -name .svn -exec rm -rf {} \;