Skip to content

Instantly share code, notes, and snippets.

View elgreg's full-sized avatar
💭
Inside

Greg Lavallee elgreg

💭
Inside
View GitHub Profile
/*
* Copyright 2020 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@radicand
radicand / docker-mailserver-k3s-deployment-example.yaml
Created April 30, 2020 23:31
docker-mailserver K3S deployment example
apiVersion: v1
kind: Namespace
metadata:
name: "mailserver"
---
apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: "mailserver-pvc"
namespace: "mailserver"
@achton
achton / fastlyMonthToDateBill.py
Last active January 18, 2023 20:53 — forked from themartorana/fastlyMonthToDateBill.py
Calculate your month-to-date bill from Fastly with the billing API
#!/usr/bin/env python3
# Requires Python 3
import requests
import locale
from typing import Dict, Tuple, List
from calendar import monthrange
from datetime import datetime
@Artistan
Artistan / a ngrok_background.sh
Last active February 23, 2024 22:02 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active November 18, 2024 06:01
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
@nmaggioni
nmaggioni / ufw_plex.md
Last active October 25, 2024 17:43 — forked from andrey-str/ufw plexmediaserver app profile.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
@Sirfrummel
Sirfrummel / Statistics.js
Last active January 9, 2020 23:43
Loading Segment.io analytics.js open source version async
// Create a dummy analytics object until real loaded
window.analytics || (window.analytics = []);
window.analytics.methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off'];
window.analytics.factory = function(method) {
return function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(method);
window.analytics.push(args);
return window.analytics;
};
@rjz
rjz / ngrok_hostname.sh
Created August 9, 2016 16:20
Get ngrok hostname from command line
#!/bin/sh
# ngrok's web interface is HTML, but configuration is bootstrapped as a JSON
# string. We can hack out the forwarded hostname by extracting the next
# `*.ngrok.io` string from the JSON
#
# Brittle as all get out--YMMV. If you're still reading, usage is:
#
# $ ./ngrok_hostname.sh <proto> <addr>
#
@ib-lundgren
ib-lundgren / refresh_example.py
Last active May 7, 2022 06:15
Work in progress example of how to do oauth 2 token refresh in a web application. Requires python modules oauthlib master - pip install -e git+https://github.com/idan/oauthlib#egg=oauthlib requests-oauthlib latest from pip (don't think master is needed) flask & requests
from json import dumps
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
from requests_oauthlib import OAuth2Session
app = Flask(__name__)
# Ignore this, only used as basic doc string template creator.
def docstring_templator(f):
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048