Skip to content

Instantly share code, notes, and snippets.

@iadknet
iadknet / proxy.js
Created October 20, 2017 21:56
swagger-proxy
const express = require('express');
const bodyParser = require('body-parser');
const validator = require('swagger-express-validator');
const YAML = require('yamljs');
const expand = require('expand-swagger-refs').expand;
const rp = require('request-promise');
const argv = require('minimist')(process.argv.slice(2));
const HttpStatus = require('http-status-codes');
const swaggerPath = argv._[0];
@iadknet
iadknet / docker-entrypoint.sh
Created July 24, 2015 23:27
Sample docker entrypoint script to set file permission of mounted directory and execute command as user.
#!/bin/bash
chown -R $SOLR_USER:$SOLR_USER /data
su -c "$@" -m $SOLR_USER
@iadknet
iadknet / docker_clean.sh
Last active August 29, 2015 14:25
Script to clean up docker images and containers to free up space
#!/bin/bash
# Script to clean up unused containers and images
DANGLING_IMAGES=$(docker images -q --filter "dangling=true")
# Keeps the last 2 images/containers
IMAGE_IDS=$(docker images -q | tail -n +3)
CONTAINER_IDS=$(docker ps -a -q | tail -n +3)
if [ -n "$CONTAINER_IDS" ]; then