Skip to content

Instantly share code, notes, and snippets.

@wzxjohn
wzxjohn / kmskeys10.txt
Created May 18, 2017 13:20 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# technet.microsoft.com/en-us/library/jj612867.aspx?lc=1033 #
#####################################################################
Windows 10 Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 10 Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Windows 10 Education NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Windows 10 Education N 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
@wzxjohn
wzxjohn / certs.txt
Created May 13, 2017 13:50 — forked from crazybyte/certs.txt
OpenSSL transformations
NOTE: HTTP SSL keys are all in PEM format (base64 encoded)
#From PEM format to DER
openssl x509 -in $1.crt -out $1.der -outform DER
#From DER format to PEM
openssl x509 -in $1.der -inform DER -out $1.pem -outform PEM
#Transforming RSA key to DER format
openssl rsa -in oberon.key -inform PEM -out oberon_key.der -outform DER
@wzxjohn
wzxjohn / google-fonts-proxy
Created February 16, 2017 02:05 — forked from gaoyifan/google-fonts-proxy
google-fonts-proxy
server {
listen 80;
listen 443;
listen [::]:80;
listen [::]:443;
server_name fonts.lug.ustc.edu.cn;
access_log /var/log/nginx/revproxy_access.log;
error_log /var/log/nginx/revproxy_error.log;
@wzxjohn
wzxjohn / extract_zip_in_correct_encoding.php
Created September 27, 2016 07:27 — forked from si1en2i0/extract_zip_in_correct_encoding.php
Linux/MacOS下解压中文乱码的zip包
<?php
/**
* 解压含有文件名为UTF-8编码的zip包,到当前目录
*
* Mac OS X 系统自带的压缩程序对 zip 文件名用 UTF-8 编码
* 但 zip 文件头中没有声明 PKZIP 高版本增加的 Unicode 位。
* Windows 会认为文件名是 ANSI 编码,结果显示乱码。
*
* @uses zipcorrect.php file.zip
@wzxjohn
wzxjohn / pre-receive
Last active September 4, 2015 08:49 — forked from iley/pre-receive
pre-receive hook to deny pushing big files
#!/usr/bin/perl -wl
use strict;
my $limit = 1024 * 1024;
my $hasBadFiles;
while (<>) {
chomp;
my ($old, $new, $ref) = split / /, $_;
@wzxjohn
wzxjohn / pre-receive
Last active July 11, 2017 16:34 — forked from gmaccarone/pre-receive
commit size pre-receive hook
#!/bin/sh
GITCMD="/usr/local/bin/git"
NULLSHA="0000000000000000000000000000000000000000"
MAXSIZE="5242880" # 5MB limit on file size
EXIT=0
# Read stdin for ref information
while read oldref newref refname; do
# Skip branch deletions
@wzxjohn
wzxjohn / uninstall.sh
Created September 2, 2015 13:50
Uninstall script of Aliyun "aegis"
#!/bin/bash
# official link: http://update.aegis.aliyun.com/download/uninstall.sh
#check linux Gentoo os
var=`lsb_release -a | grep Gentoo`
if [ -z "${var}" ]; then
var=`cat /etc/issue | grep Gentoo`
fi
if [ -d "/etc/runlevels/default" -a -n "${var}" ]; then
@wzxjohn
wzxjohn / Linux Static IP
Last active August 29, 2015 14:28 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@wzxjohn
wzxjohn / backup-to-dropbox.sh
Created July 15, 2014 13:59
Backup VPS files to DropBox
#!/bin/bash
# 一些配置
DROPBOX_DIR=/$(date +%Y-%m-%d) # Dropbox 目录,根目录 / 是你已经创建的 app 目录
MYSQL_USER="root"
MYSQL_PASS="password"
MYSQL_DB=('wordpress' 'project2')
BACK_DATA=/root/backup-data # 备份文件保存在本地的目录
DATA=/var/www # 需要备份的网站文件
# 定义备份文件名
@wzxjohn
wzxjohn / http_time.sh
Last active August 29, 2015 14:03
A simple script to synchronize time with any web server based on Date in HTTP response header
#!/bin/bash
#Set localtime based on server's http response time
#By Orange
host="www.google.com"
#server host name
timeout="5"
#acceptable time out for curl
proxyHost=""
proxyPort=""