Posts

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...

Accents in Windows 8 on a Mac

Having been used to the Compose Key in Linux, I was trying to find out a way to type Portuguese (accented) characters in Windows 8 installed on a Macbook Pro. After reading up about the Dead key and use of AltGr key, I started experimenting with different key combinations. My keyboard layout was set to US (English). While playing around with different keys, I just found out that you could use the left "control" key in almost the same way as you would use the "Compose Key" on Linux. For example,   <Ctrl>` a  gives you,   à  While using the control key, do mind the fact that in many instances, "CTRL"+<some aplhabet> are bound to some default actions, like <CTRL>+o opens a new file, etc. Well, that seems to work well only in the address bar of Chrome. So, next I figured that you can actually use others keys as well instead of just the <Ctrl> key if you change your keyboard layout to US-International Keyboard layout. <Alt> + ...

Backslashes and MinGW32

I was trying to create a directory today inside an existing directory in MinGW32 on Windows 8. When I tried executing the following command, mkdir code\project it just didn't complain about anything, but it did create a directory - not exactly the way I intended it to. It created a directory "codeproject" by simply stripping off the backslash from the command. If you still need to use backslashes only, then you should enclose the path in quotes like, mkdir "code\project" else, you could use forward slashes instead of backslashes.

Proxy Error 502 “Reason: Error reading from remote server” with Apache 2.2.3

I had a setup of tomcat running on port 8080 and Apache proxying for tomcat on port 80. If I tried to access webapps directly from tomcat on port 8080,. they were accessible, while on port 80, I would get the followig error: Proxy Error 502 “Reason: Error reading from remote server” with Apache 2.2.3 following fix worked: adding retry=1 acquire=3000 timeout=600 Keepalive=On after the Proxy directive in the http configuration.

jQuery UI plugin conflict with dot net's default jQuery UI

A very short note on something I came across today (I might elaborate on this later..) In a dot Net application, I found that when I tried to use the jQuery UI Autocomplete plugin, there was a conflict. The errors and messages that I came across in the console of Chrome, indicated that there was an API mismatch in the jQuery UI library and the jQuery UI Autocomplete plugin. After a bit of inspection, I found out that dot Net had it's own version of jQuery UI, which actually was a concatenation of many jQuery UI plugins along with the jQuery UI core (even though it was named as jquery-ui.js!). It was pretty straightforward to fix this - I just had to get rid of one of them, either the dot Net's version or the original jQuery UI's version. In my case, since it was a dot Net application, I thought it might be better to retain Microsoft's copy of  jQuery UI!

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...