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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xbD08E418EB33ecC56b2234d860397f77143cD2F3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
} |
Setting project:
gcloud config set project tidy-bindery-110323
Creating a cluster:
gcloud container clusters create web --num-nodes=1 --machine-type=g1-small --zone=us-east1-b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install base OS | |
FROM ubuntu:14.04 | |
# Author | |
MAINTAINER Steven Lu <tacticalazn@gmail.com> | |
# Installing base packages that we need | |
# to run node with along with our code | |
RUN apt-get update && apt-get install -y --force-yes --no-install-recommends \ | |
build-essential \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Mappings": { | |
"RegionMap": { | |
"eu-central-1": { | |
"AMI": "ami-840a0899" | |
}, | |
"ap-northeast-1": { | |
"AMI": "ami-6c5ac56c" | |
}, | |
"us-gov-west-1": { |
Lets take an example where we have to load a dyanmic set of files. Normally we would have to iterate through the array, grab one file, then the next, etc. PHP is a good example of this and it'd take it a really long time to access each file since the computer's disk is slower than the CPU. This is what we call I/O wait.
$files = array("file1.txt", "file2.txt")
for ($i = 0; $i < count($files); $i++) {
$fh = fopen($myFile, 'r');
NewerOlder