Skip to content

Instantly share code, notes, and snippets.

@gecampbell
gecampbell / cloud-db-migrate.sh
Created July 11, 2012 21:22
Migrating from plain MySQL to Rackspace Cloud Databases
# unload old database
mysqldump -h {hostname} -u {user} -p{password} {database} >tempfile.dump
# load the new one
mysql -h {clouddbhost} -u {user} -p{password} {database} <tempfile.dump
@gecampbell
gecampbell / raxobjstore.php
Created June 29, 2012 17:36
Object Storage Sample Code
<?php
define('RAXSDK_OBJSTORE_NAME','cloudFiles');
define('RAXSDK_OBJSTORE_REGION','DFW');
require_once( 'lib/raxconnection.inc' );
require_once( 'lib/objectstore.inc' );
// create a connection to rackspace
$conn = new RaxConnection(
'https://identity.api.rackspacecloud.com/v2.0/',
array(
'username' => ' YOUR USERNAME ',
@gecampbell
gecampbell / php-collection.php
Created June 28, 2012 14:56
Example collection handling
<?php
# create a collection of objects
$objlist = $container->list_objects();
while ($obj = $objlist->next()) {
# do something with $obj
}