Skip to content

Instantly share code, notes, and snippets.

@stephen-dahl
stephen-dahl / copy-database.sh
Last active April 3, 2020 17:46
copy data from one mysql server to another in parallel
#!bash
mysql_config_editor set --login-path=source -hmysql.source.com -uuser -p
mysql_config_editor set --login-path=destination -hmysql.destination.com -uuser -ppass
export ignoreSchema="'information_schema','mysql','performance_schema', 'awsdms_control'"
#get db list
mysql --login-path=source -ANe"SELECT distinct table_schema FROM information_schema.tables WHERE table_schema NOT IN (${ignoreSchema})" > dbs
#get table list
@stephen-dahl
stephen-dahl / index.js
Last active July 8, 2019 20:02
nextjs redux store with initial state from SSR
import { connect } from 'react-redux';
import withRedux from './withRedux';
const Index = props => (
<pre>
<h1>State</h1>
{JSON.stringify(props, null, 2)}
</pre>
);