Skip to content

Instantly share code, notes, and snippets.

View clodal's full-sized avatar

clodal clodal

  • Singapore
View GitHub Profile
@clodal
clodal / zeit-now-g-suite-setup.md
Last active February 26, 2019 11:08 — forked from jaydenseric/zeit-now-g-suite-setup.md
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere // optional if domain already in GSuite
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ TXT "v=spf1 include:_spf.google.com ~all"
@clodal
clodal / defaults.md
Last active December 15, 2018 09:05
My default MacOS keyboard settings
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 9
@clodal
clodal / mongo-dump.md
Created November 12, 2018 07:48
How to backup external mongodb to local mongodb

Backup external mongodb mongodump -h <SHARD_0>,<SHARD_1>,<SHARD_2> --ssl -u <DB_USER> -p <DB_PASSWORD>

Restore to local mongorestore -d --drop

@clodal
clodal / zeit-now-aws-ses.md
Last active April 17, 2020 09:30
Describes how to verify a Zeit Now domain with AWS SES for email sending

How to setup AWS SES with Zeit Now

  1. Domain Verification Record
now dns add <NAKED_DOMAIN> _amazonses TXT <VALUE>
  1. DKIM Record Set
now dns add  ._domainkey CNAME 

Speed up MacOS Screen Recordings with FFMPEG

Pre-requisites:

  1. MacOS

Instructions

  1. Install ffmpg: brew install ffmpeg. If it fails, go to step 4.
  2. Use ffmpeg to speed up .mov file: ffmpeg -i input.mov -vf "setpts=(PTS-STARTPTS)/30" -crf 18 output.mov
  3. Done!
@clodal
clodal / nowsh-cli-logs.md
Created August 28, 2018 04:04
Logging in now.sh

Logging with now cli

Find logs in a certain period (e.g.from 2am to 2.05am). Remember that times are in UTC. now logs --since 2018-08-28T02:00:00.000Z --until 2018-08-28T02:05:00.000Z

➜ prod git:(master) ✗ now logs https://prod-lmnssdtqy.now.sh/ -n 100000 2018-08-19T07:20:11.692Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ead64528708004d570fd4") }, { fields: {} }) 2018-08-19T07:20:11.721Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5eb95f528708004d571036") }, { fields: {} }) 2018-08-19T07:20:11.748Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ed47a528708004d571078") }, { fields: {} }) 2018-08-19T07:20:11.776Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ed56f528708004d571079") }, { fields: {} }) 2018-08-19T07:20:11.803Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ee267528708004d5710b0") }, { fields: {} }) 2018-08-19T07:20:11.831Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ee86e528708004d5710ba") }, { fields: {} }) 2018-08-19T07:20:11.858Z Mongoose: answers.find({ state: 'approved', question: ObjectId("5b5ef2c1528708004d5710c7") }, { fields: {} })

@clodal
clodal / sequelize-max-connections-debug-notes.md
Created August 15, 2018 15:09
Debug notes on sequelize max-connections issue

Debug Notes for Sequelize + PG max connections issue

The following are commands useful for debugging pool connections in a sequelize + pg setup:


Connect to local psql shell psql -d <DB_NAME>

Connect to remote psql shell psql --host= --port=5432 --username= --dbname=

@clodal
clodal / styled-components-ssr.md
Created August 3, 2018 06:13
Debug notes on: Getting styled-components to play nice with downstream isomorphic project when importing from an npm library
@clodal
clodal / aws-rds.md
Last active August 1, 2018 04:17
AWS RDS Tips

How to drop RDS database?

  1. Connect to remote psql shell psql --host=<DB_HOST> --port=5432 --username=<DB_USER> --dbname=postgres
  2. Enter db password if prompted
  3. DROP DATABASE <DB_NAME>;
  4. CREATE DATABASE <DB_NAME>;

Note: This assumes AWS VPC does not block the connection. Check to ensure that you have access through this port.