There are two parts to networking within QEMU:
- The virtual network device that is provided to the guest (e.g. a PCI network card).
- The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).
This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.
A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
// Wrapper for windows subsystem for linux (Bash on Ubuntu on Windows) | |
// It allows running native ubuntu applications from Windows | |
// 1. Compile (on windows, the command below is for mingw-gcc): | |
// g++ -O3 -flto -fwhole-program -fvisibility=hidden -fno-exceptions -fno-rtti -s win2lin.cpp -o win2lin.exe | |
// 2. make a copy for each program | |
// for i in git python perl; do cp win2lin.exe ${i}.exe; done | |
// 3. put directory with exes in windows PATH | |
// 4. example (from cmd.exe): | |
// cat "c:\test 1.txt" | |
// will be translated to: bash -c "exec cat \"/mnt/c/test 1.txt\"" |
# | |
# The following script will | |
# - Create Linux bridge $BR_WAN, $BR_LAN | |
# - Install IP addresses and basic routes | |
# - Enable proxy_arp on $BR_WAN | |
# - Enable ip_forward | |
# - Enable MASQUERADE on $IF_INET | |
# - $BR_LAN, $BR_WAN has to be allowed in ~/.usr/etc/qemu/bridge.conf | |
# |
function initWIFI() | |
print("Setting up WIFI...") | |
wifi.setmode(wifi.STATION) | |
wifi.sta.config("<wifi-id>", "<wifi-password>") | |
wifi.sta.connect() | |
tmr.alarm(1, 1000, 1, | |
function() | |
if wifi.sta.getip()== nil then | |
print("IP unavailable, Waiting...") |
from flask import Flask | |
from authy import auth | |
def create_app(): | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'hmm.' | |
from views import mod as exampleMod | |
app.register_blueprint(exampleMod) |
"""ssh-copy-id for Windows. | |
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine | |
This script is dependent on msysgit by default as it requires scp and ssh. | |
For convenience you can also try that comes http://bliker.github.io/cmder/. | |
""" | |
import argparse, os | |
from subprocess import call |