Skip to content

Instantly share code, notes, and snippets.

@tormath1
tormath1 / README.md
Last active August 5, 2023 07:48
Cluster API OpenStack using Flatcar
@ScriptingSquirrel
ScriptingSquirrel / export-node-stats.md
Last active April 4, 2023 02:18
Setup prometheus-node-exporter and push stats to Pushgateway with cron job

(Assuming a Debian 8-like system)

  • Install prometheus-node-exporter

    $ sudo apt update && sudo apt install prometheus-node-exporter
  • Configure prometheus-node-exporter to expose metrics only to localhost, not on to all networks. Modify file /etc/default/prometheus-node-exporter:

    # Set the command-line arguments to pass to the server.
@bendo01
bendo01 / Caddyfile
Last active November 18, 2017 01:35
Caddy Web Server As Service on Centos 7
#cd /etc/caddy/Caddyfile
example.com {
root /usr/share/nginx/html
gzip
log /var/log/caddy/access.log
#fastcgi / unix:/var/run/php-fpm/php-fpm.sock php # Fast CGI php interpreter
#fastcgi / fastcgi / 127.0.0.1:9000 php # Fast CGI php interpreter
#using with laravel
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php {
index index.php
@peko
peko / copy_files.sh
Last active January 31, 2024 15:41
Fastest rsync I ever know
#!/bin/bash
tar cf - * | mbuffer -m 1024M | ssh -i ~/.ssh/<key.pem> <destination_ip> '(cd /home/ubuntu/<destination_folder>; tar xf -)'
@totallyunknown
totallyunknown / ipmi_sensors_prometheus.py
Last active October 18, 2023 08:45
Prometheus Exporter for IPMI Sensor Status and Power usage
#!/usr/bin/env python
#
# Tested with SuperMicro
import re, subprocess, pprint, time, os, sys
if not os.path.exists("/usr/sbin/ipmi-sensors"):
print >> sys.stderr, 'freeipmi tools are not installed'
sys.exit()
@jawadatgithub
jawadatgithub / OIDC and OAuth2 Flows.md
Last active February 11, 2024 23:15
Enrich IdentityServer3 Documentation with OIDC (OpenID Connect) and OAuth2 Flows section
Note for community:

A. IdentityServer3 docs, samples and source code use OIDC & OAuth2 terms interchangeably to refer to same thing in many areas. I think that's make sense because OIDC introduced as complement & extension for OAuth2.

B. IdentityServer3, STS, OP, OIDC server, OAuth2 server, CSP, IDP and others: means same thing (software that provide/issue tokens to clients) as explained in [Terminology] (http://identityserver.github.io/Documentation/docs/overview/terminology.html).

C. Grants and flows mean same thing, grant was the common term in OAuth2 specs and flow is the common term in OIDC specs.

D. This document will not focus on custom flow/grant.

E. [Important] Choosing wrong flow leads to security threat.

@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@timsutton
timsutton / make_brew_omnibus_osx_pkg.sh
Last active August 29, 2015 14:10
Dead-simple Omnibus-style installer package builder for OS X using Homebrew.
#!/bin/sh -e
#
# make_brew_omnibus_osx_pkg.sh
# Tim Sutton, 2014
#
# Dead-simple Omnibus-style installer package builder for OS X using Homebrew. It
# takes no command-line options or arguments: all configuration is done using
# environment variables:
#
# - FORMULA: (required) name of Homebrew formula
@dysinger
dysinger / aws-cfn-coreos-kubernetes.json
Last active September 9, 2019 01:31
CoreOS Kubernetes on AWS CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings": {
"RegionMap": {
"ap-northeast-1": {
"AMI": "ami-f9b08ff8"
},
"ap-southeast-1": {
"AMI": "ami-c24f6c90"