This file contains hidden or 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
| #!/usr/bin/env bash | |
| ATOM_DOWNLOAD_URL='https://atom.io/download/deb' | |
| ATOM_DOWNLOAD_DIR="$HOME/Downloads" | |
| ATOM_DEB_FILE="$ATOM_DOWNLOAD_DIR/atom.deb" | |
| wget $ATOM_DOWNLOAD_URL --output-document=$ATOM_DEB_FILE && \ | |
| sudo dpkg --install $ATOM_DEB_FILE && \ | |
| rm $ATOM_DEB_FILE |
This file contains hidden or 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 io | |
| import os | |
| from zipfile import ZipFile | |
| from boto3.session import Session | |
| session = Session( | |
| aws_access_key_id='your-aws-access-key', | |
| aws_secret_access_key='your-iam-secret-key', | |
| region_name='your-aws-region') |
This file contains hidden or 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 fabric.api import env, sudo | |
| env.use_ssh_config = True | |
| env.hosts = ['raspberry_pi'] | |
| def update_upgrade(): | |
| sudo('apt-get update') | |
| sudo('apt-get upgrade -y') |
This file contains hidden or 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 .alfred_script_filter_xml import build_xml |
This file contains hidden or 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
| Host raspberry_pi | |
| Hostname 10.0.1.31 | |
| User pi | |
| Forwardx11 yes | |
| ServerAliveInterval 300 |
This file contains hidden or 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
| void writeJSONToSerial(void) | |
| { | |
| String jsonString = "{\"temp_f\":"; | |
| jsonString += sensordata.tempF; | |
| jsonString += ",\"temp_c\":"; | |
| jsonString += sensordata.tempC; | |
| jsonString += "}"; | |
| Serial.println(jsonString); | |
| } |
This file contains hidden or 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 json | |
| import serial | |
| # this port address is for the serial tx/rx pins on the GPIO header | |
| SERIAL_PORT = '/dev/ttyAMA0' | |
| # be sure to set this to the same rate used on the Arduino | |
| SERIAL_RATE = 9600 | |
This file contains hidden or 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 serial | |
| # this port address is for the serial tx/rx pins on the GPIO header | |
| SERIAL_PORT = '/dev/ttyAMA0' | |
| # be sure to set this to the same rate used on the Arduino | |
| SERIAL_RATE = 9600 | |
| def main(): |
This file contains hidden or 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 apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get dist-upgrade |
This file contains hidden or 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 requests | |
| response = requests.get('https://api.github.com/users/projectweekend') | |
| data = response.json() | |
| message = "{0} has {1} followers and {2} public repos." | |
| print(message.format(data['login'], data['followers'], data['public_repos'])) |
NewerOlder