java -version
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm"
sudo rpm -i jdk-8u11-linux-x64.rpm
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { | |
console.log("Request received:\n", JSON.stringify(event)); | |
console.log("Context received:\n", JSON.stringify(context)); | |
var tableName = "OurBlogDemo"; | |
var datetime = new Date().getTime().toString(); |
java -version
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm"
sudo rpm -i jdk-8u11-linux-x64.rpm
#!/usr/bin/env python | |
# An exponential backoff around Boto3 DynamoDB, whose own backoff eventually | |
# fails on long multipage scans. We'd like to use this as a wrapper somehow, | |
# see: https://gist.github.com/numberoverzero/cec21b8ca715401c5662 | |
from time import sleep | |
import boto3 | |
from boto3.dynamodb.conditions import Attr |
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = user and range key = datetime | |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
exports.handler = function(event, context) { |
from __future__ import print_function # Python 2/3 compatibility | |
import boto3 | |
import json | |
import decimal | |
import time | |
# Helper class to convert a DynamoDB item to JSON. | |
class DecimalEncoder(json.JSONEncoder): | |
def default(self, o): | |
if isinstance(o, decimal.Decimal): |
import React from 'react' | |
const provideContext = (contextKey, contextType) => ( | |
React.createClass({ | |
childContextTypes: { | |
[contextKey]: contextType | |
}, | |
getChildContext() { | |
const { children, ...props } = this.props |
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*", | |
"Condition": { | |
"StringEquals": { | |
"ec2:Region": [ | |
"us-east-1", |
#!/usr/bin/env python | |
""" | |
Modification of `python -m SimpleHTTPServer` with a fallback to /index.html | |
on requests for non-existing files. | |
This is useful when serving a static single page application using the HTML5 | |
history API. | |
""" | |
This’ll make a flashable clone of an existing Intel Edison (with Yocto... Ubilinux here: https://gist.github.com/sxing/300b8a58c9f438fcc581). I've wanted to extract a flashable image from my Edisons for a while; I usually hack straight on my Edison until something works and don't want to porting to the Yocto build process afterwards. To clone Edisons, I've been using rubidium's commands from the Intel forums, but I wanted a method that worked on top of the Phone Flash Tool used for flashing Edison since it'll be easier to distribute images. I've tested this for flashing Edisons from ww36 (1.0), ww05-2015 (2.0), and ww25.5-2015 (2.1) firmwares to an ww25.5-2015 (2.1) based clone image.
NOTE: I've noticed that this doesn't work well with Edisons that are cloned copies that were produced through copying the entire mmcblk0 block as done in the Intel forum thread referenced above. I've built a workaround for that, but it is a bit longer: https://gist.github.c