Skip to content

Instantly share code, notes, and snippets.

@liangzai-cool
liangzai-cool / nginx.conf
Created June 14, 2016 01:57 — forked from baskaran-md/nginx.conf
NginX allow POST on static pages.
# ...
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
@liangzai-cool
liangzai-cool / readme.txt
Created June 28, 2016 05:31 — forked from fqrouter/readme.txt
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@liangzai-cool
liangzai-cool / build.xml
Created August 1, 2016 04:52 — forked from jasdeepkhalsa/build.xml
Sample Ant build.xml file for concat and minifying CSS & JS files by Addy Osmani
<?xml version="1.0" encoding="utf-8"?>
<project name="tutorialProject" default="prod" basedir="/Users/addy/buildTut/">
<description>Client-side ANT build file example</description>
<target name="-load.properties"
description="Set properties for this build">
<!--YUI Compressor location-->
<property name="yui.dir" value="${basedir}/yuicompressor/build/yuicompressor-2.4.2.jar"/>
<!--Source JS dir-->
@liangzai-cool
liangzai-cool / 20microsoft-win10.patch
Created September 19, 2016 06:19
a patch for os-prober, to resolve centos 7 + win10 dual system, but boot menu show 'Windows 7...'
--- /usr/libexec/os-probes/mounted/20microsoft 2016-09-19 00:09:25.917283774 -0400
+++ 20microsoft 2016-09-19 00:55:38.750505997 -0400
@@ -31,7 +31,9 @@
for boot in $(item_in_dir boot "$2"); do
bcd=$(item_in_dir bcd "$2/$boot")
if [ -n "$bcd" ]; then
- if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
+ if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
+ long="Windows 10 (loader)"
+ elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
/**
* jsoup 工具包
* founder
* @author XueLiang
* @date 2016年9月23日 下午3:16:36
* @version 1.0
*/
public class JsoupUtils {
/**
@liangzai-cool
liangzai-cool / build.gradle
Created November 2, 2016 06:11
config java compile encoding using gradle
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
@liangzai-cool
liangzai-cool / blog-build.xml
Created January 4, 2017 08:03
blog's ant build file.
<?xml version="1.0" encoding="UTF-8"?>
<project name="project-builder" basedir="." default="build-all">
<property environment="env"/>
<property name="debug" value="false"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="dist.war" value="blog.war"/>
@liangzai-cool
liangzai-cool / init.gradle
Created January 19, 2017 07:57
Using plugins in init scripts.
apply plugin:EnterpriseRepositoryPlugin
class EnterpriseRepositoryPlugin implements Plugin<Gradle> {
private static String ENTERPRISE_REPOSITORY_URL = "https://my.repository.com/repository/maven-public/"
void apply(Gradle gradle) {
// ONLY USE ENTERPRISE REPO FOR DEPENDENCIES
gradle.allprojects{ project ->
project.repositories {
@liangzai-cool
liangzai-cool / Easily keep gh-pages in sync with master.md
Last active February 16, 2017 06:13
Easily keep gh-pages in sync with master
@liangzai-cool
liangzai-cool / HttpUtils.java
Last active February 26, 2019 18:35
convert relative url to absolute url and beautify the result in java.
```
import java.net.MalformedURLException;
import java.net.URL;
public class HttpUtils {
public static void main(String[] args) throws MalformedURLException {
String urlString = "https://www.google.com///images//branding/1234567890/..\\googlelogo/abcdefg/../1x/googlelogo_color_272x92dp.png";
System.out.println(absUrl(urlString));