Tuesday, April 29, 2014

Coding Python (Pydev) on Ubuntu 12.04 with Eclipse Juno

A short blog post. After having installed the latest pydev on the newest eclipse juno, I found that python would not work. All the relevant buttons for python development did not appear, even though the software manager reported that pydev was installed. As such, to get both working correctly I had to do the following:

  1. Following this guide, http://www.vogella.com/articles/Python/article.htmlH as far as installing pydev. However, do not go any further as installing pydev 3.0 didnt seem to work. Niether did it work on Eclipse kepler 4.0.3. A similiar issue was reported here: http://stackoverflow.com/questions/19916925/problems-downloading-artifact-error-reading-signed-content
  2. As such, when eclipse is installed, go to help-> install new software. For the source, type: “http://pydev.org/updates”. 
  3. Uncheck “show only the latest versions of available software”. 
  4. Select Pydev for Eclipse version 2.8.2.
  5. Works!

Monday, April 28, 2014

Correcting incorrect time-offset on an Ubuntu server

Here is a quick post on a solution to an issue that affected my Ubuntu server. I noticed that me cron jobs were getting executed about a hour or two later than they were set to run at. Logging into the server and running the command "date" confirmed what I easily suspected: that the clock was off by 1h 45min.

Running the command:
$sudo ntpdate
to update the clock returned the error
ntpdate - no servers can be used, exiting.
So then I ran the command
$sudo ntpdate 0.uk.pool.ntp.org"
which returned the following:
28 Apr 14:28:40 ntpdate[23357]: step time server 109.123.121.128 offset 2311.837165 sec.
Great, I thought, problem solved. Unfortunately not. When I ran the command "date" again, the server was still off by an hour:
$date
Mon Apr 28 14:33:45 UTC 2014.
It was actually 15.33. Suspecting an issue with Daylight Savings Time (DST) was the issue, or to be more specific, that the server wasnt using it, I looked to enable it. A quick Google informed me that an Ubuntu installation gets its DST settings from knowledge of its physical location, and the time server that it is conencted to. I had already configured it to use a suitable time server with the command "$ sudo ntpdate 0.uk.pool.ntp.org", so I had to reconfigure its location from the terminal. To do this, run the following command:
$sudo dpkg-reconfigure tzdata
You will be presented with a terminal GUI. Select your locality. Then when completed, you will be greeted by the updated time: 
Current default time zone: 'Europe/Dublin'
Local time is now:      Mon Apr 28 15:33:45 IST 2014. Universal Time is now:  Mon Apr 28 14:33:45 UTC 2014.
Running "date" now confirms the corrected time:
$date
Mon Apr 28 15:33:56 IST 2014

Problem solved!