Skip to content

Instantly share code, notes, and snippets.

View gembin's full-sized avatar
🎯
Focusing

gembin

🎯
Focusing
  • Seattle, WA
View GitHub Profile
@gembin
gembin / ansi.js
Created July 21, 2012 15:15 — forked from Twisol/ansi.js
ANSI sequence parser (Node.js) and client-side renderer
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 October 8, 2012 07:08 — forked from craSH/pbkdf2.java
Java PBKDF2 method + string wrapper, relies on some external methods for converting to hex strings.
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 / redis-server
Last active December 15, 2015 20:41 — forked from tessro/redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}
apply plugin: "java"
apply plugin: "eclipse"
repositories {
mavenCentral()
}
dependencies {
compile (
"org.jboss.netty:netty:latest.integration",
package jd.plugins.hoster;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
#!/bin/bash
#
# Tomcat 7 start/stop/status script
# Forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates:
# Updated method for gathering pid of the current proccess
# Added usage of CATALINA_BASE
# Added coloring and additional status
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@gembin
gembin / pom.xml
Created December 11, 2013 09:09 — forked from nicoulaj/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Benchmark code goes into src/test/java -->
<dependencies>
<dependency>