blog buckett

Monday, March 19, 2012

Random Skype Disconnections

Recently I'd started having problems with Skype disconnecting several minutes into a call and losing internet access in other applications as well. This initially was only happening with Skype on the iPad so I put it down to bugginess on the iOS version of Skype crashing the router or something on the iPad, however I just had the same disconnection symptoms after about 5 minutes of a video call on my Mac. This time I went to the router's administration page and found that the router (Speedtouch ST780) hadn't recently rebooted but in the event log it said:

Mar 19 22:04:10IDS dos parser : udp flood (1 of 1) : 192.168.1.69 80.229.225.26 1018 UDP 65177->45237

Now this tied in exactly with the time of the call dropping so it looks like Skype is triggering the udp flood detection on the router. There isn't a simple way to disable this through the web interface. So you have to telnet to the router and issue the commands:


ids config state=disabled
saveall


which disables the intrusion detection system. I'm not too worried about this as the router doesn't have any real services listening on it's WAN IP and I trust all the internal clients. Anyway, hopefully problem solved for now.

Saturday, December 31, 2011

General Logging in MySQL



I was looking to investigate some connection problems we were having to a MySQL database and wanted to be sure that the client was connecting to correct machine. MySQL 5.1 doesn't provide this information on it's own, but it is contained in the general log. However the log contains all statements executed against MySQL so will have a performance impact on a production machine. The general log can be enabled/disabled while MySQL is still running which means you can enable the logging, capture the events your interested in and then disable it again. Todo this connect to MySQL as a user who can set GLOBALS (typically root) and run:

mysql> SET GLOBAL general_log_file='/var/log/mysql.log';
Query OK, 0 rows affected (0.00 sec)

mysql> SET GLOBAL general_log = 1;
Query OK, 0 rows affected (0.00 sec)

Then the file /var/log/mysql.log should start filling up with statements. Once your done disable the general log:

mysql> SET GLOBAL general_log = 0;
Query OK, 0 rows affected (0.01 sec)

In my case I was looking for connection messages so a simple grep pulled out the lines I was interested in:

grep Connect /var/log/mysql.log | less

Tuesday, June 01, 2010

Using a maven SNAPSHOT plugin from repository.apache.org

I was working on a project and hitting a bug in the maven eclipse plugin which was causing the JRE to be placed incorrectly in the Eclipse .classpath. If it was just a single project I'd have gone and edited the resulting file manually but it affected a few, so I thought I'd try and grab a newer copy of the maven eclipse plugin. I did this by first adding a profile to my maven setttings.xml file ($HOME/.m2/settings.xml on UNIX).

<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

   <profiles>

     <!-- This is the additional bit you need -->
     <profile>
       <id>apache-plugin-snapshots</id>
       <pluginRepositories>
         <pluginRepository>
           <id>apache-snapshots</id>
           <name>Apache Snapshot Repository</name>
           <url>https://repository.apache.org/content/groups/snapshots-group/</url>
           <releases>
             <enabled>false</enabled>
           </releases>
           <snapshots>
             <enabled>true</enabled>
           </snapshots>
         </pluginRepository>
       </pluginRepositories>
     </profile>

   </profiles>

</settings>

and then run the mvn eclipse command:

mvn -Papache-plugin-snapshots org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT:eclipse

which downloaded the newer plugin and then ran it against the project I had checked out.

Monday, March 23, 2009

Java host caching (sun.net.inetaddr.ttl/networkaddress.cache.ttl) on OS X

On my Mac OS X box I was trying to get some round robin DNS working from Java (1.5) but I was the host was always resolving to the same IP. I'd set sun.net.inetaddr.ttl=0, but that didn't seem to help. It seems out of the box a Mac will cache lookups, but you can clean out the cache with the command dscacheutil -flushcache

Monday, February 02, 2009

gitweb - 500 - HEAD ref not found for project

We have some git repositories here at Oxford and a gitweb interface to view them. For some of our projects I was seeing:

500 - HEAD ref not found for project

It turns out this was because the HEAD file ( {git-directoy}/HEAD ) was pointing to ref: refs/heads/master and these projects didn't have a master branch. Changing the HEAD file to point to the correct branch fixed gitweb.

Thursday, January 22, 2009

Trimpath error "context._MODIFIERS is undefined"

I was doing a little JavaScript templating with Trimpath today and at one point I was getting a nice error in my console of:

context._MODIFIERS is undefined

Looking through the trimpath code it turned out this was because I was passing in a string rather than an object as my context for the generation of the template. So I was effectively doing:

TrimPath.processDOMTemplate("someNodeId", "some string");

rather than:

TrimPath.processDOMTemplate("someNodeId", {key: "value", otherKey: "value"});

In my case I was getting the error because I forgot to eval some JSON before passing it to trimpath.

Wednesday, December 24, 2008

Pooling in Sakai LDAP

Here at Oxford we connect to a LDAP server to get details about users for our Sakai service. Previously we had reports of some pages taking a long time to load when lots of users details where requested from the LDAP. One obvious change we could make was to switch to use pooling on our connections to the LDAP server. To check that this was improving the performance I wrote a little test case which attempts to get details about 100 users individually from the LDAP.
  • Without pooling - 100 users in 10 sec = 10 users/sec.
  • With pooling - 100 users in 5 secs = 20 users/sec.
This is a nice doubling of performance, although I was still expecting to see better performance generally and while the test is running the local load on the machine isn't very high so I suspect any further performance improvements will have to come on the server.