You need:
- A reasonably modern Android device with a USB port
- A micro USB cable
from subprocess import PIPE, run, STDOUT | |
def get_aliases(): | |
aliases = [] | |
for line in run(["bash", '-i'], input='alias', stdout=PIPE, stderr=PIPE, | |
env={'PS1': ''}, encoding='utf-8').stdout.splitlines(): | |
name, cmd = line.split('=', 1) | |
aliases.append((name[6:], cmd[1:-1])) | |
return aliases |
#!/bin/bash | |
# | |
# open-in-firefox.sh - open URL from Termux command line in Firefox Android browser | |
# | |
# Works with file:// URLs too, unlike with termux-open{-url}. | |
# | |
exec am start --user 0 -a android.intent.action.VIEW -n org.mozilla.firefox/.App -d "$1" >/dev/null |
$ micropython uget.py key1=value1 key2=value2 key2=value3 | |
{'url': 'http://httpbin.org/get?key2=value3&key1=value1', 'headers': {'Host': 'httpbin.org', 'Connection': 'close'}, 'args': {'key2': 'value3', 'key1': 'value1'}, 'origin': 'XXX.XXX.XXX.XXX'} | |
$ micropython upost.py foo=bar spamm=42 | |
{'files': {}, 'headers': {'Host': 'httpbin.org', 'Content-Length': '16', 'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'close'}, 'args': {}, 'form': {'spamm': '42', 'foo': 'bar'}, 'origin': 'XXX.XXX.XXX.XXX', 'data': '', 'json': None, 'url': 'http://httpbin.org/post'} |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import requests | |
import time | |
from io import BytesIO | |
from os.path import join | |
from selenium import webdriver |
# -*- coding: utf-8 -*- | |
"""Extended Screen Manager for kivy with better convenience for switching between screens.""" | |
from six import string_types, iteritems | |
from kivy.logger import Logger | |
from kivy.uix.screenmanager import ScreenManager | |
from kivy.uix.screenmanager import ScreenManagerException | |
from kivy.uix.screenmanager import Screen |
import time | |
from collections import defaultdict | |
import rtmidi | |
from rtmidi.midiconstants import * | |
from rtmidi.midiutil import open_midiinput | |
class RPNDecoder: | |
def __init__(self, channel=1): |
#!python2 | |
# -*- coding: utf-8 -*- | |
"""Remote-controllable digital image frame with built-in web server.""" | |
import logging | |
import os | |
import re | |
import sys | |
import threading | |
import time |
#!/usr/bin/env python | |
from __future__ import print_function | |
import os | |
from subprocess import check_call, check_output, CalledProcessError | |
try: | |
input = raw_input | |
except NameError: |
import sys | |
# See https://github.com/SpotlightKid/jack-matchmaker/blob/master/jackmatchmaker/jacklib.py | |
import jacklib | |
result = jacklib.jack_status_t() | |
client = jacklib.client_open("transport-query", jacklib.JackNoStartServer, result) | |
if result: | |
sys.exit("Error connecting to JACK server.") |