Skip to content

Instantly share code, notes, and snippets.

View wuct's full-sized avatar

CT Wu wuct

View GitHub Profile
@wuct
wuct / ec2MongoUpgrade.md
Created June 13, 2017 15:42 — forked from mattjay/ec2MongoUpgrade
Increase the disk space on a MongoDB EC2 Instance in Amazon Web Services
  1. Create a Snapshot of the current EC2 instance running Mongo. First, note down the Volume ID from your Instance list since for whatever reason you can't see any instance info in the Snapshot page. Second, go to the Snapshot page and click [Create Snapshot]. Choose the Volume ID you just noted down and name the Snapshot and create it.

  2. Create a new Volume with the backup Snapshot. In your instance list note the Availability Zone of the instance you are trying to upgrade. Go to the Volumes page and click [Create Volume]. Pick Standard and enter how many GB you'd like to create. This should be larger than the Volume you just created the Snapshot from. Then from the drop down choose the Snapshot you just created and click create. Also choose the Availability Zone that the instance you are upgrading is in as they must be the same.

  3. Find the instance you'd like to upgarde in the Instances list and note the name of the disk which will be next to "Block devices" (most likely /dev/sda1).

  4. Stop the Instance

@wuct
wuct / orderFood.js
Created March 10, 2016 06:49 — forked from lulalachen/orderFood.js
Redux Action Inprovemnet
import { genAuthHeaderFromState, genTokenFromState } from '../api';
import { default as apiStack } from '../api/apiStack';
import { createFetch, auth, body, method } from 'http-client';
// redux-api-middleware
export const orderList = () => ({
[CALL_API]: ({
endpoint: 'http://food.com/order/list/',
method: 'GET',
headers: genAuthHeadersFromState,