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
__author__ = 'youngsoul' | |
import time | |
import random | |
from string import Template | |
import urllib2 | |
""" | |
Dev Note: |
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
""" | |
vi /etc/opkg.conf | |
— delete line ‘option check_signature 1' | |
opkg update | |
mkdir -p /home/bottle | |
wget --no-check-certificate https://github.com/defnull/bottle/raw/master/bottle.py | |
opkg install python-light | |
opkg install python-email | |
opkg install python-codecs | |
opkg install python-logging |
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
#include "InternetButton/InternetButton.h" | |
/** | |
* Session3 Project | |
* Upon Startup: | |
* ** create a rainbow with the LEDs. hint: b.rainbow(10); | |
* ** set the Button LEDs (at position 3,6,9,12) to Red | |
* ** subscribe to an event called, 'showRainbow' that shows rainbow | |
* and returns the LEDs to their previous color. Either red or Green | |
* ** create a function call 'doReset' that will reset the LEDs to Red | |
* |
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
#!/bin/bash | |
# https://www.raspberrypi.org/documentation/linux/software/python.md | |
echo "Run sudo raspi-config? [y/N]:" | |
read runraspi | |
if [ "$runraspi" = "y" ] | |
then | |
echo "*** execute: sudo raspi-config ***" | |
echo "Perform the following configuration tasks:" | |
echo "*** Expand the root filesystem ***" |
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
https://forums.adafruit.com/viewtopic.php?f=50&t=100684&p=503827#p503827 | |
sudo apt-get remove python3-pip | |
sudo easy_install3 pip | |
then retry the pip3 install <package> |
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
# https://community.onion.io/topic/489/is-there-a-step-by-step-for-setting-up-private-public-key-use/2 | |
cd ~/.ssh | |
eval `ssh-agent -s` | |
ssh-keygen -t rsa -C "[email protected]" | |
ssh-add id_rsa |
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 pandas as pd | |
from io import StringIO | |
import requests | |
requests.packages.urllib3.disable_warnings() | |
url = 'http://bit.ly/movieusers' | |
data = requests.get(url=url, verify=False).text | |
data_reader = StringIO(data) |
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
from six.moves import urllib | |
from sklearn.datasets import fetch_mldata | |
import requests | |
requests.packages.urllib3.disable_warnings() | |
""" | |
Adapted from the Github repo: | |
https://github.com/ageron/handson-ml | |
for the 03_classification notebook. |
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
# create a collection of the ordered months | |
all_months = ['January', 'February', 'March', 'April','May','June','July','August','September', 'October', 'November', 'December'] | |
# create a categorical column from the month column | |
flights['ordered_month'] = pd.Categorical(flights['month'], all_months) | |
flights.head() | |
fp = flights.pivot_table(index='ordered_month', columns='year', values='passengers') | |
sns.heatmap(fp) |
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
# This gist is a re-work of the file: CE_PYTHON_LIB/MCP3428_N.py | |
# from ControlEverythingCommunity github page | |
# https://github.com/ControlEverythingCommunity/CE_PYTHON_LIB/blob/3c3b1be89dc105d7f11e4d0549a689f1cf145ac2/MCP3428_N.py | |
# | |
# I modified it so that it would actually handle 16 bit, 14 bit and 12 bit resolution settings. | |
# The other thing I noticed, was that at full 10V scale, I expected a value of 65535 ( or close ) but instead I got a | |
# values closer to 32768. I am not sure exactly why that is. | |
# I also modified to show the voltage ( assuming a 10V input ) | |
# Distributed with a free-will license. |
OlderNewer