Skip to content

Instantly share code, notes, and snippets.

View iksnae's full-sized avatar

K Mills iksnae

View GitHub Profile
@iksnae
iksnae / check_docker_newer_tag.sh
Created July 26, 2018 04:21 — forked from byrnedo/check_docker_newer_tag.sh
Check if newer docker image available.
#!/bin/bash
# ensure running bash
if ! [ -n "$BASH_VERSION" ];then
echo "this is not bash, calling self with bash....";
SCRIPT=$(readlink -f "$0")
/bin/bash $SCRIPT
exit;
fi
@iksnae
iksnae / video-thumbnails-generator.sh
Last active May 30, 2018 15:10 — forked from shunchu/video-thumbnails-generator.sh
Batch generate thumbnails from mp4 files using ffmpg
#!/bin/bash
# setup
FILES=name_of_file_to_match_*.mp4
SEEK_POINT=00:00:15
IMG_FORMAT=png
FRAME_SIZE=512X288
DEST=thumbnails
for f in $FILES
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
FROM ubuntu:16.04
# run update
RUN apt-get update
# install python, pip, scipy, numpy, matplotlib system support
RUN apt-get install -y python python-pip python-numpy python-scipy python-matplotlib
# supress pip warnings by updating
RUN pip install --upgrade pip
$:dockerzon iksnae$ docker-compose up --build
Building dockerzon
Step 1/12 : FROM ruby:2.3-slim
---> 39bed6bce295
Step 2/12 : MAINTAINER Nick Janetakis <[email protected]>
---> Using cache
---> 7b913db1c007
Step 3/12 : RUN apt-get update && apt-get install -qq -y --no-install-recommends build-essential nodejs libpq-dev
---> Using cache
---> 1b3cd99aad94
@iksnae
iksnae / gist:75abbd09943dd894008d48e10ecc0c9d
Created February 18, 2018 19:20
scaling-docker-on-aws: docker-compose up error
me:dockerzon iksnae$ docker-compose up
Building dockerzon
Step 1/12 : FROM ruby:2.3-slim
---> 39bed6bce295
Step 2/12 : MAINTAINER Nick Janetakis <[email protected]>
---> Using cache
---> 7b913db1c007
Step 3/12 : RUN apt-get update && apt-get install -qq -y --no-install-recommends build-essential nodejs libpq-dev
---> Using cache
---> 1b3cd99aad94
@iksnae
iksnae / python-zip.md
Created February 16, 2018 14:12 — forked from asimjalis/python-zip.md
How to deploy a Python application as a zip file

How to deploy a Python application as a zip file

by Asim Jalis, MetaProse.com

Create a file __main__.py containing:

print "Hello world from Python"

Zip up the Python files (in this case just this one file) into app.zip by typing:

i
me
my
myself
we
our
ours
ourselves
you
your
@iksnae
iksnae / generate_df_lambda_package.sh
Created January 14, 2018 19:03 — forked from profjsb/generate_df_lambda_package.sh
Serverless Distributed Decision Forests with AWS Lambda
# build the environment ... this will take awhile
docker run -v $(pwd):/outputs -it amazonlinux:2016.09 /bin/bash /outputs/build.sh
# should end with something like "venv compressed size 51M"
# unpackage that environment
unzip venv.zip -d ve_package/
#!/usr/bin/env python
import nltk
packages = ['words', 'webtext','stopwords','punkt','averaged_perceptron_tagger','maxent_ne_chunker','wordnet']
nltk.download(packages)