Skip to content

Instantly share code, notes, and snippets.

@diega
diega / add-VFS5011-support.patch
Created January 26, 2015 18:38
Adds support for Thinkpad T440s Fingerprint reader to package libfprint against master (35e356f)
New driver for VFS5011 138a:0011
Index: libfprint-upstream/configure.ac
===================================================================
--- libfprint-upstream.orig/configure.ac 2015-01-25 09:55:36.805706373 -0300
+++ libfprint-upstream/configure.ac 2015-01-26 15:15:22.732795614 -0300
@@ -1,10 +1,10 @@
AC_INIT([libfprint], [0.5.1])
-AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz check-news subdir-objects])
+AM_INIT_AUTOMAKE([1.13 no-dist-gzip dist-xz check-news subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
@diega
diega / add-VFS5011-support-fdo.patch
Created January 26, 2015 12:14
Adds support for Thinkpad T440s Fingerprint reader to package libfprint0 v0.5.1-1 based on https://bugs.freedesktop.org/show_bug.cgi?id=61692
Index: libfprint-0.5.1/configure.ac
===================================================================
--- libfprint-0.5.1.orig/configure.ac 2013-08-11 12:53:21.000000000 -0300
+++ libfprint-0.5.1/configure.ac 2015-01-26 08:58:30.107128894 -0300
@@ -23,7 +23,8 @@
AC_SUBST(lt_revision)
AC_SUBST(lt_age)
-all_drivers="upeke2 upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes1660 aes2501 aes2550 aes2660 aes4000 vfs101 vfs301"
+all_drivers="upeke2 upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes1660 aes2501 aes2550 aes2660 aes4000 vfs101 vfs301 vfs5011"
@diega
diega / add-VFS5011-support.patch
Last active August 29, 2015 14:14
Adds support for Thinkpad T440s Fingerprint reader to package libfprint0 v0.5.1-1 based on https://github.com/ars3niy/fprint_vfs5011
Support for Validity VFS5011 (138a:0017)
Index: libfprint-0.5.1/libfprint/Makefile.am
===================================================================
--- libfprint-0.5.1.orig/libfprint/Makefile.am 2015-01-25 22:57:43.943345811 -0300
+++ libfprint-0.5.1/libfprint/Makefile.am 2015-01-25 22:57:43.935345904 -0300
@@ -17,6 +17,7 @@
VCOM5S_SRC = drivers/vcom5s.c
VFS101_SRC = drivers/vfs101.c
VFS301_SRC = drivers/vfs301.c drivers/vfs301_proto.c drivers/vfs301_proto.h drivers/vfs301_proto_fragments.h
+VFS5011_SRC = drivers/vfs5011.c drivers/vfs5011_proto.h
@diega
diega / InMemoryLookupService.java
Created December 7, 2014 20:29
Reimplementation of Maxmind GeoIP Legacy for supporting full in memory lookups
package net.taringa.zeti.maxmind;
import com.maxmind.geoip.Country;
import com.maxmind.geoip.DatabaseInfo;
import com.maxmind.geoip.Location;
import com.maxmind.geoip.Region;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
var vertx = require("vertx");
var console = require("vertx/console");
var eb = require('vertx/event_bus');
var fs = vertx.fileSystem;
var path = "data.log";
registerAppend = function() {
var unwrittenBytes = 0;
fs.open(path, fs.OPEN_WRITE | fs.CREATE_NEW, true, function(err, asyncFile) {
var vertx = require("vertx");
var console = require("vertx/console");
var eb = require('vertx/event_bus');
var fs = vertx.fileSystem;
var path = "data.log";
var unwrittenBytes = 0;
append = function(msg) {
var buff = new vertx.Buffer(java.util.Calendar.getInstance().getTimeInMillis() + "\n");
@diega
diega / ProtocolBufferFileGenerator.java
Created November 3, 2012 17:12
How to generate binary files containing Protobuf serialization from human readable input (Applied to RealtimeBidding)
import com.google.adex.rtb.RealtimeBidding;
import com.google.protobuf.TextFormat;
import java.io.*;
public class ProtocolBufferFileGenerator {
public void generateBinaryFile() throws IOException {
RealtimeBidding.BidRequest.Builder builder = RealtimeBidding.BidRequest.newBuilder();
@diega
diega / RunInVertx.java
Created June 24, 2012 15:16
Vert.x Junit4 verticles test
package org.vertx.java.junit.support;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.vertx.java.core.Handler;
import org.vertx.java.core.impl.DefaultVertx;
import org.vertx.java.core.impl.VertxInternal;
import org.vertx.java.deploy.Verticle;
import org.vertx.java.deploy.impl.VerticleManager;
@diega
diega / AppTest.java
Created June 30, 2010 15:22
Simple HTTP client with basic authentication
package org.plugtree.guvnor;
import java.io.IOException;
import java.io.StringWriter;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;