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

# Aliases
# --------------------------------------------------------------------
alias mv='mv -iv'
alias ......='cd ../../../../..'
alias .....='cd ../../../..'
alias ....='cd ../../..'
alias ...='cd ../..'
alias ..='cd ..'
alias cd..='cd ..'
alias cd.='cd ..'
@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 / factorial.sc
Created September 1, 2017 18:48
factorial created by dphov - https://repl.it/Kctn/0
(define (fact-iter x counter n)
(if (> counter n)
x
(fact-iter (* x counter) (+ counter 1) n)))
(define (fact n)
(fact-iter 1 1 n)
)
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‚Äë‚óè‚Äë‚óè)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
@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.