sudo apt update && sudo apt upgrade -ysudo apt autoremove && sudo apt clean
pbcopy < ~/.ssh/id_rsa.pub
| UPDATE jp_blogs SET domain='blog.jovempan.uol.com.br'; | |
| UPDATE jp_site SET domain='blog.jovempan.uol.com.br'; | |
| UPDATE jp_options SET option_value='http://blog.jovempan.uol.com.br' WHERE option_name='siteurl'; | |
| UPDATE jp_options SET option_value='http://blog.jovempan.uol.com.br' WHERE option_name='home'; | |
| UPDATE jp_1_options SET option_value=replace(option_value, 'http://blog.jovempan.uol.com.br', 'http://blog.jovempan.uol.com.br') WHERE option_name='siteurl'; | |
| UPDATE jp_1_options SET option_value=replace(option_value, 'https://blog.jovempan.uol.com.br', 'http://blog.jovempan.uol.com.br') WHERE option_name='siteurl'; | |
| UPDATE jp_1_options SET option_value=replace(option_value, 'http://blog.jovempan.uol.com.br', 'http://blog.jovempan.uol.com.br') WHERE option_name='home'; |
| /* | |
| * Function creates post duplicate as a draft and redirects then to the edit post screen | |
| */ | |
| function els_duplicate_post_as_draft(){ | |
| global $wpdb; | |
| if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'els_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { | |
| wp_die('No post to duplicate has been supplied!'); | |
| } | |
| /* |
| #!/usr/bin/env php | |
| <?php | |
| date_default_timezone_set('GMT'); | |
| if (count($argv)<2) { | |
| echo $argv[0] . ' <token> <until>' . PHP_EOL; | |
| echo 'Example: ' . $argv[0] . ' abcd-12345678-123456789-12345 \'-3 months\'' . PHP_EOL; | |
| exit; | |
| } |
| //Begin SSL Load balancing fix | |
| $server_opts = array("HTTP_CLOUDFRONT_FORWARDED_PROTO" => "https", "HTTP_CF_VISITOR"=>"https", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_X_FORWARDED_SSL"=>"on", "HTTP_X_PROTO"=>"SSL", "HTTP_X_FORWARDED_SSL"=>"1"); | |
| foreach( $server_opts as $option => $value ) { | |
| if ((isset($_ENV["HTTPS"]) && ( "on" == $_ENV["HTTPS"] )) || (isset( $_SERVER[ $option ] ) && ( strpos( $_SERVER[ $option ], $value ) !== false )) ) { | |
| $_SERVER[ "HTTPS" ] = "on"; | |
| break; | |
| } | |
| } | |
| //END SSL |
| function custom_admin_menu() { | |
| $user = new WP_User(get_current_user_id()); | |
| if (!empty( $user->roles) && is_array($user->roles)) { | |
| foreach ($user->roles as $role) | |
| $role = $role; | |
| } | |
| if($role == "editor") { | |
| global $submenu; |
| <?php | |
| // Add to existing function.php file | |
| // Disable support for comments and trackbacks in post types | |
| function els_disable_comments_post_types_support() { | |
| $post_types = get_post_types(); | |
| foreach ($post_types as $post_type) { | |
| if(post_type_supports($post_type, 'comments')) { | |
| remove_post_type_support($post_type, 'comments'); |
Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.
Will need to create a directory to hold cache files, for the example given here that would be:
$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi| DELETE a,b,c FROM wp_posts a | |
| LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
| LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) | |
| WHERE a.post_type = 'revision' |
| DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%'); | |
| DELETE FROM `wp_options` WHERE `option_name` LIKE ('_site_transient_%'); |