Skip to content

Instantly share code, notes, and snippets.

@joeyyax
joeyyax / backup.sh
Last active December 25, 2015 17:39
Shell script to backup database and site files to both AWS S3 (using s3cmd) and mirror to a second server. Use a cronjob to call at set intervals.
#! /bin/sh/
TEMP_DIR=/root/scripts/temp
DATE=$(date +"%F.%T");
# Files Directories
LOCAL_DIR=/var/www/sites/...
REMOTE_DIR=/var/www/sites/...
# Database Info
@joeyyax
joeyyax / sync-production-to-local.sh
Last active December 25, 2015 17:39
Sync Production assets and db to local MAMP environment. Other site files are to be held in GIT repo and pull in separately.
#! /bin/sh/
# Setup for MAMP
echo
if [ -d /Applications/MAMP/Library/bin/ ]; then
echo "You're using MAMP. Cool. Gonna run some tests... ";
# Check if mysqldump is in /usr/local/bin/. If not, link 'em.
if [ ! -f /usr/local/bin/mysqldump ]; then
echo "mysqldump link doesn't exist. Creating link to MAMP.";
@joeyyax
joeyyax / update_bc_project_ids.php
Created October 25, 2012 00:58
When migrating from basecamp classic to the new basecamp project IDs change. This quick & dirty script will identify projects by name and update the project IDs in your database.
<?php
ob_start();
//
// Config
//
// Old Basecamp
$bc_old = array(
@joeyyax
joeyyax / wp-config.php
Created September 17, 2012 17:54
Environment switch for wp-config when working with multiple environments
// ** MySQL settings ** //
// define environments
$environments = array(
'local-joeyyax' => array(
'address' => array( 'domain.dev', 'www.domain.dev' ),
'db' => array(
'name' => '',
'user' => 'root',
'password' => 'root',