Skip to content

Instantly share code, notes, and snippets.

@dphov
dphov / spacemacs-cheatsheet.txt
Created November 6, 2016 05:25 — forked from 526avijitgupta/spacemacs-cheatsheet.md
Spacemacs cheatsheet
`emacs --daemon` to run in the background.
`emacsclient.emacs24 <filename/dirname>` to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
* Undo - `C-/`
* Redo - `C-?`
* Change case: 1. Camel Case : `M-c`
2. Upper Case : `M-u`
3. Lower Case : `M-l`
@dphov
dphov / spacemacs-cheshe.md
Created November 6, 2016 05:26 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@dphov
dphov / gist.js
Created December 13, 2016 16:56 — forked from isaacs/gist.js
var args = process.argv.slice(2)
var path = require('path')
var fs = require('fs')
var private = false
var description = ''
var opener = require('opener')
var copy = process.platform === 'darwin'
var open = false
var help = false
var stdin = true
@dphov
dphov / deployUser.md
Created April 5, 2017 05:51 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@dphov
dphov / gist:dc6b7257d55732615f0e91c31f4d7f43
Created July 25, 2017 10:18 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@dphov
dphov / ffmpeg_ffprobe.sh
Created July 27, 2017 04:32 — forked from rbrooks/ffmpeg_ffprobe.sh
FFmpeg & FFprobe Cheatsheet
# Don't use FFmpeg for metadata extraction. Use FFprobe.
# Its output is geared toward parsabilty.
# Container and stream information in JSON format:
ffprobe -show_format -print_format json 'Serenity - HD Trailer.mp4'
ffprobe -show_streams -print_format json 'Serenity - HD Trailer.mp4'
# Human-readable values:
ffprobe -show_format -pretty -print_format json 'Serenity - HD Trailer.mp4'
# Trim video to first 30 seconds, without transcoding.
@dphov
dphov / dash-avc264 command lines
Created September 22, 2017 09:15 — forked from ddennedy/dash-avc264 command lines
Use ffmpeg and mp4box to prepare DASH-AVC/264 v1.0 VoD
See my DASH-IF presentation from October, 2014:
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/
1. encode multiple bitrates with keyframe alignment:
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012.
@dphov
dphov / tmux_build_from_source_CentOS.sh
Last active September 28, 2017 15:14 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@dphov
dphov / external.htm
Created October 11, 2017 08:55 — forked from bennadel/external.htm
Exploring Recursive Promises In JavaScript
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
Exploring Recursive Promises In JavaScript
</title>
</head>
<body>