Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / gist:0dad4d4f0b72750c6e6b
Created December 27, 2015 17:28
ssh keyless login
# on local machine you want to be able to remotely login to server "b"
cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
@dantheman213
dantheman213 / rpi_adhoc_networking.sh
Created January 10, 2016 22:10
Raspberry Pi Start ad-hoc mode on Start up
1. sudo apt-get update
2. sudo apt-get install isc-dhcp-server
3. sudo nano /etc/default/isc-dhcp-server
> UPDATE LINE
INTERFACES="wlan0"
4. sudo nano /etc/dhcp/dhcpd.conf
@dantheman213
dantheman213 / mongodb_backup.sh
Created January 16, 2016 18:47
backup mongo databases (can be used with a daily crontab)
#!/bin/bash
#
# Creates backup files (bson) of all MongoDb databases on a given server.
# Default behaviour dumps the mongo database and tars the output into a file
# named after the current date. ex: 2011-12-19.tar.gz
#
### Set server settings
HOST="localhost"
PORT="27017" # default mongoDb port is 27017
Setup Wifi Infrastructure Network on RPi 2
1.
apt-get update
apt-get upgrade
2.
apt-get install hostapd udhcpd
@dantheman213
dantheman213 / prune_files.js
Created January 22, 2016 00:50
This script will allow you to prune large collections of files by removing duplicates, fixing filename syntax, and organize better
#!/usr/bin/env node
// required packages
// npm install walk
// libraries
var walk = require('walk');
// globals
var args = process.argv.splice(2);
@dantheman213
dantheman213 / gist:6213ca5b2df4f70205ec
Created March 26, 2016 18:54
vagrant reverse proxy port for node js debug
vagrant ssh -- -L 5858:127.0.0.1:5858
@dantheman213
dantheman213 / mediamove.js
Last active April 26, 2016 01:49
Move media files in a downloads directory using a "grep-like" selector that will copy all target files to the desired media location. This script was designed to easily move many files using a single grep selector quickly to another folder via the command-line.
#!/usr/bin/nodejs
// Easily copy and sync media from downloads area to target location
//
// Daniel Gillespie
// 2016
//
// Install required packages where you're placing script
// npm install --save prompt-sync chalk exec-sync rsync
//
@dantheman213
dantheman213 / Three Wise Monkeys.md
Created January 20, 2017 21:50 — forked from malarkey/Three Wise Monkeys.md
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@dantheman213
dantheman213 / your_nodejs_app.conf
Last active February 4, 2017 00:19
NodeJS 'Upstart' Start-up script. Works on Ubuntu 14.04.
#!upstart
# NodeJS 'Upstart' Start-up script.
# Works on Ubuntu 14.04. Systemd is being used for Ubuntu 16.04 though.
description "your node js web app"
start on started mountall
stop on shutdown
@dantheman213
dantheman213 / encoder.sh
Created February 23, 2017 00:42
Convert all of your video files to x264 for massive space savings
fmpeg -i $file -c:v libx265 -x265-params lossless -c:a copy -c:s copy output.mkv