Skip to content

Instantly share code, notes, and snippets.

View ryanamaral's full-sized avatar

Ryan Amaral ryanamaral

View GitHub Profile
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@ryanamaral
ryanamaral / android-backup-apk-and-datas.md
Created December 8, 2020 17:06 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@ryanamaral
ryanamaral / AndroidManifest.xml
Created July 30, 2020 02:41 — forked from Sunno/AndroidManifest.xml
Set a custom contact item in android address book
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my_app" >
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<!-- for syncing -->
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
@ryanamaral
ryanamaral / README.md
Created July 5, 2020 16:55 — forked from manzoorwanijk/README.md
Google Script to bypass the blockage of Telegram Bot API from by webhost

WPTelegram Google Script

You can use this script to bypass the bans on Telegram API by different hosts. Simply send the request to this script instead of the Telegram Bot API after deploying it as a web app and allowing anonymous access.

Params

It accepts bot GET and POST requests with the following params

name type Description
@ryanamaral
ryanamaral / gzip.kts
Created June 20, 2020 23:44 — forked from sgdan/gzip.kts
Kotlin code to compress/uncompress a string with gzip
import java.io.ByteArrayOutputStream
import java.io.File
import java.nio.charset.StandardCharsets.UTF_8
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
fun gzip(content: String): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(content) }
return bos.toByteArray()
@ryanamaral
ryanamaral / ffmpeg-compress-mp4
Created May 6, 2020 23:58 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@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