Skip to content

Instantly share code, notes, and snippets.

@FreddieOliveira
FreddieOliveira / docker.md
Last active August 28, 2024 21:40
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

# Code inspired by (or copied from)
# https://github.com/fchollet/keras/blob/master/keras/applications/vgg16.py
# https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3
#
# VGG16 weights: https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
# VGG16 image classes: https://github.com/raghakot/keras-vis/blob/master/resources/imagenet_class_index.json
#
import json
import sys
@JamieCressey
JamieCressey / dict_to_dynamodb_item.py
Created April 24, 2016 20:56
Coverts a standard Python dictionary to a Boto3 DynamoDB item
def dict_to_item(raw):
if type(raw) is dict:
resp = {}
for k,v in raw.iteritems():
if type(v) is str:
resp[k] = {
'S': v
}
elif type(v) is int:
resp[k] = {
@jakzal
jakzal / AuthenticationContext.php
Last active May 2, 2022 10:18
Logging user into a Symfony app in Behat
<?php
namespace Acme\Context;
use Acme\MyApp\User;
use Behat\MinkExtension\Context\RawMinkContext;
use Behat\Symfony2Extension\Context\KernelAwareInterface;
use Doctrine\ORM\EntityManager;
use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken;
use Symfony\Component\HttpKernel\KernelInterface;