Skip to content

Instantly share code, notes, and snippets.

@anic1618
anic1618 / dnsmasq.conf
Created October 18, 2020 06:35 — forked from ruanbekker/dnsmasq.conf
Tinkering with Loki, Promtail, Grafana, Prometheus, Nginx and Dnsmasq
log-queries
log-facility=/var/log/dnsmasq.log
no-resolv
server=8.8.4.4
server=8.8.8.8
address=/router/10.1.1.1
address=/server/10.1.1.2
@anic1618
anic1618 / numpy-image-bgr-to-rgb.md
Created August 24, 2020 09:45 — forked from walkoncross/numpy-image-bgr-to-rgb.md
Numpy / OpenCV image BGR to RGB

(from https://www.scivision.co/numpy-image-bgr-to-rgb/)

Numpy / OpenCV image BGR to RGB

Conversion between any/all of BGR, RGB, and GBR may be necessary when working with Matplotlib expects M x N x 3 image, where last dimension is RGB.

OpenCV expects M x N x 3 image, where last dimension is BGR.

Scientific Cameras, some of which output an M X N x 3 image, where last dimension is GBR

@anic1618
anic1618 / tensorboard_logging.py
Created June 15, 2020 19:56 — forked from gyglim/tensorboard_logging.py
Logging to tensorboard without tensorflow operations. Uses manually generated summaries instead of summary ops
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: BSD License 2.0
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
@anic1618
anic1618 / async_plotting.py
Created May 16, 2020 20:23 — forked from astrofrog/async_plotting.py
Asynchronous Plotting in Matplotlib: rather than call savefig directly, add plots to an asynchronous queue to avoid holding up the main program. Makes use of multiple processes to speed up the writing out. Suggestions welcome!
import time
import multiprocessing as mp
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt