Saturday, May 26, 2018

Prevent images on your page from appearing in facebook web scraper

Prevent images on your page from appearing in Facebook Web Scraper

1. try to use images below size 200X200 2. if you will use the bigger image than add this image as background.

Wednesday, May 23, 2018

Wordpress - Create a Child Theme


How to Create a Child Theme
1.       Create the child theme directory, which will be placed in wp-content/themes folder. The name of your child theme directory is appended with '-child'. You will also want to make sure that there are no spaces in your child theme directory name, which may result in errors.
2.       The next step is to create your child theme's stylesheet (style.css). The stylesheet must begin with the following
/*
Theme Name: Twenty Fifteen Child Theme
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen
Version: 1.0.0
License: GNU General Public License v2 or later
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twenty-fifteen-child
*/
                Note – Template “twentyfifteen” should be same as parent folder name. this is case sensitive. Otherwise you will get the error “the parent theme is missing. please install the x parent theme”
3.       Create a functions.php in your child theme directory. The first line of your child theme's functions.php will be an opening PHP tag (), after which you can enqueue your parent and child theme stylesheets.

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
?>

where parent-style In your child code, replace the instance of 'parent-style' with 'twentyfifteen-style', like so:
parent_style = 'twentyfifteen-style';

Friday, May 18, 2018

Reload Registry Without Reboot

Forces changes to the registry without requiring a complete reboot.
1. Press CTRL-ALT-DELETE to bring up the Windows task list.
2. Select Explorer and click on End Task
3. When the Shutdown screen is shown, click Cancel
4. After a few seconds an error message will show. Click on End Task.
Then Windows will reload explorer and any new registry settings.

Check SSL Protocols status on server

Check SSL Protocols status on server

please visit the below link:

https://www.ssllabs.com/ssltest/index.html

and the name of domain like domain.com, it will show the status of SSL  Protocols on server.

Thursday, May 17, 2018

Unable to RDP to Virtual Machine: CredSSP Encryption Oracle Remediation

To resolve a vulnerability issue with Credential Security Support Provider protocol (CredSSP), a monthly Windows update in May was applied which does two things:
1.       Correct how Credential Security Support Provider protocol (CredSSP) validates requests during the authentication process
2.       Change the group policy Encryption Oracle Remediation default setting from Vulnerable to Mitigated.
This RDP authentication issue can occur if the local client and the remote host have differing Encryption Oracle Remediation settings that define how to build an RDP session with CredSSP. If the server or client have different expectations on the establishment of a secure RDP session the connection could be blocked. There is the possibility that the current default setting could change from the tentative update and therefore impact the expected secure session requirement.

Examples:
1.       If the client is updated and you try to RDP to an Azure VM that was not updated, then it will be blocked and see the error message.
2.       If the client is not patched while server is updated, RDP can still work. But the session will be exposed to the attack.
3.       If both client & server are patched with default setting (Mitigated), RDP will work in a secure way.
References:
Resolution/ Fix
Ensure both client & server side have latest patch installed so that RDP can be established in a secure way.
You can find the list of the corresponding KB number for each operating system here: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2018-0886
If you cannot RDP to  VMs from your patched client, we can consider changing the policy settings on the client to temporarily gain RDP access to the servers. You can change the settings in Local Group Policy Editor. Execute gpedit.msc and browse to Computer Configuration / Administrative Templates / System / Credentials Delegation in the left pane:
Change the Encryption Oracle Remediation policy to Enabled, and Protection Level to Vulnerable:

Monday, April 9, 2018

Get Private Key and certificate from pfx file


1.       Get Private Key and certificate from pfx file (for this we need to install the SSL certificate):

a.       open cmd and go to the installation directory of openSSL
C:\Users\admin>cd %Installed Path of openSSL%

b.       Run the following commands:
C:\OpenSSL-Win32>set openssl_Home=%Installed Path of openSSL%
C:\OpenSSL-Win32>set openssl_conf=%Installed Path of openSSL%\bin\openssl.cfg
C:\OpenSSL-Win32>set path=%Installed Path of openSSL%

c.       Go to bin directory:
C:\OpenSSL-Win32>cd bin

d.       Run the below command to convert pfx file
C:\OpenSSL-Win32\bin>openssl pkcs12 -in mydomain.pfx -nodes

Here you will get private key and certificate

Wednesday, April 4, 2018

WP Super Cache — Content Encoding Error

if you are getting the below error:












Steps to fix this:

Go to the advanced settings page and make sure compression is disabled. 

 Since the host already ‘gzip compresses’ enabled, asking Super Cache to do that for you again ends up giving out these weird encoding errors.

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

* Please contact the website owners to inform them of this problem.



WordPress - Add custom field automatically when post or page is publish


Wordpress - Add custom field automatically when post or page is publish
 
Adding this snippet to the functions.php of your wordpress theme will add a custom field to a post or page when published. Don’t forget to update the FIELD_NAME and the CUSTOM VALUE.

add_action('publish_page', 'add_custom_field_automatically');
add_action('publish_post', 'add_custom_field_automatically');

function add_custom_field_automatically($post_ID) {
    global $wpdb;
    if(!wp_is_post_revision($post_ID)) {
               add_post_meta($post_ID, 'FIELD_NAME', 'CUSTOM VALUE', true);
    }
}


Monday, February 19, 2018

Wordpress - Redirect www URLs to non-www

You can redirect all of the requests for www.yourdomain.com domain to yourdomain.com by modifying your website's .htaccess file. You need to add the following lines at the beginning of the file in order to setup that redirection:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]


Where yourdomain.com is your actual domain name.

Wordpress - Redirect non-www URLs to www

You can redirect all of the requests for yourdomain.com domain to www.yourdomain.com by modifying your website's .htaccess file. You need to add the following lines at the beginning of the file in order to setup that redirection:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]


Where yourdomain.com is your actual domain name.