Skip to content

Instantly share code, notes, and snippets.

View clodal's full-sized avatar

clodal clodal

  • Singapore
View GitHub Profile
@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

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 / 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 
@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 / 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 / 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 / my-new-mac-user-pref.md
Last active February 3, 2021 05:36
Setup new macos user

Install brew

Fix error when installing brew

sudo chown -R `whoami` /usr/local
cd /usr/local
git reset --hard origin/master

Install zsh

  1. Run curl to install
  2. Go to ~/.zshrc and ensure that the PATH export in the first line is not commented out
@clodal
clodal / aws_rds_pg_dump_steps.md
Last active September 12, 2019 05:35
Dumping and Restoring PG dump from AWS

How to get dump file from prod into local?

Method 1: pg_dump

  1. Retrieve database dump from production pg_dump --host=<HOST> --dbname=<DBNAME> --username=<USERNAME> > <FILE NAME>

Example: pg_dump --host=foo.2j3klh13kj1237.us-west-1.rds.amazonaws.com --dbname=mydb_dev --username=user &gt; prod_20190227

@clodal
clodal / git_config.md
Last active September 10, 2019 06:58
Manage git config and identity

Bash commands for managing git config

List global level git identity

git config --global -l

Set global level git identity

git config --global user.name ""
@clodal
clodal / deploy-private-npm-to-vercel.md
Last active April 26, 2020 15:22
Deploy Private NPM Module to Vercel