Skip to content

Instantly share code, notes, and snippets.

View grahamoregan's full-sized avatar

Graham O'Regan grahamoregan

View GitHub Profile
description "backend"
start on stopped cloud-final
stop on runlevel [06]
respawn
# limit respawning to 30 times in 2 minutes
respawn limit 30 120
@grahamoregan
grahamoregan / gist:6b0e799089a993f535c5959f2e73f598
Last active July 22, 2016 10:22
simple ansible deploy script
- name: Sample deploy
hosts: backend
sudo: yes
remote_user: ubuntu
gather_facts: no
vars:
- build_dir: "/tmp/build"
- deploy_dir: "/opt/deploy"
@grahamoregan
grahamoregan / Javascript Paho MQTT
Created June 23, 2016 22:02
Quick example of reading/writing for Kyle
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.js" type="text/javascript"></script>
<script>
var server = '...';
var port = 8080;
var clientId = "unique-mqtt-client-id";
// Create a client instance
client = new Paho.MQTT.Client(server, Number(port), clientId);
ServletHolder holder = new ServletHolder(new HttpServlet() {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().print("pong");
resp.getWriter().close();
}
});
environment.getApplicationContext().getServletHandler().addServletWithMapping(holder, "/servlet/ping");
@grahamoregan
grahamoregan / package.json
Created March 23, 2016 13:57
package.json for Nuutti Kotivuori's AWS ES proxy
{
"name": "aws-es-proxy",
"version": "0.0.1",
"description": "AWS ES Proxy",
"author": "Nuutti Kotivuori",
"license": "ISC",
"dependencies": {
"aws-sdk": "~2.2.46",
"http-proxy": "~1.13.2",
"body-parser": "~1.15.0",
### Keybase proof
I hereby claim:
* I am grahamoregan on github.
* I am grahamoregan (https://keybase.io/grahamoregan) on keybase.
* I have a public key whose fingerprint is 0159 7707 5409 BA18 F81D 9489 2931 DB8D BD43 E0C5
To claim this, I am signing this object: