Monthly Archives: August 2012

Issue with ec2-upload-bundle command from EC2 API

ec2-upload-bundle command uploads an image of an instance to Amazon S3. When I used underscore in the name of the S3 bucket the command gave ec2 v2 error prompting user’s confirmation (entering yes and hitting enter). If ec2-upload-bundle is in … Continue reading

Posted in EC2, Uncategorized | Leave a comment

Sudo command changes environment variables

When you run sudo command it switches user to “supper user” and environment variables also change. This can be annoying. For example, on amazon free-tier micro instance you ssh to it as ec2-user but often (almost always I would say) … Continue reading

Posted in Bash, EC2 | Leave a comment

Creating a snapshot of instance on EC2

A good article with detailed instructions can be found here. I only had to change paths in ~/.bashrc. Instead of /root I used /home/ec2-user/. I also excluded quotation marks in the lines with “echo” command. I registered instance using Amazon … Continue reading

Posted in Uncategorized | Leave a comment

Mounting directory hosted on EC2 server with sshfs

First, install sshfs. On Ubuntu: sudo apt-get install sshfs Suppose private key is in ~/.ec2/private_key.pem sudo mkdir /mnt/ec2 sshfs -o IdentityFile=~/.ec2/private_key.pem ec2-user@:/home/ec2-user /mnt/ec2

Posted in Uncategorized | Leave a comment

Displaying charts saved on EC2 server in web browser

Assuming we have apache server running, and chart that we want to display is /var/www/images/foo_chart.png, we place display_chart.py python script in /var/www/cgi-bin. The script is: #!/usr/bin/python if __name__ == “__main__”: print “Content-type: image/png\n” print file(r”/var/www/images/foo_chart.png”, “r”).read() Now, in web browser … Continue reading

Posted in Uncategorized | Leave a comment

Installing Mercurial and Vim on EC2

Pre-installed vim on EC2 does not have clipboard support. Installing from source. First, installing mercurial: sudo yum install mercurial Then clone vim: sudo hg clone https://vim.googlecode.com/hg/ vim cd vim/src sudo ./configure –with-features=huge –enable-gui=gnome2 sudo make …bunch of “make” messages follow… … Continue reading

Posted in EC2, Vim | Tagged , | Leave a comment

SciPy complains about libstdc++6 library

Issue solved by downloading, unzipping and copying the “*.6.so” file from http://www.ssforge.com/libstdc++6.zip into /home/ec2-user/local/gcc-4.3/lib64

Posted in EC2, Python, SciPy | Leave a comment