Skip to content

Instantly share code, notes, and snippets.

View pindlebot's full-sized avatar

Ben Gardner pindlebot

View GitHub Profile
[Unit]
Description=Doc-to-pdf service
[Service]
ExecStart=/var/task/app/app.js
Restart=always
User=ec2-user
# Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
@pindlebot
pindlebot / upstart.conf
Created September 22, 2018 05:58
upstart
# testservice - test service job file
description "my service description"
author "Me <myself@i.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>Homework 3</title>
<link rel="stylesheet" href="./homework3.css" />
</head>
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
font-size: 14px;
}
div {
margin: 3em auto;
width: 660px;
}
@pindlebot
pindlebot / mac-mojave-screencapture.txt
Created October 7, 2018 21:22
Mojave screencapture arguments (/usr/bin/screencapture)
-c force screen capture to go to the clipboard
-b capture Touch Bar - non-interactive modes only
-C capture the cursor as well as the screen. only in non-interactive modes
-d display errors to the user graphically
-i capture screen interactively, by selection or window
control key - causes screen shot to go to clipboard
space key - toggle between mouse selection and
window selection modes
escape key - cancels interactive screen shot
-m only capture the main monitor, undefined if -i is set
require('dotenv').config()
const { launch } = require('chrome-launcher')
const { Chromeless } = require('chromeless')
const login = require('./src/login')
const { spawn } = require('child_process')
const path = require('path')
const crypto = require('crypto')
const AWS = require('aws-sdk')
const fs = require('fs')
cd /tmp
yum install libcurl-devel
git clone https://github.com/pramsey/pgsql-http.git
cd pgsql-http
make && make install
cd /tmp
git clone https://github.com/citusdata/pg_cron.git
cd pg_cron
make && make install
CREATE EXTENSION pg_cron;
select cron.schedule(
'* * * * *',
$$select * from http_post(
'http://requestbin.fullcontact.com/y7bgepy7',
'{ "foo": "bar" }',
'application/json'
)$$
);
require('http').createServer((req, res) => {
res.setHeader('content-type', 'text/html')
res.end('OK')
}).listen(process.env.PORT || 80)
#!/bin/bash -v
su ec2-user -c "curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash"
su ec2-user -c "source /home/ec2-user/.nvm/nvm.sh && nvm install node"
su ec2-user -c "source /home/ec2-user/.nvm/nvm.sh && nvm use node"
ln -s /home/ec2-user/.nvm/versions/node/v10.11.0/bin/node /usr/bin/node
ln -s /home/ec2-user/.nvm/versions/node/v10.11.0/bin/npm /usr/bin/npm