Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Bin Zhang gembin

🎯
Focusing
Block or report user

Report or block gembin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SslUtil.java
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
View comp-repo.sh
#!/bin/bash
#
# Tool to maintain p2 composite repositories
USAGE="Usage:
`basename "$0"` <repo-dir> [options] operation, operation ...
Options:
--name <repo name>
the repository name
--eclipse <eclipse install dir>
View charting.libraries.md
View ipv6-regex-test.sh
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
View EmbeddedKafkaCluster.java
import kafka.server.KafkaConfig;
import kafka.server.KafkaServer;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
View UndertowServer.java
package vmarcinko.undertow;
import io.undertow.Handlers;
import io.undertow.Undertow;
import io.undertow.server.HttpHandler;
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.handlers.RedirectHandler;
import io.undertow.server.handlers.resource.FileResourceManager;
import io.undertow.servlet.Servlets;
import io.undertow.servlet.api.DeploymentInfo;
@gembin
gembin / ansi.js
Created Jul 21, 2012 — forked from Twisol/ansi.js
ANSI sequence parser (Node.js) and client-side renderer
View ansi.js
var sys = require("sys");
var ANSI = (function() {
sys.inherits(ANSI, require("events").EventEmitter);
function ANSI() {
this.state = "plain";
this.reset();
}
@gembin
gembin / pbkdf2.java
Created Oct 8, 2012 — forked from craSH/pbkdf2.java
Java PBKDF2 method + string wrapper, relies on some external methods for converting to hex strings.
View pbkdf2.java
public String hashPassword(String password, String salt) throws Exception
/*
* Wrap pbkdf2 method to return password hash as a hex string
*/
{
// Bail if password or salt are null/0 length
if ((null == password || 0 == password.length()) || (null == salt || 0 == salt.length()))
throw new Exception("Failed to create PBKDF2 Hash for password, password or salt can not be empty");
// Result string
@gembin
gembin / tasks.yml
Created Dec 10, 2015 — forked from maxim/tasks.yml
Copy file on remote machine in ansible
View tasks.yml
- name: ensure file exists at path
shell: rsync -ci /source/path /destination/path
register: rsync_result
changed_when: "rsync_result.stdout != ''"
@gembin
gembin / initd
Created Dec 10, 2015 — forked from pdeschen/initd
CentOS service initd erb template. Ready to use in Opscode Chef or replace template variables with your own hard-coded value. Takes into account priority/nice, sudo user, and /etc/sysconfig/ Support start, stop, restart, console.
View initd
#!/bin/sh
#
# <%=@service%> This shell script takes care of starting and stopping
# the <%=@service%> service.
#
# chkconfig: 2345 65 35
# description: <%=@description%>
#
SERVICE=<%=@service%>
You can’t perform that action at this time.