Skip to content

Instantly share code, notes, and snippets.

@lfcabend
lfcabend / LibnfcJava.java
Created December 3, 2016 02:06 — forked from dzindra/LibnfcJava.java
Quick and dirty way how to use libnfc in java
package nfc;
import javax.smartcardio.CommandAPDU;
public class LibnfcJava {
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
public static String bytesToHex(byte[] bytes, int count) {
int len = Math.min(bytes.length, count);
char[] hexChars = new char[len * 3];
@lfcabend
lfcabend / gist:b28f85da53558998c6d8a8ff4b20d9e6
Last active February 16, 2017 23:39
Connect raspberry pizero to internet. Based on Andrew Scheller script -> https://gist.github.com/lurch/ad939bbce48064cffdb215268eac9f62
#!/bin/bash
# Automatically setup routing and DNS for a PiZero connected over a USB-network
# NOTE: Before running this script for the first time, you need to run the
# following two commands on your Linux PC
# sudo sysctl -w net.ipv4.ip_forward=1
# sudo iptables -t nat -A POSTROUTING -s 169.254.0.0/16 -o eth0 -j MASQUERADE
# (replace eth0 in the second command with your internet-facing network device,
# e.g. wlan0 on a laptop)
# The Avahi-discovered hostname