Skip to content

Instantly share code, notes, and snippets.

View cultureulterior's full-sized avatar
👽

Zagig Yragerne cultureulterior

👽
View GitHub Profile
@jefferai
jefferai / reload_haproxy.sh
Last active October 22, 2015 16:25
haproxy reloader
#!/bin/bash
haproxy_bin="/usr/sbin/haproxy"
haproxy_config="/etc/haproxy/haproxy.cfg"
haproxy_tmp_config=$(mktemp --tmpdir haproxy_config_XXXX)
haproxy_pidfile="/run/haproxy.pid"
haproxy_temp_pidfile="/run/haproxy-reloader-${BASHPID}.pid"
EXTRAOPTS=
@andreas
andreas / envelope_encryption.go
Created February 3, 2015 19:25
Envelope Encryption with Amazon KMS and Go
package main
import (
"bytes"
"crypto/rand"
"encoding/gob"
"fmt"
"io/ioutil"
"os"
"time"

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should

@alexpearce
alexpearce / ssotutorial.apacheconf
Last active October 21, 2021 02:31
Apache configuration file for a virtual host running Flask behind a uWSGI server, authentication with Shibboleth SSO
# Apache server configuration for ssotutorial.
# This sets up a Flask application over SSL with CERN SSO authentication via
# Shibboleth.
# Load the SSL and Shibboleth modules
LoadModule ssl_module modules/mod_ssl.so
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_22.so
# Disable TRACE HTTP requests on CERN advice
TraceEnable Off
@omgwtfgames
omgwtfgames / NoiseTexture.cs
Last active April 2, 2025 15:50 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise function based on the Simplectic honeycomb - C# port
/*
* OpenSimplex (Simplectic) Noise Test for Unity (C#)
* This file is in the Public Domain.
*
* This file is intended to test the functionality of OpenSimplexNoise.cs
* Attach this script to a GameObject with mesh (eg a Quad prefab).
* Texture is updated every frame to assist profiling for performance.
* Using a RenderTexture should perform better, however using a Texture2D
* as an example makes this compatible with the free version of Unity.
*
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active October 14, 2025 10:01
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@voxxit
voxxit / Dockerfile
Created September 12, 2014 12:46
Compiling from source on Busybox w/ Alpine Linux 3.0
FROM uggedal/alpine-3.0
# - update the source repositories
# - add the 'build-base' metapackage, which includes: binutils, gcc, make, patch, libc-dev, g++
# - do your stuff to wget, gunzip, tar xf, configure, make, make install, etc.
# - uninstall/purge the build-base package & dependencies
RUN apk update && apk add build-base && \
# ... && \
apk del build-base --purge
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob
@y0ast
y0ast / Tutorial.md
Last active November 23, 2015 03:11
Tutorial for using Torch7 on Amazon EC2 GPUs

There used to be a tutorial here for using Torch7 on EC2, but it's now outdated. It is best to use an EC2 image that already has Torch7 and CUDA stuff preinstalled.

@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""