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
# AWS CloudFormation template file follows the following anatomy: | |
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html | |
# More documentation in the API reference: | |
# https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html | |
# As-of 2020, "2010-09-09" is the latest FormatVersion: | |
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html | |
AWSTemplateFormatVersion: 2010-09-09 | |
Description: S3 / Route53 / CloudFront CloudFormation configuration |
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
import { Knex } from 'knex' | |
export async function up(knex: Knex): Promise<any> { | |
await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => { | |
table.integer('foobar'); | |
}); | |
} | |
export async function down(knex: Knex): Promise<any> { | |
await knex.schema.dropTable('test_setup'); |
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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
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
'use strict'; | |
const sourceCoookie = 'X-Source'; | |
const sourceMain = 'main'; | |
const sourceExperiment = 'experiment'; | |
const cookiePath = '/'; | |
// Origin Response handler | |
exports.handler = (event, context, callback) => { | |
const request = event.Records[0].cf.request; |
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
// npm install --save-dev gulp babelify browserify babel-preset-es2015 gulp-connect vinyl-source-stream vinyl-buffer gulp-uglify gulp-sourcemaps | |
/* | |
folder structure: | |
build | |
src/js/index.js | |
static/index.html | |
package.json | |
gulpfile.js | |
*/ |
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
function base64url(source) { | |
// Encode in classical base64 | |
encodedSource = CryptoJS.enc.Base64.stringify(source); | |
// Remove padding equal characters | |
encodedSource = encodedSource.replace(/=+$/, ''); | |
// Replace characters according to base64url specifications | |
encodedSource = encodedSource.replace(/\+/g, '-'); | |
encodedSource = encodedSource.replace(/\//g, '_'); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>AWS IoT Pub/Sub Demo</title> | |
</head> | |
<body> | |
<h1>AWS IoT Pub/Sub Demo</h1> | |
<form> | |
<button type="button" id="connect">connect!</button> |
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
image: node:argon | |
before_script: | |
- apt-get -qq update | |
- apt-get -qq install -y python2.7 python2.7-dev build-essential make gcc g++ libicu-dev | |
- npm -g install npm --silent | |
- "echo -e \"export default {CLIENT_ID: '$CLIENT_ID'}\" > app/scripts/settings.js" | |
- npm set progress=false | |
- npm install --silent |
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
# curl - Raw upload | |
curl -X PUT -T image.png https://example.com/upload | |
# curl - Content-Type: multipart/form-data | |
curl -F name=logo -F file=@image.png https://example.org/upload | |
# curl - POST presigned URL (S3) |
NewerOlder