Skip to content

Instantly share code, notes, and snippets.

View vunguyentuan's full-sized avatar

Vu Nguyen vunguyentuan

  • 2359 Media
  • Singapore
View GitHub Profile
@vunguyentuan
vunguyentuan / 00_nginx.config
Created April 20, 2018 08:16 — forked from devops-1/00_nginx.config
00_nginx.config
container_commands:
01-nginx:
command: /opt/elasticbeanstalk/hooks/configdeploy/enact/35_nginx.sh
files:
"/home/ec2-user/nginx.conf":
mode: "000644"
owner: root
group: root
content : |
@vunguyentuan
vunguyentuan / dabblet.css
Last active April 20, 2018 07:58 — forked from csssecrets/dabblet.css
Custom underlines
/**
* Custom underlines
*/
body {
font: 250%/1.6 Baskerville, Palatino, serif;
text-align: center;
}
a {
@vunguyentuan
vunguyentuan / 00_nginx_https_rw.config
Created May 22, 2017 11:38 — forked from BenMorganIO/00_nginx_https_rw.config
I can't believe this is what it takes to do SSL redirection on AWS EB...
files:
"/tmp/45_nginx_https_rw.sh":
owner: root
group: root
mode: "000644"
content: |
#! /bin/bash
CONFIGURED=`grep -c "return 301 https" /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf`
@vunguyentuan
vunguyentuan / debugging-node-elastic-beanstalk-woes
Created April 20, 2017 06:07 — forked from jmar777/debugging-node-elastic-beanstalk-woes
Debugging "Failed to run npm install. Snapshot logs for more details." on Elastic Beanstalk
First, we need to figure out what the actual error is. This is obviously frustrating given that the error message is intentionally truncating it.
1) SSH in to your node (various guides available for this if you're not already familiar with this).
2) Run this command (basically an Elastic Beanstalk wrapper command for npm install I found in a blog post [1]):
$ sudo /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install 2
3) Find the actual error message in the output from the npm install.
Once you know the error, it should hopefully be fairly obvious how to fix it. I've run into two different errors over the last couple days on Elastic Beanstalk:
The first was a dependency that was using the new "^X.Y.Z" version syntax, which is only supported in Node >= v0.10.26 (whereas Elastic Beanstalk only supports up to v0.10.21 as of today). The solution here was easy: hardcode a dependency version *prior* to when that dependency adopted to the new syntax.
@vunguyentuan
vunguyentuan / Appfile
Created December 21, 2016 04:31 — forked from mmazzarolo/Appfile
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, name, fileName) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
var link = document.createElement("A");