This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT wpp.post_title, wpp.guid, wpp.post_date, | |
concat('https://www.mydomain.com', REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, '%year%', DATE_FORMAT(wpp.post_date,'%Y') ), '%monthnum%', DATE_FORMAT(wpp.post_date, '%m') ), '%day%', DATE_FORMAT(wpp.post_date, '%d') ), '%postname%', wpp.post_name )) AS permalink | |
FROM wp_posts wpp | |
JOIN wp_options wpo | |
ON wpo.option_name = 'permalink_structure' | |
WHERE wpp.post_type = 'post' | |
AND wpp.post_status = 'publish' | |
ORDER BY wpp.post_date DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] | |
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ | |
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo "Enter a commit id (run \`git log\` to see commit history)" | |
echo "Example: ./batch-cherry-pick.sh [commit id] --skip-master" | |
exit | |
fi | |
# Commmit id parameter | |
readonly commit=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make sure only root can run this script | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root (sudo)" 1>&2 | |
exit 1 | |
fi | |
if [[ $# -eq 0 ]] ; then | |
echo Enter a user name |
NewerOlder