Posts

Showing posts with the label configure

Running multiple test suites using maven-karma-plugin

The maven-karma-plugin allows running your jasmine tests via karma from maven. For the most part, the documentation given in the readme.md at  https://github.com/karma-runner/maven-karma-plugin  is sufficient if you just want to run unit tests using karma. However, if you want to use the karma to run your unit tests as well as your e2e tests, you need to specify it in your pom.xml in a slightly different way. Firstly, the <configuration /> goes inside an <execution /> . Then every <execution /> needs to have an <id /> which should be unique. <plugin>     <groupId>com.kelveden</groupId>     <artifactId>maven-karma-plugin</artifactId>     <version>1.1</version>     <executions>         <execution>             <id>unit</id>             <goals>       ...

Upgrading maven-jetty-plugin for Jetty 8 to use Servlet 3.0

When moving from Jetty 6 to Jetty 8, one of the biggest changes is the jump from Servlet version 2.5 to version 3.0. There is also a change in the JSP version which was 2.0 in Jetty 6.x while it is JSP 2.1 in Jetty 8.x. Keeping that in mind, the dependency for the servlet api needs to be configured to use Servlet 3.0 jars. This should have been sufficient if it wasn't for a change in "maven-jetty-plugin" also. Up to versions 6.x of the maven-jetty-plugin are available under the artifactId of "maven-jetty-plugin". So running, mvn jetty:run with the following in your pom.xml would be sufficient. <plugin>   <groupId>org.mortbay.jetty</groupId>   <artifactId>maven-jetty-plugin</artifactId> </plugin> But if you try to do that with Servlet 3.0, you would end up with a java.lang.ClassNotFoundException for javax.servlet.ServletRegistration$Dynamic.class This is because for jetty 7 and above, the artifactId for the plugin is "jet...

Login remotely to a ADS authenticated RHEL system

This week I was trying to get an RHEL system to authenticate me using my Active Directory credentials. After a bit of looking around, I cam across this wonderful step-by-step procedure to get it done: Attaching a RHEL6 server install to Active Directory for authentication Everything was going on well. I was able to do a local login using: ssh myuser@MYDOMAIN@localhost I just thought it might be cool to try logging in to my newly configured ADS authenticated box over SSH from another machine. So I tried, ssh myuser@MYDOMAIN@192.168.0.1 which obviously didn't work. The shell was treating "MYDOMAIN@192.168.0.1" as the hostname. With a little bit of playing around I found out that the following worked: ssh "MYDOMAIN\myuser"@192.168.0.1 It looks like specifying the domain the way usually Windows expects it really did work if it was enclosed in quotes!

500 Internal Server error with codeigniter mysql connection

I was trying out CodeIgniter  today. I found it quite lightweight and easy to get started with. MVC was fine until I came across a strange issue. Every time I tried to connect to the database, I would end up getting the infamous "500 Internal server error". Unfortunately, even after checking through all http logs, I was not able to trace it to anything that could've gone wrong. I had apache, php, mysql installed and configured correctly. Spent about 4 hours trying out different configurations, playing around with the database names, model names, etc, just to realise later that I did not have the php-mysql driver installed! This time I was on an ubuntu machine, so I had to: apt-get install php5-mysql and then although I could see that apt-get had already restarted apache2 for me, I just thought of doing it myself as well, service apache2 restart and there it was. Everything was working the way I wanted it to be. It was a very silly thing to miss out on this one. I have don...

Moving a storage pool in Virt Manager/Qemu

Today, I had to move my storage pool in Qemu to some other partition due to low disk space on my root partition. I decided to move it to a directory in my /home partition (I'm used to allocating most of my disk space to the /home partition). First of all, we need to stop libvirtd. /sbin/service libvirtd stop Next, we should move the storage pool to the new location. By default the storage pool is located at /var/lib/libvirt/images . I choose to move it to the directory /home/ausmarton/vm . mv /var/lib/libvirt/images /home/ausmarton/vm Any storage pool that is configured, has an xml file created for itself in /etc/libvirt/storage . So, in our case, we just need to edit the file /etc/libvirt/storage/default.xml . Here, we need to edit the path element which comes under the target element. <path>/var/lib/libvirt/images</path> Now that line should look something like this: <path>/home/ausmarton/vm</path> I would like to point out that /etc/libvirt/storage/ a...

Errors while trying to monitor Asterisk through Nagios

Today, I was trying to configure nagios to monitor an asterisk setup. I installed the nagios-plugins-check_sip plugin available for CentOS. I also had check_asterisk downloaded from here just to try out both. Now, check_asterisk and check_sip are perl scipts which can be used to monitor an asterisk setup. When run through the command line, they seem to work fine, i.e: given that asterisk or any other sip server is listening and your command is correct, you should get output similar to this: ;SIP/2.0 200 OK, 0.000585 seconds response time, cnt=1 Although, that's exactly what I got, it didn't work the same way through nagios, I was getting the following as the output from the plugin. (Service check did not exit properly) After enabling debug info for nagios, I found this in the logs, HOST: remotehost, SERVICE: Asterisk, CHECK TYPE: Active, OPTIONS: 1, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: No, RETURN CODE: 3, OUTPUT: **ePN failed to compile /usr/lib64/nagios/plugins/chec...

Configuring remote access for couchdb

By default, CouchDb is configured to be access only from a local port, i.e: you can connect to a couchdb instance as long as it is on the same host. Also, it is necessary that the HTTP request be made using the loopback IP address (127.0.0.1). In case you want to be able to access a couchdb instance from an external machine, you need to make some changes to the couchdb configuration. Note that you would need to have superuser access in order to make changes to these files. Usually couchdb will have two configuration (ini) files in /etc/couchdb depending on your installation. Both these files (default.ini and local.ini) can be used to enable remote hosts to access couchdb. The configuration required for this is: [httpd] port = 5984 bind_address = 0.0.0.0 By default the configuration would be: [httpd] port = 5984 bind_address = 127.0.0.1 This means that the Http server is bound only to the loopback IP address, which is why we change it to 0.0.0.0 to make it bind to any IP address. If...