Amazon EC2 AMI-Bundling Script for Linux Servers
During the course of a recent project, I needed to make an automated backup system, instead of re-inventing the wheel and creating a full blown backup management application I simply created several scripts to perform the backups to S3 storage, the one I’m releasing here is for automatically bundling your server up, uploading the bundle files to S3 and then registering the new AMI with Amazon AWS Console for you to launch later. It adds todays date to the end of the AMI bundle files and cleans up after itself, so it is quite feasible to use this in a cron script that’s run on a regular basis, or it can simply be used as a one off, run it manually and don’t worry about it kind of script.
If you use the file, you’ll need to edit the variables at the top of the script, I’ve annotated it and tried to explain them clearly in plain English, but in short they are for your Amazon EC2 and S3 certificates and keys which you should have received when signing up for the services, file locations and names and paths to the EC2 tools and Java executable.
You’ll also need to make sure you have the FULL set of EC2 api tools on your server, not just the basic ones that come with the server by default. You can get the full set of Java tools from the Amazon EC2 Resource Center.
I still haven’t created a download file to manage downloads so please remember the following link will change, if you choose to give it out to others for download, please give them the link to this page instead, I will update the link as and when required.
For now you can get the tar file from here:
Automate-Amazon-EC2-Bundle-Server-V.1.0.0.tar.gz
Please note this script is only tested on an Ubuntu 8.10 Server so far, I’d appreciate anyone who has it working on a different OS letting me know so I can add it to the compatibility list here. If anyone has any additions to this that could be useful to others, I’d appreciate you letting me know in the comments.
**Please note, there is NO error handling in this script at the moment, later versions may perform directory checks and error handling if they are needed, but for now you will simply have to make sure that you get your directory paths correct or the script will fail**
PHP and CURL API for connecting to Authorize.Net AIM Protocol
For a project I was working on recently I had to build a completely custom cart and checkout system, which had to use Authorize.Nets AIM protocol for processing credit card payments, as such I spent lots of time identifying the response codes that could come back from Authorize.Net on both failure and success, and even more time writing “sanitized/English” explanations to present to the customer for each one.
It’s written in PHP and uses CURL, but don’t worry there isn’t any extra CURL work involved, just make sure it’s installed on the server you’re planning to use it on, I’ve had to cut out a lot of things like database usernames and passwords and replace them with generic ones, of course I’ve also had to strip out things like the customers Authorize Login details, so you’ll need to obtain some of your own, either customer details or developer details, in order to test it and you’ll also need to find your own way of getting the variable information needed from your own site setup, to pass to the checkout.php document and insert some code into your own html templates etc etc etc, however it’s a very big head-start which has been tried, tested and implemented so I’m releasing it for download here.
I haven’t written a download.php document just yet to manage and log downloads, but I will be doing, so the link below WILL change in the near future, just for those who plan to re-download later or simply pass on the link etc.
For now you can download it from PPAuthorize-1.0.0.tar.gz.
To unzip it you’ll need to use something like WinRAR, WinZip or Ark if you’re on an intelligent Operating System (*COUGH* Linux *COUGH*) or if you’re wanting to unzip via the command line on Linux you can simply do the following:
tar -xvzf PPAuthorize-1.0.0.tar.gz
to ‘untar’ the files in the current folder.
If anyone has any useful bits that could be added to this, please feel free to comment here, or when I’ve written the contact form (Lots of things still in progress here) you can use that instead to let me know.
CREDITS: Written entirely by me except for a couple of snippets of code which are freely available on the Authorize.Net developer site.
Categories:
Tags: |
Site Navigation
Recent Posts