Skip to content

Instantly share code, notes, and snippets.

View zofy29's full-sized avatar

Thanh Nguyen zofy29

View GitHub Profile
@zofy29
zofy29 / rbenv-install-system-wide.sh
Created December 23, 2020 13:57 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p448 on Ubuntu 12.04 LTS
#
# Run as root
# $ bash <(curl -s https://raw.github.com/gist/1631411)
#
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
libssl-dev \
@zofy29
zofy29 / serverless.yml
Last active November 13, 2020 09:47
[Serverless - AWS Lambda] Error running Sharp: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform
custom:
webpack:
includeModules: true
packagerOptions:
scripts:
- rm -rf node_modules/sharp
- npm install --arch=x64 --platform=linux sharp
@zofy29
zofy29 / post-confirmation.js
Last active October 28, 2020 08:18
[AWS Cognito] How to make email of federated users editable.
'use strict';
const aws = require('aws-sdk');
const AWS_COGNITO_REGION = 'your region'
async function autoConfirmEmail(event) {
let userAttributes = event.request.userAttributes;
if(userAttributes['cognito:user_status'] != 'EXTERNAL_PROVIDER') return;
if(userAttributes['email_verified'] == 'true') return;
@zofy29
zofy29 / k8s_pulls_private_image.txt
Last active April 9, 2018 15:41
Kubernetes pulls a private DockerHub image
# Run commands
kubectl create secret docker-registry registry_name \
--docker-server=https://index.docker.io/v2/ \
--docker-username=XXX \
--docker-password=XXX \
--docker-email=XXX
# Deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment