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! 


Tuesday, January 7, 2014

Repairing intermittent wifi/wireless on a 15" Macbook Pro 2011

From reading a couple of articles on this site, you may have noticed that although I may be critical of some Apple goods, in general, I am a fan. However, there are some times that I am extremely fustrated when their hardware breaks, such as when my MacBook Pro 15" wifi decided to start acting abnormally. For reference, it have a Macbook Pro 15" Unibody Early 2011 (Released February 2011 2.2 GHz Quad-core Intel Core i7 Processor, thunderbolt, Broadcom BCM94331PCIEBT4AX wifi/bluetooth card)




The issue
After a while of use, the wireless internet dies. The signal strength indicator fan in the top right corner still indicates five full bars. Right Clicking on the icon and clicking on "Turn wi-fi off" makes the fan icon go blank as it should, but the previously connected to network remains in the list check marked, which it shouldnt. All other wifi networks in the area disappear from the list. The status at the top of the drop down box says "Wi-Fi: looking for networks".
Right clicking on the icon and clicking on "Turn wifi-off" makes the icon go blank, as it should. Right-clicking on the icon and clicking on "Turn Wifi-On" does not enable the wifi. The fan icon stays blank, which it shouldn't. The previously "connected to" network remains check marked, but there is no connection to the internet.
Putting the laptop to sleep with the lid and waking it again results in five faded bars, but now no wifi networks can be found, and there is no connection to the internet. The issue occurred round once a day at the beginning. By saving my work and rebooting the laptop, the issue has been manageable. However, it became unmanageable when it occurred more and more often to the point where I had to save my work reboot my laptop every 1-2 hours of use.

What I tried to do to repair the issue

  1. Reboot the laptop. A temporary solution is to reboot the laptop, in which the wifi performs as it should until the issue occurs again.
  2. Use a USB dongle. A semi permanent solution was for me to buy a Ralink usb wifi adapter, that worked fine but was not ideal. It felt a bit ridiculous and cumbersome to have to use a $10 usb adapter to repair a Macbook Pro that cost $2000.
  3. Connect to a different wifi network. This did not work. The issue occurs when connected to other wifi networks, such as my parents one at home. This hinted that it was not a wireless router issue.
  4. Reset PRAM, NRAM, etc. This was only a temporary solution, as was just simply rebooting the laptop.
  5. Deleting my Airport settings files. Again, this was only a temporary solution, bus so was simply rebooting.
  6. Wiped the harddrive and installed Mountain Lion. The issue remained, even with a clean installation with no restoration of my old settings from TimeMachine. The issue was the same when I installed Lion, and Mavericks. I even noticed the same issue once with the wifi when I booted off just the OSX installation disk. As such, I believed that the the issue is hardware related.
  7. Visual inspection of the hardware. I took off the bottom cover of the laptop to see if there are any visually obvious loose connections, but there are none.
  8. Took the laptop to an authorised Apple Repair Center. They did nothing. As it was an intermittent issue, they said that the wifi was working fine when they ran their DVD of hardware tests. As far as I know, they don't do any long-term tests, even though I had requested them to do so. They blamed the wireless router (which I knew was not an issue, see above) and mu wifi settings (which I also knew was not an issue, see above).
  9. Replaced the wifi card. This did not work. I bought a new Broadcom BCM94331PCIEBT4AX for around $35 off eBay. Following a guide on ifixit, http://www.ifixit.com/Guide/MacBook+Pro+15-Inch+Unibody+Early+2011+AirPort-Bluet ooth+Cable+Replacement/5887 I replaced the card easily enough. It was just around 10 screws in total, easily manageable in an hour if you take your time. Unfortunately, the issue returned again after a few hours of use. 
  10. Replaced the motherboard, and the screen. I assume means that the wifi antennas got replaced. This did not work. On an unrelated issue with the graphics card, Apple agreed to replace the motherboard, LVDS, and LCD screen out of warranty (really good of them). Unfortunately, their authorised repair center took nearly 6 months to do the repair (again, they were a bad representation of Apple). Unfortunately, the wifi issue returned once again after a few hours of work.


What repaired it in the end
Finally, in a last ditch attempt, and as it seemed to be the only part in the laptop not replaced (including software), I bought a replacement wifi/bluetooth cable off ebay for around $30. This worked! It has been going strong now for nearly three weeks with no drop in wifi. It was pretty expensive for a simple black ribbon cable but I am glad that it worked. There was no visual damage to the old cable, but I suspect myself that the bottom cover may have pinched the cable against some edge near the motherboard, thus causing the intermittent drop-off in wifi.

Update 20/01/2013 : I have re-opened the laptop to inspect the location of the ribbon cable (Figure 1). In (Figure 2) you can see the point on the rear of bottom cover (2) that places pressure on the end of the ribbon cable. You can see that there is a visible imprint on the plastic foil covering the back of where they are in contact. Due to the level of imprint and its location, I suspect that this causes excess pressure on the cable connector when the laptop receives knocks from the underside.

Figure 1: The faulty macbook wifi cable is shown in (1). The point on the back cover that I suspect may have been putting too much pressure on the ribbon cable is located at (2)

Figure 2: The point on the rear of bottom cover (2) that places pressure on the end of the ribbon cable. You can see that there is a visible imprint on the plastic foil covering the back of where they are in contact. Due to the level of imprint and its location, I suspect that this causes excess pressure on the cable connector when the laptop receives knocks from the underside.