Skip to content

Instantly share code, notes, and snippets.

View pendexgabo's full-sized avatar

Gabriel Sosa pendexgabo

View GitHub Profile
@SamuelChristie
SamuelChristie / tls_1_deprecation.md
Created November 2, 2015 16:08
Explanation of how to detect TLS 1.0 connections and, by way of custom headers, warn the user about the coming change to more modern TLS versions.
@a2ikm
a2ikm / lsyncd.conf.lua
Last active September 7, 2020 11:06
lsyncd + s3
s3sync = {
maxProcesses = 1,
onStartup = "aws s3 sync ^source ^target",
onCreate = "[ -f ^source^pathname ] && aws s3 cp ^source^pathname ^target^pathname || true",
onModify = "[ -f ^source^pathname ] && aws s3 cp ^source^pathname ^target^pathname || true",
onDelete = "[ -f ^source^pathname ] && aws s3 rm ^target^pathname || true",
onMove = "aws s3 mv ^target^o.pathname ^target^d.pathname",
}
sync {
@cryptix
cryptix / LICENSE
Last active March 10, 2024 09:55
example of using JWT for http authentication in go
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@SeanHayes
SeanHayes / fabfile.py
Last active September 27, 2020 20:10
Example Fabric fabfile.py. It's a hodgepodge of old scripts and probably isn't best practice (uWSGI ought to have an init script), but it should give you a practical idea of how to use Fabric. This fabfile relies heavily on custom settings from a Django project in order to be more DRY. Includes commands for setting up a fresh Ubuntu Server insta…
# -*- coding: utf-8 -*-
#Copyright (C) 2013 Seán Hayes
import my_project.settings as dj_settings
from fabric.api import local, run, sudo, env, prompt, settings, cd, parallel, execute
from fabric.contrib.files import exists
from fabric.decorators import hosts, roles, runs_once
import json
import logging
import os
@mattetti
mattetti / gist:3798173
Last active April 16, 2023 03:09
async fetching of urls using goroutines and channels
package main
import (
"fmt"
"net/http"
"time"
)
var urls = []string{
"https://splice.com/",
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#