Skip to content

Instantly share code, notes, and snippets.

View SHohentanner's full-sized avatar

SHohentanner SHohentanner

View GitHub Profile
@petertwise
petertwise / subnetmasks.txt
Created October 18, 2017 01:57
Cheat Sheet for IP Address "wildcards" CIDR Notation - Subnet Mask
# These are the only common ones ever used...
# If you need a reference for anything inbetween these: https://tools.ietf.org/html/rfc4632#page-7
123.456.0.0/8 = 123.*.*.*
123.456.0.0/16 = 123.456.*.*
123.456.789.0/24 = 123.456.789.*
123.456.789.012/32 = 123.456.789.012
@kennyhyun
kennyhyun / index.js
Last active June 19, 2024 05:55
lamda thumbnail generator
// dependencies
var async = require('async');
var AWS = require('aws-sdk');
// Enable ImageMagick integration.
var gm = require('gm').subClass({ imageMagick: true });
var util = require('util');
var pdf2png = require('pdf2png');
pdf2png.ghostscriptPath = "/usr/bin";
// constants
@kageurufu
kageurufu / lambda.js
Last active November 25, 2021 12:44
AWS Lambda Thumbnailer
var async = require("async");
var AWS = require("aws-sdk");
var gm = require("gm").subClass({imageMagick: true});
var fs = require("fs");
var mktemp = require("mktemp");
var THUMB_KEY_PREFIX = "thumbnails/",
THUMB_WIDTH = 150,
THUMB_HEIGHT = 150,
ALLOWED_FILETYPES = ['png', 'jpg', 'jpeg', 'bmp', 'tiff', 'pdf', 'gif'];