The S3 Ninja

November 28, 2009

What is the S3Ninja ?

Filed under: Uncategorized — Tuvok @ 1:21 pm

SummaryFeaturesHow it worksRequirementsDownloadContact – Leroy

Summary:
The S3Ninja is a scalable, multi-process tool, written in C, that is designed to allow your existing Unix/Linux based web applications to make easy use of Amazon S3 storage. S3Ninja can be used with PHP, Perl, Cold Fusion or just about any web application language that allows you to invoke system calls. s3ninja has the ability to detach itself from your script and run in the background without any special arguments. This allows the forking functionality to be controlled and managed in C, the way it should be. Currently, the only supported platform is Linux.

Features:

  • Command line driven
  • Current supported S3 features: List, Put, Get, Delete and Copy
  • Optionally, you can -detach s3ninja from your script and run in the background.
  • Optionally, you can provide a return_url to notify your application of the completed status of operation.

How it works:

s3ninja [access_key_id] [secret_access_key] command [arguments]

 

Commands can be:
  • list – returns a list of files in a given bucket.
    • [bucket]
    • [access key]
    • [secret key]
  • put – writes a file to an s3 bucket.
    • [bucket]
    • [access key]
    • [secret  key]
    • [file]
    • [optional: -detach]
    • [optional: return_url]
  • get – reads a file from an s3 bucket
    • [bucket]
    • [access key]
    • [secret  key]
    • [file]
    • [optional: -detach]
    • [optional: return_url]
  • delete
    • [bucket]
    • [access key]
    • [secret  key]
    • [optional: -detach]
    • [optional: return_url]
  • copy
    • [access key]
    • [secret  key]
    • [bucket]
    • [key]
    • [dest bucket]
    • [dest key]
    • [optional: -detach]
    • [optional: return_url]

Example: #> s3ninja access-key s3cret-key007 put /path/to/file -detach http://myapp.com/notify.php?file=123&anythingelseyouwant

PHP Simple Example:


define(‘EXEC_GRS3′,’/usr/local/bin/s3ninja′);
$access_key = 'abc123';
$secret_key = ‘abc123’;
$bucket = ‘my_company_bucket’;

$cmd = EXEC_GRS3 . ” put {$access_key} {$secret_key} {$bucket} /path/to/file -detach http://myapp.com/callback-controller/abc/123”;
exec($cmd,$out,$ret);
if($ret == 0){
print “grs3 command execution successful”;
}

Requirements:


linux-gate.so.1 => (0x00da3000)
libs3.so.1 => /usr/lib/libs3.so.1 (0x00466000)
libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00491000)
libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x00110000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0026c000)
libz.so.1 => /lib/libz.so.1 (0x00b2c000)
libm.so.6 => /lib/i686/nosegneg/libm.so.6 (0x00c35000)
libpthread.so.0 => /lib/i686/nosegneg/libpthread.so.0 (0x00f7c000)
libidn.so.11 => /usr/lib/libidn.so.11 (0x003a3000)
libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00726000)
librt.so.1 => /lib/i686/nosegneg/librt.so.1 (0x003fc000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00f19000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x004d8000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00a0a000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x00e99000)
libssl3.so => /usr/lib/libssl3.so (0x00405000)
libsmime3.so => /usr/lib/libsmime3.so (0x00ac3000)
libnss3.so => /usr/lib/libnss3.so (0x00884000)
libplds4.so => /usr/lib/libplds4.so (0x003d4000)
libplc4.so => /usr/lib/libplc4.so (0x003d7000)
libnspr4.so => /usr/lib/libnspr4.so (0x0056b000)
libdl.so.2 => /lib/libdl.so.2 (0x003dc000)
/lib/ld-linux.so.2 (0x00af4000)
libssl.so.6 => /lib/libssl.so.6 (0x005a4000)
libcrypto.so.6 => /lib/libcrypto.so.6 (0x005e9000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x003e1000)
libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x003ea000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00be4000)
libnssutil3.so => /usr/lib/libnssutil3.so (0x00ec4000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00434000)

 

Created by: Epic Force

Create a free website or blog at WordPress.com.