SSH to EC2 instance from behind firewall

Well, this is a short post for those who would like to start an EC2 instance with different SSH ports to access from behind a corporate firewall.

First you must download and install CLI tools from Amazon to manage EC2 resources. After installing CLI tools, create a user data script as follow_

#!/bin/bash -ex
perl -pi -e 's/^#?Port 22$/Port 443/' /etc/ssh/sshd_config
service sshd restart || service ssh restart

After that, run ec2-run-instances command from command line as follow_

ec2-run-instances --key my-aws-keypair --region us-west-2 --instance-type t1.micro --user-data-file user-data-script-file.txt ami-70f96e40

You might want to change the above command with your own parameter set for keypair file, region, instance type etc. Please refer to manual for Amazon CLI tools for more details.

Go to Amazon web console to check your instance is getting started. Finally change security group to allow port 443 as inbound rule.

Now you can ssh into your ect instance with custom port.

Conversion between Singapore Coordinate System SVY21 and World Geodetic System WGS84

In August 2004, Singapore Land Authority introduced the new coordinated cadastre system, SVY21.

Recently, I need to use data from both onemap and google map, and the difference in coordinate systems made it pain in the ass to work with. So I wrote a Python script to convert to and from both coordinate systems.

Basically I used the geometry service provided by Esri Arcgis Online at ” http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer

The script is hosted on https://github.com/zkkmin/coordconvert .

Since I wrote it mainly for my task requirement, you might need to modify it for your own usage 😀