Skip to content

Instantly share code, notes, and snippets.

View ncherro's full-sized avatar
🎯
Focusing

Nick Herro ncherro

🎯
Focusing
View GitHub Profile
@ncherro
ncherro / docker-pull-all.sh
Created June 4, 2018 16:53
Pull fresh docker images
#!/bin/bash
# pull fresh docker images
# docker images with registry.namely.land and production|master|latest
images=$(docker images | grep 'registry.namely.land' | grep 'production\|master\|latest' | awk '{print $1":"$2}')
# loop through images and pull each one
for image in $images
do
@ncherro
ncherro / movedigiphotos.bash
Created December 6, 2017 03:11 — forked from jvhaarst/movedigiphotos.bash
Bash script to move images, based on exif data and file timestamp
#!/bin/bash
# Reads EXIF creation date from all .JPG files in the
# current directory and moves them carefully under
#
# $BASEDIR/YYYY/YYYY-MM/YYYY-MM-DD/
#
# ...where 'carefully' means that it does not overwrite
# differing files if they already exist and will not delete
# the original file if copying fails for some reason.
version: '2'
services:
db:
image: postgres:latest
cache:
image: memcached:latest
elasticsearch:
image: elasticsearch:latest
@ncherro
ncherro / Dockerfile
Created May 5, 2016 16:45
Dockerfile
FROM ruby:2.2
RUN apt-get update && apt-get install -y \
build-essential \
nodejs \
libpq-dev \
libxml2-dev \
libxslt1-dev \
libqt4-webkit \
libqt4-dev \
@ncherro
ncherro / caption.sh
Last active April 8, 2016 20:06
Add captions with FFmpeg
#!/usr/bin/env bash
FONTPATH="$HOME/PiqueWebSmallCaps.woff"
OUTPUT="$2"
SECOND="This is the
second caption"
ffmpeg -i "$1" \
-vf "[in] \
drawtext=enable='between(t,2,8)': \
@ncherro
ncherro / base_uploader.rb
Created November 23, 2014 01:58
CarrierWave base class - appends digest hash to the original filename
class BaseUploader < CarrierWave::Uploader::Base
include ::CarrierWave::MimeTypes
storage Rails.env.development? ? :file : :fog
process :set_content_type
# append digests to the original filename so we can validate file uniqueness
def md5
@md5 ||= Digest::MD5.hexdigest(model.send(mounted_as).read.to_s)
@ncherro
ncherro / gist:0c185b77348908dd02d1
Created October 2, 2014 03:07
S3 bucket policy for asset sync
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListAllMyBuckets"],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
@ncherro
ncherro / API.swift
Last active August 29, 2015 14:06 — forked from higepon/API.swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
#!/usr/bin/env ruby
require 'fileutils'
# setup
root_dir = ARGV[0] || "#{ENV['HOME']}/Desktop/coffee-to-browserify"
src_dir = ARGV[1] || "src"
dst_dir = ARGV[2] || "dst"
src = "#{root_dir}/#{src_dir}"
dst = "#{root_dir}/#{dst_dir}"
@ncherro
ncherro / gist:3b5567c19024306572bb
Last active May 9, 2023 16:03
Install rsync on an Asus RT-AC56U

Install rsync on an Asus RT-AC56U

  1. install asuswrt-merlin firmware
  2. enable ssh by visiting Administration > System and setting Enable SSH to 'Yes'
  3. install optware, following these instructions
  4. ssh into your router and run ipkg install rsync