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 |
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
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
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 %{REQUEST_URI} !/maintenance.php$ | |
RewriteCond %{REMOTE_HOST} !^000\.000\.000\.000 | |
RewriteRule $ /maintenance.php [R=302,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
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - | |
sudo yum -y install nodejs |
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
CREATE DATABASE database_name; GRANT ALL ON database_name.* TO 'database_user'@'%' IDENTIFIED BY 'database_password'; |
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
" syntax highlighting | |
syntax on | |
filetype plugin indent on | |
" show existing tab with 4 spaces width | |
set tabstop=2 | |
" when indenting with '>', use 4 spaces width | |
set shiftwidth=2 | |
" On pressing tab, insert 4 spaces | |
set expandtab |
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
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( | |
//////Author Parameters - Show posts associated with certain author. |
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
{ | |
"Version": "2012-10-17", | |
"Statement":[{ | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": ["arn:aws:s3:::my_bucket", | |
"arn:aws:s3:::my_bucket/*"] | |
} | |
] | |
} |
OlderNewer