Skip to content

Instantly share code, notes, and snippets.

@hoswey
hoswey / alert.sh
Last active March 12, 2020 16:30 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d '[{
"status": "firing",
@ktmud
ktmud / README.md
Last active October 6, 2024 13:44
Enable Okta Login for Superset

This Gist demonstrates how to enable Okta/OpenID Connect login for Superset (and with slight modifications, other Flask-Appbuilder apps).

All you need to do is to update superset_config.py as following and make sure your Cliend ID (OKTA_KEY) and Secret (OKTA_SECRET) are put into the env.

@fizz
fizz / docker_aliases.sh
Last active April 21, 2019 05:41
Docker aliases
function dumpenv { docker inspect -f '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' $1; }
function dumpenv2 { docker inspect -f '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' $1 > $1.env; }
function ct2sh { docker inspect -f "$(<./run.tpl)" $1 > $1.sh; }
function labels { docker inspect -f '{{range $l, $v := .Config.Labels}} {{printf "%q" $l}}={{printf "%q\n" $v}} {{end}}' $1;}
@lizthegrey
lizthegrey / attributes.rb
Last active July 17, 2025 01:43
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@ibraheem4
ibraheem4 / postgres-brew.md
Last active July 11, 2025 10:31 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@romainl
romainl / redir.md
Last active January 2, 2025 00:36
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

@mgoellnitz
mgoellnitz / bucketsnip.sh
Last active June 8, 2025 23:15
Bitbucket Snippet Command Line Tool
#!/bin/sh
#
# Copyright 2017-2025 Martin Goellnitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@Breta01
Breta01 / Multiple TF Graph Class.py
Last active July 20, 2020 09:19
Class for importing multiple TensorFlow graphs.
import tensorflow as tf
class ImportGraph():
""" Importing and running isolated TF graph """
def __init__(self, loc):
# Create local graph and use it in the session
self.graph = tf.Graph()
self.sess = tf.Session(graph=self.graph)
with self.graph.as_default():
# Import saved model from location 'loc' into local graph
@michaelconnor00
michaelconnor00 / put_archive.py
Last active July 14, 2024 22:05 — forked from zbyte64/sample.py
Docker Python put_archive example
import tarfile
import time
import json
from io import BytesIO
import docker
src_code = """
if __name__ == "__main__":
print('Hello World, From Alpine!!!!!!!!!')
"""