Skip to content

Instantly share code, notes, and snippets.

View dbuades's full-sized avatar

Daniel Buades Marcos dbuades

View GitHub Profile
@Jiab77
Jiab77 / setup-nut-and-netdata-on-ubuntu.md
Last active May 2, 2024 11:12
Setup nut and netdata on Ubuntu

Setup nut and netdata on Ubuntu

In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.

I'll only document USB connected UPS and not the other supported connection modes.

Install required dependencies

@datlife
datlife / mnist_tfdata.py
Last active May 24, 2023 02:03
Training Keras model with tf.data
"""An example of how to use tf.Dataset in Keras Model"""
import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after
_EPOCHS = 5
_NUM_CLASSES = 10
_BATCH_SIZE = 128
def training_pipeline():
# #############
# Load Dataset
@canthony
canthony / zfs-recursive-restore.sh
Created March 3, 2017 08:58
zfs snapshot allows us to take recursive snapshots of a file system (zfs snapshot -r root-pool-name@snapshot). zfs rollback does *not* allow you to restore recursively. This script does; as the comment says, ideas copied from elsewhere and then rewritten into something I could read and maintain a little better. Not a lot, but a little.
#!/usr/bin/env bash
# Originally by: Dr. Martin Menzel www.dr-menzel-it.de
# Modified by Matthew Pherigo https://gist.github.com/mwpher/4493681e9efdcc271830
# Rewritten by Charles Anthony
#
# Recursively restores the zfs filesystems below a given filesystem to a snapshot
# e.g. given
# the-pool
# the-pool/var
# the-pool/var/lib