This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import network | |
import socket | |
import time | |
from machine import Pin | |
import uasyncio as asyncio | |
led = Pin(15, Pin.OUT) | |
onboard = Pin("LED", Pin.OUT, value=0) |
You probably want the activerecord-postgres_enum
gem, because it adds some good stuff for your migrations and allows you to keep using the schema.rb
(instead of switching to a schema.sql
:
gem 'activerecord-postgres_enum'
Your migration would then look like this:
class AddCountryToCities < ActiveRecord::Migration[5.2]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker pull amazonlinux | |
sudo docker run -it amazonlinux:latest /bin/bash | |
# inside container | |
yum -y install python37 zip | |
python3 -m venv python | |
source python/bin/activate | |
pip3 install matplotlib | |
deactivate | |
rm -rf python/{bin,include,lib64,pyvenv.cfg} python/lib/python3.7/site-packages/{__pycache__,easy_install.py,numpy*,pip*,pkg_resources,setuptools*} |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
Stream audio to any Sonos component via AirPlay using a Raspberry Pi (Model B, Raspbian Jessie) and the following software:
- Shairport Sync: configures the Raspberry Pi as an AirPlay audio player.
- DarkIce: encodes audio received from AirPlay (system audio) and sends it to Icecast2.
- Icecast2: serves streaming audio from DarkIce at a network URL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
import tempfile | |
import urllib | |
text = sys.stdin.read() | |
chart_url_template = ('http://chart.apis.google.com/chart?' | |
'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
chart_url = chart_url_template.format(data=urllib.quote(text)) |