Skip to content

Instantly share code, notes, and snippets.

haproxy.conf
============
frontend spdy
mode tcp
bind xxx.xxx.xxx.xxx:443 ssl crt /etc/haproxy/ssl.pem crt /etc/haproxy/certs.d npn spdy/3.1,http/1.1 ciphers AES256+EECDH:AES256+EDH:AES128+EDH:EECDH:!aNULL:!eNULL:!LOW:!DES:!3DES:!RC4; no-sslv3
option tcplog
log global
# route to nginx
@erans
erans / mongobackup.sh
Last active October 7, 2019 16:59
MongoDB ReplicaSet Backup Script on Google Compute Engine and Google Cloud Storage
# Path to boto config file, needed by gsutils
BOTO_CONFIG="/etc/boto.cfg"
# Path in which to create the backup (will get cleaned later)
BACKUP_PATH="/mnt/data/dump/"
# DB name
DB_NAME="mydatabase"
# Google Cloud Storage Bucket Name
@gwaldron
gwaldron / gist:a56b0e77e7fa8587b698717d21f9366d
Last active February 15, 2020 13:45
Building OSG and osgEarth in GL CORE profile
Here are the steps for building OSG in the OpenGL CORE Profile
once you have configured CMake as usual.
1. Download the GL CORE include folder from Khronos:
https://www.khronos.org/registry/OpenGL/api/GL/
2. Put it in a folder somewhere. You can put it in a folder called glcore, or
you can make a "GL" folder in the include folder of the OSG repository and
put it there.
@dcode
dcode / Dockerfile
Created June 2, 2020 16:00
Fedora CoreOS CT snippet and dockerfile to run open-vm-tools in a container for VMware guests
FROM fedora:31
LABEL summary="The open-vm-tools guest agent" \
io.k8s.description="The open-vm-tools agent is providing information about the virtual machine and allows to restart / shutdown the machine via VMware products. This image is intended to be used with virtual machines running Centos Atomic Host." \
io.k8s.display-name="open-vm-tools guest agent" \
architecture="x86_64" \
BZComponent="open-vm-tools" \
maintainer="davis phillips <dphillip@redhat.com>"
ENV SYSTEMD_IGNORE_CHROOT=1
@palmerj
palmerj / create_rgb_bigtiff_cog.sh
Last active April 6, 2022 20:42
Create RGBA COG with GDAL > 2.3
#!/bin/bash
set -Eeuo pipefail
BLOCKSIZE=256
OVERVIEW_BLOCKSIZE=256
MIN_OVERVIEW_SIZE=256
KEEP_TEMP=0
MOSAIC_VRT="mosaic.vrt"
MOSAIC_RGB_VRT="mosaicrgb.vrt"
@ib-lundgren
ib-lundgren / gmail.py
Created September 25, 2013 13:25
How to fetch emails from GMail using an OAuth 2 Bearer token and GMails SASL XOAuth2 mechanism.
"""Fetching the latest GMail email using OAuth 2 and IMAP.
Requires requests-oauthlib, which is available on pypi.
Includes a basic SASL XOAUTH2 authentication method for imaplib.
"""
# Credentials you get from registering a new web application in Google API Console
client_id = 'your-id.apps.googleusercontent.com'
client_secret = 'your secret'
redirect_uri = 'your callback uri'
@brianneisler
brianneisler / cheat-sheet.js
Last active November 27, 2022 08:23
Cheat sheet - es6 import/export mixed with require/modules.exports
require('./module.js') // { a: 1 }
import module from './module.js' // undefined
import { a } from './module.js' // 1
require('./module2.js') // { default: { a: 1 }, b: 2 }
import module2 from './module2.js' // { a: 1}
import { b } from './module2.js' // 2
require('./module3.js') // { default: { a: 1 }, b: 2 }
#!/bin/bash
BASE_DIR=${TMPDIR:-/var/tmp}
ORIG_DIR=$PWD
HASH_CMD="md5sum"
DIR_NAME=`echo $PWD | $HASH_CMD | cut -f1 -d " "`
TMP_DIR=$BASE_DIR/$DIR_NAME
mkdir -p $TMP_DIR
@anapsix
anapsix / k8s-vault
Last active June 29, 2023 10:33
K8s-Vault, like AWS-Vault, but for cli tools using KUBECONFIG (~/.kube/config), such as helm, kubectl, etc..
#!/usr/bin/env bash
#
# K8s-Vault, like AWS-Vault is a helper for AWS related CLI tools
# is a helper for CLI tools using kubectl config and K8s API.
# Unlike AWS-Vault, vault here is used as a verb,
# synonymous to leap, jump, spring, etc..
# Copyright (C) 2019-2020 Anastas Dancha (aka @anapsix)
# 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
@pixelomer
pixelomer / mkjail.sh
Last active October 13, 2023 15:39
Create a macOS chroot jail with GNU bash and utilities
#!/usr/bin/env sh
#############################################
# WARNING #
# No more commits are going to be made to #
# this gist. Please get the latest script #
# from the new repository: #
# https://github.com/pixelomer/macos-mkjail #
#############################################