Skip to content

Instantly share code, notes, and snippets.

View fabiojmendes's full-sized avatar

Fabio Mendes fabiojmendes

  • Toronto, Canada
View GitHub Profile
@asciipip
asciipip / README.md
Last active February 20, 2022 17:53
ZFS collectd plugin

Put zfs.py into a directory (e.g. /opt/collectd-plugins). Load with, e.g.:

LoadPlugin python
<Plugin "python">
  ModulePath "/opt/collectd-plugins"
  Import "zfs"
</Plugin>

Load zfs.json and zfs_arc.json into Grafana. They assume the data is saved in a Grafana dataset named collectd.

@rojenzaman
rojenzaman / update-cdn.sh
Created September 6, 2020 14:21
firewalld rules for cloudflare cdn IPs (Red Hat, CentOS, Fedora)
#!/bin/bash
curl https://www.cloudflare.com/ips-v4 > .ips-v4
curl https://www.cloudflare.com/ips-v6 > .ips-v6
firewall-cmd --new-zone=cloudflare --permanent
firewall-cmd --reload
for i in `<.ips-v4`; do firewall-cmd --zone=cloudflare --add-source=$i; done
for i in `<.ips-v6`; do firewall-cmd --zone=cloudflare --add-source=$i; done
@nuada
nuada / partslist.py
Last active July 21, 2022 21:33
Parts list script for Fusion 360 - components are aggregated by dimensions
import adsk.core
import adsk.fusion
import csv
import os
import os.path
# Inspired by: https://forums.autodesk.com/t5/fusion-360-design-validate/parts-list-with-dimensions/m-p/9642058/highlight/true#M223047
def run(context):
version: '3'
services:
traefik:
image: traefik:v2.0
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
@r0l1
r0l1 / README.md
Created February 8, 2018 21:44 — forked from Luzifer/README.md
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
@mosquito
mosquito / README.md
Last active July 18, 2024 19:07
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@yohhoy
yohhoy / cv2ff.cpp
Created February 17, 2016 15:41
Convert from OpenCV image and write movie with FFmpeg
/*
* Convert from OpenCV image and write movie with FFmpeg
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>