Skip to content

Instantly share code, notes, and snippets.

@willnix
willnix / usb-android-emulator-ubuntu.md
Last active May 14, 2020 18:08 — forked from Alabate/usb-android-emulator-ubuntu.md
Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04

Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04

The android emulator doesn't support all usb devices because they are disabled in the kernel. So we need to build it with another configuration. My goal was to build the same version as it was before, but with just configuration modifications.

Find current android version

Start the emulator without modifications, go into

Configuration > System > About emulated device > Android version

@willnix
willnix / hashUnencodedChars.py
Created July 4, 2019 23:15
Python version of hashUnencodedChars
#!/usr/bin/env python3
import hashlib
def hash_unencoded_chars(s: str) -> hashlib.sha256:
""" hash_unencoded_chars - emulates com.google.common.hash.Hashing.sha256().hashUnencodedChars(s)
Google's java library guava comes with the hashUnencodedChars function
which yields different results than most other language's hashing functions.
This function should be compatible.
"""
{"@context":"http://schema.org","@type":"Recipe","author":"jo","name":"test","datePublished":"2018-03-12","description":"bla.","recipeIngredient":["1 Avocado", "150 g Basmatireis", "125 g Cherrytomaten", "½ Chili", "¼ TL Chilipulver", "¼ TL Chilis", "48 g Erdnüsse", "350 g festkochende Kartoffeln von REWE Regional", "3⅜ Frühlingszwiebeln", "15 g Frühlingszwiebeln", "¼ TL Garam Masala", "½ TL gemahlene Kurkuma", "½ TL gemahlener Koriander", "½ TL gemahlener Kreuzkümmel", "¼ TL geräuchertes Paprikapulver", "¼ TL getrockneter Oregano", "¾ TL Harissa Gewürzpaste", "5 g Ingwer", "Joghurt", "¾ Karotte", "1 Karotten", "125 g Kichererbsen (vorgegart, abgetropft)", "1 TL Kitchen Stories Viva la Spice Gewürzmischung (optional)", "1 Zehe Knoblauch", "2 Zehen Knoblauch", "½ Zehe Knoblauch", "15 g Koriander", "5 g Koriander", "8 g Koriander", "5 g Koriander", "¾ TL Kreuzkümmelsamen", "½ TL Kurkuma", "½ Limette", "2 Limetten", "1 Lorbeerblatt", "175 g Mais aus der Dose", "5 g Minze", "8 g Minze", "10 g Minze", "4 EL