Skip to content

Instantly share code, notes, and snippets.

@alexellis
alexellis / install-k3sup.sh
Last active September 4, 2022 10:27
Multi-master / HA k3s for my Raspberry Pi cluster
#!/bin/bash
set -e
CH=latest
echo Installing Server 1
k3sup install --user pi --ip 192.168.2.147 \
--k3s-channel $CH \
--cluster \
@ashishtiwari1993
ashishtiwari1993 / service_up_exporter.md
Last active October 12, 2020 16:36
Prometheus exporter to fetch if any specific service running or stopped.

Service up exporter for prometheus

(by @_ashish_tiwari)


It performs ps -ef | grep service_name | wc -l command and gives response in 1 or 0.

Get Start

  1. Install prometheus client by pip install prometheus_client.

Deploying openfaas cloud on armhf

Prerequisites

  1. A domain name which can point to your deployment. (subdomain names also work)
  2. Setup Github app. Refer this. You'll need to transfer the downloaded private-key.pem file to arm device.
  3. Docker hub account.

Core components steps:

  1. Sign in to docker hub on your machine using:
@twaddington
twaddington / UserAgentInterceptor.java
Created October 12, 2017 02:17
Injects a User-Agent header into outgoing OkHttp requests.
package com.enlighthq.mobile.http;
import android.os.Build;
import java.io.IOException;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@linar-jether
linar-jether / simple_python_datasource.py
Last active May 24, 2023 01:22
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource ---- Up-to-date version maintained @ https://github.com/panodata/grafana-pandas-datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@andyshinn
andyshinn / Dockerfile
Last active August 8, 2023 08:39
Postal on Docker
FROM ruby:2.3-onbuild
VOLUME /opt/postal/config
ENV LOG_TO_STDOUT 1
ENV AM_CONFIG_ROOT /opt/postal/config
RUN gem install procodile
RUN apt-get update -qq && apt-get install -yqq nodejs
@marshallswain
marshallswain / authentication.js
Last active September 24, 2021 08:59
Example tools for using querystring redirects with Feathers OAuth login.
'use strict';
const authentication = require('feathers-authentication');
const jwt = require('feathers-authentication-jwt');
const local = require('feathers-authentication-local');
const oauth2 = require('feathers-authentication-oauth2');
const GithubStrategy = require('passport-github');
// Bring in the oauth-handler
const makeHandler = require('./oauth-handler');
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@clstokes
clstokes / assume-role-policy.json
Last active September 1, 2022 20:15
Example: Terraform IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""