Blog / Tech

How to sync the date and time to a time server in Ubuntu Linux (command line)

June 16, 2011

I just logged in to my Rackspace hosted virtual server running Ubuntu Linux 10.04 and noticed that the time drifted almost a couple of minutes.

Type in the command below to sync your server’s date and time to a time server (where ntp.ubuntu.com is the time server):

sudo ntpdate ntp.ubuntu.com

To automatically correct the time drifting issue in the future, you could also install the ntp daemon:

sudo apt-get install ntp

How to set the proxy settings in Windows via command line

June 11, 2011

Once in a while I need to download and install Python packages at work and having switched to Linux (Ubuntu) at home, I find it quite annoying now to have to go to a website, download the package I need, then manually install.

Fortunately, the pip installer works for Windows as well, allowing the installation of Python packages automatically with a simple command (pip install package_name). But at work, we’re behind a proxy …

How to compile and build Apache modules on Windows using Visual Studio

June 10, 2011

Over the weekend, I had to do a new build of the mod_xsendfile module since I put a custom fix for the issue I was having. As it turns out, however, compiling Apache modules on Windows is not very straightforward at all (Linux, on the other hand, you just simply type apxs2 -cia some_apache_module.c).

After lots of Googling and trying different approaches, I finally got it to work by doing the following using …

Apache 2.2: Partial results are valid but processing is incomplete, unable to stat file (X-Sendfile)

June 9, 2011

Error Message:

(70008) Partial results are valid but processing is incomplete: xsendfile: unable to stat file: //server_name/folder/file

I deployed my code to our development box over the weekend which uses the X-Sendfile module for Apache to serve files but ran into this issue when I tried to download a file. The X-Sendfile module worked fine on my local machine. The only difference I could find was our development box was running Windows XP 64-bit and …

How to convert a Java keystore (JKS) to PEM format

May 8, 2011

I’m currently working on a new project where I need to write a service to serve static files to users. Our web application currently runs on Tomcat alone as we don’t have many users (internal users only) and most of the content is dynamic. But with this new project it just seems to make sense to put an Apache web server in front of Tomcat and use the mod_xsendfile module to serve the files, which …