Posts

Showing posts from May, 2013

Installing vmware-tools on Debian/Ubuntu

Recently I tried installing the vmware-tools package on a new Ubuntu 13.04 and also a new Debian 7 VMWare Fusion virtual machine. In both cases, the vmware-tools installed gave an error along the following lines:
Searching for a valid kernel header path...The path "" is not a valid path to the 3.2.0-4-amd64 kernel headers.Would you like to change it? [yes]  The solution to this is to install the necessary kernel headers and re-run the vmware-tools install script.
sudo apt-get updatesudo apt-get install build-essentialsudo apt-get install linux-headers-$(uname -r)

Connecting to Sydney (USYD) VPN from Ubuntu

The University of Sydney pages only list instructions for how to connect via VPN from Windows, Mac, iPhone and Android, leaving Linux users out on their own (as usual). Luckily, it's pretty easy to establish a VPN connection from Ubuntu (and other distros):

sudo apt-get install vpncsudo vpncEnter IPSec gateway address: vpn.usyd.edu.auEnter IPSec ID for vpn.usyd.edu.au: offcampusEnter IPSec secret for offcampus@vpn.usyd.edu.au: ********Enter username for vpn.usyd.edu.au: yourUnikeyEnter password for yourUnikey@vpn.usyd.edu.au:VPNC started in background (pid: 7460)... The IPSec secret for offcampus@vpn.usyd.edu.au is printed on this page (it's the same as the wireless profile).

Reduce size of PDF in Mac OSX

Sometimes you may have a scanned PDF that is a lot larger than you'd like. There's an easy way to reduce the size of these in OSX by opening the PDF with Preview, then clicking File/Export, and selecting format as PDF, and Quartz filter as Reduce File Size. Make sure you save the PDF as a new file and don't overwrite the original in case you're not happy with the result.

The default Reduce File Size filter is a little too agressive though, and the PDF ends up small, but looking terrible, with font being illegible to read. Thankfully, there's an easy way to download and install new filters which provide you with a lot more flexibility:

Download Filters.zipDouble-click to extract the archive, and you should have a "Filters" folder, with a number of files in it.Copy the files inside this folder, and paste them in Macintosh HD/System/Libraries/Filters, along side the standard default filters. Now open the PDF in Preview again, and when you Export, you'll h…

Amazon EC2 vs Google Cloud Compute Pricing

Amazon EC2 has been around for a while, and is arguably the market leader as a cloud computing service provider. It's incredibly easy to sign-up and start using your very own Virtual Private Server (VPS) in a matter of minutes, and at a very affordable price. This makes setting up a new project a breeze. Google Cloud Compute is now starting to offer similar services, enabling you to rent a VPS and use it to your liking.

The pricing can be a bit confusing though, as both Amazon and Google charge on an hourly basis. Amazon also offers renting a server on a yearly basis at a heavy discount, which works out much cheaper than paying the equivalent hourly cost for 24/7 all year round.

Google's pricing is now even more fine-grained, and you get charged on a per-minute basis, from 10 to 60 minutes per hour.

In any case, I just wanted to do a quick comparison of the costs for the lower-end instance types on both Amazon and EC2. The following table is a summary of Amazon costs:


Instance…

Apple TV 3 Airplay Mirroring Issues

Image
I've recently purchased an Apple TV 3 to replace my full-blown Windows 7 HTPC. The reasoning being that I mostly use Netflix and Hulu, with the occasional iTunes movie rental, and for this, the Apple TV is close to perfect (simple remote-control friendly interface, instant boot, low power, small form factor, 'just works').



There's still the occasional .mkv or other video that I need to watch on the big screen every now and then though, and for this I thought I'd just do 1080p Airplay mirroring from my Macbook Retina. This works ok half the time... but often my Macbook won't detect the Apple TV and Airplay is not available in the top navbar. To fix this I usually try toggling Airplay in the Apple TV settings,  and/or force-restart the Apple TV. All this usually takes a minute or two, which puts a damper on the whole "just-works" thing - it would be easier for me to physically connect the laptop to the TV via HDMI, which gives better playback performanc…

Google App Engine RuntimeError: maximum recursion depth exceeded

I recently tried to get started with Google App Engine on my Macbook. I downloaded the latest python SDK, created a new app on the app-engine site, and used the GoogleAppEngineLauncer GUI program to create a new app on localhost.

This creates a standard "Hello World" app, but when I click the Run button in GoogleAppEngineLauncer and go to localhost:8080, all I see is a blank white page.

Clicking the Logs button in GoogleAppEngineLauncher revelas an error stating:

"RuntimeError: maximum recursion depth exceeded"

Followed by a lengthy traceback:

--------------------

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengi…

Web Server abused as Proxy

One Monday morning we discovered the PostgreSQL database process had crashed on one of our Linux/Apache/PHP web-sites. We restarted the server and the site worked as normal, but we were concerned as to why the crash happened.

We started looking through all the various logs for clues. There was nothing unusual in the postgres logs, or the Apache error log, or other system logs. Disk-space, CPU and memory utilization were all within acceptable boundaries.

There was something strange in the Apache access_log however. Namely, lots of requests along the lines of:

37.46.113.128 - - [06/May/2013:05:50:19 +1000] "GET http://37.46.113.128:4111 HTTP/1.1" 200 1108 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"
The strange thing here is that a client from IP address 37.46.113.128 was making GET requests on our server back to their own IP on a different port. We had around 10 of these requests per secon…

HTC Sensation stuck in Safe Mode

I turned on my phone one day and it had the words "Safe Mode" on the bottom-left of the screen. While in safe-mode, the phone has very limited functionality -- none of the third-party apps will work, including gmail.

Safe-Mode is usually enabled by pressing and holding the volume up button while your phone boots. To deactivate, generally you need to do the opposite and press and hold the down button just after you see the HTC logo.

You can also take the battery out and leave it out for around 30 seconds, then put it back in, and power your phone as normal, and it should come out of safe-mode.

For me, however, none of these methods worked...

Turns out the cause was broken volume buttons. My volume rocker hasn't worked for months, so I just use a volume widget instead. However, I think recently, the underlying buttons themselves must've got stuck in a pressed position. I noticed this a few weeks ago when I tried to reboot into recovery and couldn't using the standa…