Skip to content

Instantly share code, notes, and snippets.

View neesonqk's full-sized avatar
🎯
Focusing

N.z neesonqk

🎯
Focusing
View GitHub Profile
@neesonqk
neesonqk / maintenance-mode.conf
Created November 13, 2016 07:26 — forked from rictorres/maintenance-mode.conf
nginx maintenance mode
server {
listen 80;
server_name mysite.com;
root /var/www/mysite.com/;
location / {
if (-f $document_root/maintenance.html) {
return 503;
}
... # the rest of your config goes here
@neesonqk
neesonqk / CORSFilter.java
Created May 2, 2017 15:31 — 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;
@neesonqk
neesonqk / sites-available-ghost
Created May 20, 2017 11:39 — forked from robotnealan/sites-available-ghost
DigitalOcean LetsEncrypt Nginx Config
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location ~ ^/.well-known {
root /var/www/ghost;
}
location / {
return 301 https://$server_name$request_uri;
@neesonqk
neesonqk / Git configuration command
Last active October 3, 2018 09:51
Git configuration command
#init
git init
# disable ssl verification
git config http.sslVerify false
# set proxy
git config http.proxy http://192.168.15.70:8899
# init repo
@neesonqk
neesonqk / delete.bat
Created October 1, 2018 10:15 — forked from lichengwu/delete.bat
win7/win8强制删除文件夹
@echo off
set /p path=path:
set /p user=user:
rem 我们需要修改文件或目录的所有者
takeown /F %path% /R
rem 给用户授权文件夹或文件的完全控制权限
@neesonqk
neesonqk / OpenSSH SSH Key
Last active October 9, 2018 09:51
Install OpenSSH on Windows & SSH Key Setup
# Download binary files
https://github.com/PowerShell/Win32-OpenSSH/releases
# Run from cmd.exe (administrator)
`powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1`
# Open 22 port (run under Powershell)
`New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH SSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22`
# Start service from Services.
@neesonqk
neesonqk / Mac: Create Static Routes
Last active October 31, 2018 03:19
Mac: Create Static Routes
# command # ip range # gateway
sudo route -n add 172.18.0.0/23 192.168.10.1
sudo route -n delete 172.18.0.0/23 192.168.10.1
# review
netstat -nr
@neesonqk
neesonqk / ubuntu-16.04-mysql
Created April 13, 2019 01:22
Install mysql for Ubuntu 16.04
sudo apt-get update
sudo apt-get install mysql-server
@neesonqk
neesonqk / ubuntu-16.04-java8
Created April 13, 2019 01:30
Install Java8/9 for Ubuntu 16.04
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
or
sudo apt-get install oracle-java9-installer
# Manage Java
sudo update-alternatives --config java
> There can be multiple Java installations on one server. You can configure which version is the default for use in the command line by using update-alternatives