Skip to content

Instantly share code, notes, and snippets.

@lpla
lpla / MQTT-influxDB-telegraf-grafana-in-armv6-raspberry.md
Last active April 6, 2024 10:28
Install MQTT + influxDB + telegraf + grafana in Raspberry Pi 1 or Zero (armv6)

I tried to install this set of technologies for an small home project using BME280 in a Raspberry Pi Zero, but all guides I tried to follow are based on newer Raspberry Pi versions (armv7) (like this guide or this one), so the docker instructions don't work for some of these packages.

TL;DR: don't use any docker image, use only apt commands and repos from each project official documentation

Mosquitto (MQTT)

As official documentation details, simply use the already available package from Raspbian/Raspberry Pi OS archive repository:

@0x3333
0x3333 / output.md
Last active April 9, 2024 13:38
Show Memory and CPU usage of kvm vms
RAM
---
vm-1                      = 1,024 MiB
vm-2                      = 2,048 MiB

Total: 3,072 MiB

CPU(s)
------
@Aethylred
Aethylred / gist:0ea0d2899eca1da790aa078f9f2a885a
Last active October 31, 2023 20:52
freeipa-api-ansible-inventory
#!/usr/bin/env python
# This script uses the FreeIPA API to create an Ansible dynamic directory
# This is a shell script version of freeipa-api-inv.py
#
# DEPENDENCIES: before this script will work with AWX or Tower
# the python_freeipa module has to be installed
#
# Add this to your Docker image
# RUN pip install python_freeipa
#
#!/usr/bin/python
import sys, os
import urllib, urllib2
import base64
import json
import requests
import xml.etree.ElementTree as ET
def requests_xml(jss_user, jss_pass, jss_url, category):
#!/usr/local/bin/python3
"""
Custom inventory script for Ansible populated by the JSS
"""
from functools import lru_cache
from os.path import dirname, realpath, join
from urllib.parse import quote
import argparse
import json
@sheagcraig
sheagcraig / bring_the_payne.py
Created May 4, 2017 14:05
Get IP Address for all computers in the JSS
#!/usr/bin/env python
"""https://twitter.com/krispayne/status/859833552078225408:
@shea_craig is possible with python-jss to generate a list of IP addresses for
computers in the JSS?
"""
from operator import itemgetter
#!/usr/local/bin/python3
"""
Custom inventory script for Ansible populated by the JSS
"""
from os.path import dirname, realpath, join
from urllib.parse import quote
import argparse
import json
import configparser
@devynspencer
devynspencer / freeipa.py
Last active April 23, 2024 20:53
Use FreeIPA hostgroups as a dynamic inventory source for Ansible. Badass.
#!/usr/bin/env python
import argparse
import json
from ipalib import api
def initialize():
'''
This function initializes the FreeIPA/IPA API. This function requires
@devynspencer
devynspencer / freeipa.md
Created March 5, 2016 06:41
FreeIPA api notes
[devyn@ipa ~]$ ipa help commands
automember-add                         Add an automember rule.
automember-add-condition               Add conditions to an automember rule.
automember-default-group-remove        Remove default (fallback) group for all unmatched entries.
automember-default-group-set           Set default (fallback) group for all unmatched entries.
automember-default-group-show          Display information about the default (fallback) automember groups.
automember-del                         Delete an automember rule.
automember-find                        Search for automember rules.
automember-mod                         Modify an automember rule.
#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root