Skip to content

Instantly share code, notes, and snippets.

View edisonthk's full-sized avatar

Heng LikWee (ヘン リーウィー) edisonthk

View GitHub Profile
@popstas
popstas / docker-logs-localtime
Last active August 2, 2023 09:04
docker-logs-localtime - Replace all UTC dates in docker logs output to local dates in pipe
#!/usr/bin/env node
// replace all UTC dates to local dates in pipe
// usage: docker logs -t container_name | docker-logs-localtime
// install:
// curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime
// alternative: https://github.com/HuangYingNing/docker-logs-localtime
const pad = d => (d > 9 ? d : '0' + d);
@styblope
styblope / docker-api-port.md
Last active May 7, 2024 09:52
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@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'];