Skip to content

Instantly share code, notes, and snippets.

@jonikarppinen
jonikarppinen / proguard-project.txt
Last active August 1, 2017 09:56
Example ProGuard config for a project using RxJava, Guava and Gson
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
@mcquinne
mcquinne / md5.groovy
Created May 10, 2012 20:46 — forked from ikarius/md5.groovy
Generate MD5 hash of a file while being as Groovy as possible.
def generateMD5( File file ) {
def digest = java.security.MessageDigest.getInstance("MD5")
file.eachByte( 4096 ) { buffer, length ->
digest.update( buffer, 0, length )
}
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}

Logstash+Redis+Elasticsearch+Kibana日志监控报警系统

@(服务监控)[logstash|Elasticsearch|kibana]

工具介绍

Logstash:用于收集、处理、传输日志数据。
Redis:用于实时标识和传输日志数据。
Elasticsearch:用于实时查询和解析数据。
Kibana:用于数据可视化。

工作流程

@ikarius
ikarius / md5.groovy
Created February 9, 2010 09:57
How to generate a MD5 hash in Groovy ...
def generateMD5(String s) {
MessageDigest digest = MessageDigest.getInstance("MD5")
digest.update(s.bytes);
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}
@border
border / long_polling.go
Created September 25, 2012 09:58
long polling for golang
package main
import (
"container/list"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@simon04
simon04 / gist:6865179
Last active February 15, 2022 06:14
Gradle, Java plugin, Jar MANIFEST, Class-Path is empty

Gradle, Java plugin, Jar MANIFEST, Class-Path is empty

I struggled with with the jar MANIFEST file built with Gradle containing an empty Class-Path. I traced down the problem to the order of the dependencies and jar blocks in the build.gradle file:

Wrong (jar before dependencies):

jar {
    manifest.attributes(
@w0rldart
w0rldart / install-mongodb.sh
Last active April 3, 2022 00:53
Installing MongoDB on Ubuntu 15.04
#!/bin/sh
##
## Bash install script for mongo 3.2 for Ubuntu 15.04, because of
## the replacement of upstart with systemd
##
## - AUTHOR: Alexandru Budurovici <https://w0rldart.com>
## - VERSION: 1.0
##
@jmruc
jmruc / README.md
Created June 24, 2013 19:19
Generating pom.xml from gradle

To generate a pom.xml file just run gradle writeNewPom

If you want to generate it as pom.xml in the root of the project, replace writeTo("$buildDir/newpom.xml") with writeTo("pom.xml")

@Frank-Zhu
Frank-Zhu / HttpClientSslHelper.java
Last active April 18, 2023 08:55
Android HTTPS SSL双向验证
package com.ecloud.ssldemo;
import android.content.Context;
import android.util.Log;
import com.squareup.okhttp.OkHttpClient;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.scheme.Scheme;
@soffchen
soffchen / Surge.md
Last active August 10, 2023 13:56
Surge

Feature

  • 替代 PAC,实现根据规则区分选择代理线路
  • 支持 SOCKS5 和 Shadowsocks 协议
  • 完整支持所有的 Shadowsocks 加密方式 (table, rc4-md5, salsa20, chacha20, aes-256-cfb, aes-192-cfb, aes-128-cfb, bf-cfb, cast5-cfb, des-cfb, rc2-cfb, rc4, seed-cfb)
  • 全面支持双向 HTTP Keep-Alvie
  • 快,各种黑科技加速
  • 直接临时修改某个域名的访问规则 (暂时仅 Mac 版本)
  • 支持使用 GeoIP 规则决定线路

Usage