Skip to content

Instantly share code, notes, and snippets.

@kurdin
kurdin / html5video.sh
Last active August 29, 2015 14:27 — forked from liamcurry/html5video.sh
automated conversion of a file to all three html5 compatible video formats - h.264, ogg, and webm
#!/bin/sh
# Output file for HTML5 video
# requirements: ffmpeg .6+
# usage: ./html5video.sh infile.mp4 640x360
target_directory='converted'
file=`basename $1`
filename=${file%.*}
filepath=`dirname $1`
@kurdin
kurdin / db_backup.sh
Last active August 29, 2015 14:19 — forked from droot/db_backup.sh
#!/bin/sh
MONGODB_SHELL='/opt/mongodb/bin/mongo'
DUMP_UTILITY='/opt/mongodb/bin/mongodump'
DB_NAME='my_db'
date_now=`date +%Y_%m_%d_%H_%M_%S`
dir_name='db_backup_'${date_now}
file_name='db_backup_'${date_now}'.bz2'
// http://docs.mongodb.org/manual/tutorial/back-up-and-restore-with-mongodb-tools/
// Backup
$ mongodump -u {username} -p {password} --db {db} --out {output}
// Restore
$ env LC_ALL=en_US.UTF-8 mongorestore --port {port number} --dbpath {db path} {path to the backup}

###mongodb quick CLI reference

db backup and restore

from any directory on host machine, export entire db

$ mongodump -db myDatabaseName

now copy the /dump folder to destination machine. from the destination machine:

@kurdin
kurdin / gulpfile.js
Last active August 29, 2015 14:14 — forked from Leechael/gulpfile.js
var path = require("path");
var gulp = require("gulp");
var less = require("gulp-less");
var notify = require("gulp-notify");
var rename = require("gulp-rename");
var minifyCSS = require("gulp-minify-css");
var uglify = require("gulp-uglifyjs");
var livereload = require("gulp-livereload");
var source = require("vinyl-source-stream");
@kurdin
kurdin / 0_reuse_code.js
Created August 26, 2014 02:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console