Skip to content

Instantly share code, notes, and snippets.

View zhangchengtest's full-sized avatar
🎯
Focusing

zhangchengtest

🎯
Focusing
View GitHub Profile
@zhangchengtest
zhangchengtest / chmod-400.cmd
Created May 3, 2022 06:06 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@zhangchengtest
zhangchengtest / CORSFilter.java
Created May 26, 2016 09:42 — forked from zeroows/CORSFilter.java
To enable CORS support in Spring MVC 4 - Access-Control-Allow-Origin
package com.elm.mb.rest.filters;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;