Skip to content

Instantly share code, notes, and snippets.

View ryanamaral's full-sized avatar

Ryan Amaral ryanamaral

View GitHub Profile
@ryanamaral
ryanamaral / vpn.md
Created May 1, 2020 04:41 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@ryanamaral
ryanamaral / BondingHelper.java
Created December 4, 2019 16:48 — forked from dglozano/BondingHelper.java
BondHelper class for BLE Devices with encrypted characteristics
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.polidea.rxandroidble2.RxBleDevice;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
@ryanamaral
ryanamaral / mifare-desfire.terminal.log
Created November 27, 2018 10:39 — forked from vmlemon/gist:1208504
A list of files and applications contained on an Oyster card
tyson@UmBongo:~/nfc-tools-read-only/libfreefare/examples$ lsnfc
device = ACS ACR122U 00 00 / ACR122U103 - PN532 v1.6 (0x07)
UID=048b1ff1ad2680
Several possible matches:
* NXP MIFARE DESFire EV1 2k
* NXP MIFARE Plus 1k
* NXP MIFARE Plus 4k
* NXP JCOP31 or JCOP41
1 tag(s) on device.
@ryanamaral
ryanamaral / gist:3c4d7c7dada4e9df5d117f91cd890523
Created November 13, 2018 21:24 — forked from alphazo/gist:3303282
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer

@ryanamaral
ryanamaral / RsaExample.java
Created November 4, 2018 18:46 — forked from nielsutrecht/RsaExample.java
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
@ryanamaral
ryanamaral / cards.json
Created November 4, 2018 16:46 — forked from svdgraaf/cards.json
Raspi RFID scanner
{
"170038E91C": "1003729691",
"17003F5A1D": "1004151834"
}
@ryanamaral
ryanamaral / aws-rekognition-with-iot
Created November 4, 2018 16:19 — forked from softberries/aws-rekognition-with-iot
Lambda funtion for comparing photos and publishing back to IoT
from __future__ import print_function
import boto3
from decimal import Decimal
import json
import urllib
print('Loading function')
rekognition = boto3.client('rekognition')
@ryanamaral
ryanamaral / rpi_rfid_rekogntion.py
Created November 4, 2018 16:19 — forked from softberries/rpi_rfid_rekogntion.py
Access Control System with Raspberry Pi, RFiD and AWS Rekogintion
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import sys
import logging
import time
import getopt
from datetime import datetime
import picamera
import os
import tinys3
import json
@ryanamaral
ryanamaral / Contract Killer 3.md
Created September 18, 2018 23:09 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@ryanamaral
ryanamaral / DaggerBottomSheetDialogFragment.kt
Created July 25, 2018 21:11
DaggerBottomSheetDialogFragment
import android.content.Context
import android.support.design.widget.BottomSheetDialogFragment
import android.support.v4.app.Fragment
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
import dagger.android.support.AndroidSupportInjection
import dagger.android.support.HasSupportFragmentInjector
import javax.inject.Inject