Skip to content

Instantly share code, notes, and snippets.

View jamiedust's full-sized avatar

Jamie Woolgar jamiedust

  • Earth
View GitHub Profile
// Atom Editor settings
@jamiedust
jamiedust / bash-ssh-tunnelling
Last active September 2, 2017 03:10
Useful Bash/Linux SSH tunnelling commands
## Start SSH agent
eval "$(ssh-agent -s)"
## Open SSH tunnel on port 3307
ssh -fN -L 3307:127.0.0.1:3306 sqlaccount@domain.com
@jamiedust
jamiedust / wp-update-domain-query
Last active February 15, 2016 12:13
SQL query to update the domain in WordPress DB, useful for moving wp sites
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com');