This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it
Sister Document - Backup MySQL to Amazon S3 - read that first
# Set our variables
export mysqlpass="ROOTPASSWORD"
// jshint node:true | |
'use strict'; | |
var semver = require('semver'), | |
exec = require('exec'); | |
module.exports = function(grunt) { | |
'use strict'; | |
require('load-grunt-tasks')(grunt); |
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS `CopyDB` $$ | |
CREATE PROCEDURE `CopyDB` (sourceDB VARCHAR(64),targetDB VARCHAR(64)) | |
TheStoredProcedure:BEGIN | |
DECLARE found_count,ndx,ndx_last INT; | |
DECLARE sqlcmd VARCHAR(1024); | |
SELECT COUNT(1) INTO found_count | |
FROM information_schema.tables |
This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it
Sister Document - Backup MySQL to Amazon S3 - read that first
# Set our variables
export mysqlpass="ROOTPASSWORD"
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
#!/home/ec2-user/.rvm/rubies/ruby-1.9.2-p0/bin/ruby | |
require 'rubygems' | |
require 'aws/s3' | |
require 'fileutils' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'access_key', | |
:secret_access_key => 'secret_key' | |
) |
Capistrano::Configuration.instance(:must_exist).load do | |
# example execution 'cap bundle_app -s version=HEAD' | |
desc "Bundle code and push to S3" | |
task :bundle_app do | |
puts "Starting Git archive of #{version}" | |
`git archive -o oldweather.tar #{version}` | |
`gzip oldweather.tar` | |
s3_upload | |
clean_up |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Session extends CI_Session{ | |
private $sess_use_redis = TRUE; | |
private $redis = ''; | |
public function __construct($params = array()) { | |
//parent::__construct(); | |
$this->CI =& get_instance(); |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
//Create a new config file | |
/* | |
|-------------------------------------------------------------------------- | |
| Number of databases in use | |
|-------------------------------------------------------------------------- | |
| | |
| Using a Master and Slave. The Slave doubles as a read-only database. |
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=unknown&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc"
unzip -d "$extension_id-source" "$extension_id.zip"
Thx to crxviewer for the magic download URL.