Thursday, January 13, 2011

Postgres/PostGIS with RAID 10 on Amazon EBS without Leaving the Browser

Since some one asked about installing Postgres on AWS without leaving the browser, I've updated the Postgres install script to Ubuntu 10.10 Maverick Meerkat and made the size and number of the volumes as command line arguments. The script below can be cut and pasted into the User Data textbox when launching the AMI as in the previous GeoServer install instructions.

You will need to place your private key and X.509 certificate where they can be downloaded. For the sake of simplicity, the example script retrieves the credentials  using wget protected by a username and password. In practice, I would use sftp or scp to transfer the credentials

UPDATE 1/14/11: The script from 1/13/11 contained errors and has been replaced. The current script has been tested against ami-cef405a7

#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1

# download the install script and run it
cd /home/ubuntu

# grab your private key and X.509 cert
wget --user=user --password='myPassword'*.pem
sudo chmod 600 *pem 

# change this to your keypair and cert
export EC2_PRIVATE_KEY=~/myKey.pem
export EC2_CERT=~/myCert.pem

# get install script
chmod 755

# run it, note that the install script now takes arguments for the number of volumes
#   and the size of each volume in gigbytes, args below create a 500GB RAID10 
sudo -u ubuntu ./ 10 100

Thursday, January 6, 2011

Install GeoServer on Amazon EC2 without leaving the browser

Learned a new trick from @waxpancake at ThinkUp, so here's how to install GeoServer on a Ubuntu Maverick 10.10 EC2 instance with out leaving the browser.

Launch an Ubuntu AMI, in this example I use ami-cef405a7, but check this page to find a suitable AMI from Canonical. 
I use a micro instance in this example, but you can use any size.
Copy the following script in the User Data textbox. The script downloads the install script from the earlier blog post and runs it.
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1

# download the install script and run it
cd /home/ubuntu
chmod 755
It should look like this:
You can tag your instance or leave it blank.
Use an existing keypair or create a new one.
Use and existing security group or create a new one. Note that port 80 and 22 need to be open for Apache and ssh respectively.
Launch the instance.

That's it! It may take a minute or three to get everything installed, configured, and running even if the console shows that the instance is running.

Wednesday, January 5, 2011

Uninstalling Cyanogen Mod 6 and Installing T-Moble Froyo for MyTouch (Sapphire)

Last year I installed Cyanogenmod-6 because I wanted Froyo on my T-Mobile Sapphire MyTouch. It seemed unlikely that T-Mobile would release Froyo for the MyTouch so rooted the phone. Initially, Cyanogenmod ran reasonably well, but performance degraded over time. 

In the mean time, T-Mobile did release a Froyo OTA (Over The Air) update. Of course, having a rooted phone meant that I did not receive the OTA update. My phone was close to unusable, and the reviews for the T-Mobile Froyo update were positive so I was willing to give it a try. 

Follow these directions to restore your T-Mobile MyTouch (v1.0) to a stock Android Donut 1.6 DMD64 install, then upgrade it to the T-Mobile Froyo update. Note that the link in the article for the actual Froyo update is broken. You can download the Froyo update from this link.

Happily, I can now play Angry Birds with the rest of you.