Skip to content

Instantly share code, notes, and snippets.

@sjlu
sjlu / notes.md
Created October 19, 2015 16:52
CircleCI with automated Docker builds

CircleCI Docker Integration

Grab a service account API credential as a JSON file

cat .json | base64 | pbcopy

Add the following environment variables

GCE_URL
return request({
method: 'POST',
url: 'https://api.fastly.com/service/' + main.SERVICE_ID + '/version/' + this.number + '/vcl',
headers: {
'Fastly-Key': main.API_KEY
},
form: {
name: 'gulp-fastly-uploaded-vcl',
file: encodeURIComponent(String(file.contents))
}
0xbD08E418EB33ecC56b2234d860397f77143cD2F3
@sjlu
sjlu / metabase
Created March 15, 2018 21:15
metabase init.d
#!/bin/sh
# /etc/init.d/metabase
### BEGIN INIT INFO
# Provides: Metabase
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Metabase analytics and intelligence platform
### END INIT INFO
@sjlu
sjlu / Contentful.js
Last active June 3, 2019 19:44
This helps compile Jekyll posts from Contentful
var Promise = require('bluebird')
var _ = require('lodash')
var fs = require('fs')
var contentful = require('contentful')
var client = contentful.createClient({
space: '0eybfmw2qkbf',
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
host: process.env.CONTENTFUL_HOST
})
@sjlu
sjlu / Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js.md
Last active September 12, 2023 08:56
Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js

This file is a log of everything I've encountered when trying to migrate a Node.js, Elastic Beanstalk application from the Amazon Linux platform to the Amazon Liunx 2 platform. Here's why you should migrate:

  1. LTS support up to 2023 source
  2. The Amazon Linux AMI's end-of-life is December, 2020 source
  3. Amazon Linux 2 has some big package upgrades (GCC, Glibc, etc.)
  4. Elastic Beanstalk also has some upgrades on top of Amazon Linux 2 (e.g. faster deploys)

Challenges

Disabling NPM install