Content Security Policy CSP

What is Content Security Policy?
Content Security Policy is internet security standard to prevent the known attack like Cross-site scripting XSS, click hijacking and code injection. For example like, if your visiting website is  then you only able to access the data come from, others URL or script and CDN like also will be blocked.

Beside that, it also contain some inline script <button onclick="testing()">Click Me!</button> will also be blocked. unless you do some configuration on the header.

In short, it will do the following:
1) Whitelist to tell the client (Normally is Browser) what's allowed and what is not allowed.
2) Learn what directives are available
3) Learn the keywords they take
4) Inline code and eval () are considered harmful
5) Report Policy violations to your server before enforcing them.

How to implement Content Security Policy (CSP)?
<system.webServer> <http…

Step to Configure Php and Apache at windows

Configure PHP and Apache windows 10  This configuration guide is using Php 5.6 and Apache 2.4 for 32 bit on windows 10x64.
I do this installation because of Laravel PHP framework but this guide won't touch about the Laravel.

There some binaries that you might need to take care but I not gonna touch that at here either. If any question you can leave your comment below.

1) DOWNLOAD AND INSTALL APACHE  First, you will need to download apache, and I gonna use Apache Haus as an example.
However, you can use others options here.

after you finish download then extract it. After that go to httpd-2.4.25-x86-vc14\Apache24\conf
and open the httpd.conf . (Assume you an expert ... else go leave here and download XAMPP or Easyphp)

Then find "Server root"

Define SRVROOT "D:\Program\httpd-2.4.25-x86-vc14\Apache24"
ServerRoot "${SRVROOT}"

Replace the "D:\Program\httpd-2.4.25-x86-vc14\Apache24"  
to your director of the apache, you have download and extract.


Method to Convert from Stream to Json C#

Recently I was using the C# HttpClient to make REST request but I found that is was quite troublesome so I have changed to using HttpWebRequest instead.

So want the HttpWebRequest result is return it was in Stream form. I not able to convert it into Json.

this is the method i convert the stream to JSON.

HttpWebResponse response =(HttpWebResponse)requirejs.GetResponse();Stream stream = response.GetResponseStream();StreamReader sr =newStreamReader(stream);var serializer =newSystem.Web.Script.Serialization.JavaScriptSerializer();var jsonObject = serializer.DeserializeObject(sr.ReadToEnd()); As you can see that jsonObject is an object. Now you can parse it into the Json(JsonObject);

If you have any question can leave a comment below.

IIS Setup let text file without extension

How to Write to NTFS Drives on a Mac for free

Free method but need Extra work

1) Download Osxfuse. (Better choose latest version and with dmg Eg,osxfuse-3.2.0.dmg ) Install it.

2) Then Download Homebrew. or copy the the highlighter link and  paste it at terminal
/usr/bin/ruby -e "$(curl -fsSL"

3)then paste xcode-select –install  if pop up the itunes alert box then download it, else just continute next step.

4)  brew install homebrew/fuse/ntfs-3g   wait it download finish and installed.

5)   Start from this step, you need to do it with care. First you need to reboot your mac and hold Command+R 

6) Then wait the loading bar to finish will bring you to another Mac utilities screen. Here you need to find the terminal on the top menu bar. Launch it.

7) type in csrutil disable  . (PS: this is to disable the configuration by the macbook to do modification on the system so need to enable it back) .

8) Exit terminal and reboot. After that open terminal and …

Backup and restore activation for Windows Microsoft Office Pro Plus 2016

When the Microsoft introduce the product activation in Office , user are need to backup the activation so that you can restore it later. This is because you need to format your disk drive and reinstall windows and office again on the same machine/hardware.
It is not easy to do the backup manually, moreover Microsoft add some security function to the licensing and activation technology recently to thwart piracy. So let us show you how to backup your office Activation. This is perfectly Legal as long as you have a valid activated license from me.
Microsoft only allows online/internet-based activation of the office wihtin a certain time period. So you will have to backup your license key for future reinstallation purposes. 
There is a free,third party app called OPA-Backup which lets you easily backup the activation of Microsoft Office and Windows 8 edition and restore it . It is legit and clean way to restore your acitvation. You can download it here.

===>OPA-Backup Download<===

How to Check Licensing of Windows 7/8/8.1/10

How to check the licensing of Windows?

This guide can be use for Windows 7, 8,8.2 and 10. Not sure about windows XP because I din't tried.
After you tried maybe can leave comment to tell us whether it work or not.

Basically , windows license got 3 type of licenses:

Full Packaged Product (Retail)Reinstalled on PC (OEM)Volume Licensing There are available 1 more licensing for windows 10 , which are Windows 10 Pro upgrade licensing which allow to upgrade all the windows 7/8/8.1 to windows 10 Pro.

Step To Check Licensing:
Press Windows key + R.Then key in "slmgr.vbs /dlv"Then a dialog will show up to show you which kind of license you have. Retail/OEM / Volume Licensing.