Skip to content

Instantly share code, notes, and snippets.

View chriskempson's full-sized avatar
😵
Eternally busy

Chris Kempson chriskempson

😵
Eternally busy
View GitHub Profile
#!/usr/bin/env sh
# jpsubbers-dl.sh - chriskempson.com
# Download all subtiles within a directory from http://jpsubbers.web44.net/Japanese-Subtitles/
#
# Usage:
# ./jpsubbers-dl.sh http://jpsubbers.web44.net/Japanese-Subtitles/まんぷく/
wget --restrict-file-names=nocontrol --no-directories -r -l 1 --accept="*.srt" -e robots=off $1
@chriskempson
chriskempson / Wordpress Replace URL's SQL
Last active October 12, 2015 20:58
Wordpress Replace URL's SQL
SET @old_url = 'old';
SET @new_url = 'new';
UPDATE wp_posts
SET post_content = REPLACE(post_content, @old_url, @new_url),
post_excerpt = REPLACE(post_excerpt, @old_url, @new_url),
guid = REPLACE(guid, @old_url, @new_url);
UPDATE wp_options
SET option_value = REPLACE(option_value, @old_url, @new_url)