Skip to content

Instantly share code, notes, and snippets.

@lashex
lashex / aws-iot-mosquitto
Created May 23, 2016 21:05
Example Mosquitto CLI pub/sub using AWS IoT MQTT endpoint
The Mosquitto Pub CLI
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto"
The Mosquitto Sub CLI
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+'
#!/usr/bin/env python
import logging
import argparse
import ConfigParser
import boto.ec2
import boto.route53
from boto.route53.record import ResourceRecordSets
config = ConfigParser.SafeConfigParser({
@lashex
lashex / amazon-linux-python-3
Last active February 3, 2018 08:55
Install Python 3.4 on Amazon Linux 2014.09
sudo yum install gcc
sudo yum install zlib-devel
sudo yum install openssl-devel
sudo yum install bzip2-devel
sudo yum install readline-devel
wget https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
tar -xvf Python-3.4.1.tgz
cd Python-3.4.1/
@lashex
lashex / amazon-linux-x11-instr.txt
Created April 3, 2014 05:25
Getting Amazon Linux working with X11
# These instructions assume you are using a Linux or Mac machine as
# the “local” machine and an Amazon Linux as the “remote” machine.
# Here’s one way to get X11 working between the two.
# on the local machine (Linux or Mac with X11 already installed)
$ ssh -X -i <amazon_key.pem> ec2-user@<remote_ec2_box_name>
# then on the remote Amazon Linux EC2 box
$ sudo yum install xauth
$ sudo yum install xterm