Blog / Sysadmin

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

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

sudo apt-get install ntp<br>

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

vi for Windows

October 6, 2010

You’re probably asking “Why in the world would I want to use viin Windows?”

Well, I didn’t have an answer to that until a couple of days ago. I was testing a software that seems to have been originally designed for UNIX and ran into an issue modifying a configuration file. I needed to add an entry to the config file so I used Notepad to do it but when I tried starting the …

How to change the TIME-WAIT delay and the highest source port number that can be assigned in Windows XP or Windows Server 2003

September 15, 2010

We ran into an issue last night where a web server we use for testing wasn’t able to open anymore connections. It turned out that our web application was creating too many connections too fast and Windows ran out of port numbers to allocate.

By default, Windows XP and Windows Server 2003 (not sure about other versions of Windows) wait 4 minutes before releasing sockets in TIME-WAIT state (RFC 793) and the highest …