Microsoft Azure Just-In-Time access control

According to Microsoft,

Login brute forcing is one of the top ways IaaS VMs are compromised in the cloud.

Continue Reading →


Lets Encrypt SSL Error: The client lacks sufficient authorization 403 Forbidden

Problem

You might encounter below error:

Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p", www.example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.example.com/.well-known/acme-challenge/mS8eikQcFGT3_bOgvLFw84YpzcU0YZeZiBm8TZDHR5Q: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
IMPORTANT NOTES:
 - The following errors were reported by the server:
   Domain: example.com
   Type:   unauthorized
   Detail: Invalid response from
   http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>403 Forbidden</title>
   </head><body>
   <h1>Forbidden</h1>

Continue Reading →


Lets-Encrypt SSL Certificate Useful Commands

Checkcertificate details and Expiry of Certificates

certbot certificates

Continue Reading →


How to renew SSL certificate from Lets-encrypt when your website is using cloudflare

Introduction

This article is for website administrator or owner who has once taken certificate from letsencrypt.org, and its the time to renew your certificate. And, you are using cloudflare CDN for your website.

Lets-Encrypt Organization

Letsencrypt.org is an organization who provides free SSL certificate to anyone. I'm a great admirer of this service. And, its popularity increased when google chrome announced that it will give an advantage to SSL enabled websites.

I will write about how to get a new SSL certificate for your website from lets-encrypt. Its an amazing service, with an easy to use utility scripts.

Problem

Letsencrypt says you should run following command:

certbot renew

It may work for most of the people. But, it will not work for people who are using cloudflare.

Following error comes out:

 

Solution

There are two solutions that I could find till now:

1. Bypass cloudflare DNS proxy

You have to disable DNS proxy from cloudflare CDN. i.e. Bypassing cloudflare. If someone opens your website, he/she can see your actual IP, OR he/she will be served from your hosting, not from cloudflare.

Cloudflare website

 

You have to do this, just for the time period in which you are running command to renew your certificate.

Warning: When you disable this setting, your users might see SSL warning on browser, and that will not be good for you.

SSL warning

 

And, run command: 

certbot renew

You are done! Do not forgot switch ON DNS proxy setting from cloudflare

 

2. Via Command line

For this, you need ssh access of your web server. 

Open terminal, and type command:

certbot certonly -d example.com -d www.example.com (put your website in place of example.com)

It will ask for putting webroot path. Write down the path of your documentRoot.

 

You're done.

Share your experiences or issues if any, I will be able to help them out.

 

Update

You should test first your commands, before requesting Lets Encrypt. Read: Test your request to Lets Encrypt

Also read: Common error

Continue Reading →


Explaining issue: response to preflight request doesn't pass access control check

Problem

Continue Reading →


Shell script to extract single file from a bunch of jar files

Problem Statement

I have a bunch of jar files lying in a folder. Lets name it /Users/labuser/jars

Continue Reading →


How to show a block of html or div to the bottom of a web page

Problem

You have a website, and you want to have a piece of content which should be at the bottom of thepage always.

Continue Reading →


5 Ways to Add Text to Images

These days, images look incomplete without proper captions, and blocks of text in articles look dry and in dire need of apt images to engage the readers. When we add images to articles though, more often than not we want to do so with text overlays. Mostly, this text is the title of the article itself or may be a watermark to indicate that the image is copyrighted.

Continue Reading →


Jira Rest APIs common usages

This article shows some of common usages of JIRA rest apis.

Continue Reading →


ElasticSearch - Update a document and change value of a key

Introduction

I have few documents in the Elastic Search instance. And, due to some change in the code. I had to update the value of few keys in some of the documents.

Continue Reading →


How to trim Meta Description tag value generated by Metatag module, to max 160 characters

Introduction

I was using a drupal website, and using metatag module to have all nice SEO metatags in my page. The content type is of article type.

Continue Reading →


List all the Node ids which do not have images from my domain

Problem Statement

Continue Reading →


Troubleshoot AWS Lambda unknown error!

After 2 days, there was my demo. I deployed my nodejs code on lambda function, and trying testing it. It abruptly stops in between, and no error or exception trace.

Continue Reading →


How to put Code in your blog/article

Introduction

Continue Reading →


How to get all image tags from an html - php code

Problem Statement

Continue Reading →


Linkage Error Loader Constraint Violation - JUnit test case development issue

Its good to write unit tests cases, and this part is mostly forgotten by developers. It can ease various issues that can come up while integrations.

Continue Reading →


How to generate powerful tags for your content - SEO

One of the biggest task while writing article or blog is to have right set of keywords on which your article or blog can rank high on search results. There are two ways to have right set of keywords in your article:

  1. People search for right keywords, and write content based on them. Basically fill those keywords in the article or blog.
  2. People write article or blog, and then put keywords, either as meta keywords, or having a tag field. So that it will help users to find right content.

I will focus on 2nd approach here.

Problem Statement

Continue Reading →


How to mock a constructor - Junit test case development issues

Introduction

Continue Reading →