Skip to content

Instantly share code, notes, and snippets.

@wzxjohn
wzxjohn / kmskeys10.txt
Created May 18, 2017 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
View kmskeys10.txt
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 — forked from crazybyte/certs.txt
OpenSSL transformations
View certs.txt
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
View 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;
View extract_zip_in_correct_encoding.php
<?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 Sep 4, 2015 — forked from iley/pre-receive
pre-receive hook to deny pushing big files
View pre-receive
#!/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 Jul 11, 2017 — forked from gmaccarone/pre-receive
commit size pre-receive hook
View pre-receive
#!/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 Sep 2, 2015
Uninstall script of Aliyun "aegis"
View uninstall.sh
#!/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 Aug 29, 2015 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
View Linux Static IP
## 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 Jul 15, 2014
Backup VPS files to DropBox
View backup-to-dropbox.sh
#!/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 Aug 29, 2015
A simple script to synchronize time with any web server based on Date in HTTP response header
View http_time.sh
#!/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=""
You can’t perform that action at this time.