Skip to content

Instantly share code, notes, and snippets.

View lusis's full-sized avatar

John E. Vincent lusis

View GitHub Profile
@hamishforbes
hamishforbes / nginx.conf
Created May 1, 2014 18:19
Single background thread
error_log logs/error.log debug;
events {
worker_connections 1024;
}
worker_processes 4;
http {
default_type application/octet-stream;
@jtopper
jtopper / gist:8588263
Last active December 29, 2024 17:29
Add a new disk to a VMWare vagrant box
config.vm.provider :vmware_fusion do |vm|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
dir = "#{ENV['HOME']}/vagrant-additional-disk"
unless File.directory?( dir )
Dir.mkdir dir
end

Discoverd Leader Election API

Notes:

  • cannot be used for multiple leaders/quorum
  • races between leader updates in servers/clients should be handled by message queuing and/or retry

Server Patterns

Many uncoordinated active servers (no leaders)

@goozbach
goozbach / gist:7826332
Created December 6, 2013 15:18
hr usage
[2013-12-06:10:18:09 dcarter@hoth ~]
$ hr
---------------------------------------------------------------------------------------------------------------------------
[2013-12-06:10:18:12 dcarter@hoth ~]
$ type hr
hr is aliased to `for i in $(seq 1 $COLUMNS); do echo -n -; done'
@dkubb
dkubb / ssl.nginxconf
Last active April 11, 2019 03:56
Nginx SSL configuration (PFS, HSTS, SPDY, BREACH mitigation, FIPS compliant)
ssl_certificate cert.pem;
ssl_certificate_key cert.key.pem;
ssl_trusted_certificate cert.ca.pem;
ssl_dhparam cert.dh.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers FIPS@STRENGTH:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@wsargent
wsargent / docker_cheat.md
Last active September 23, 2025 16:14
Docker cheat sheet
@plentz
plentz / nginx.conf
Last active October 6, 2025 09:36
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
@HyroVitalyProtago
HyroVitalyProtago / GithubAPI.lua
Last active October 22, 2024 16:15
Github API
-- GithubAPI
-- @Author : Hyro Vitaly Protago
-- @Version : 1.0.0
--[[
INFOS :
- Cannot delete an anonymous gist
]]--
GithubAPI = {
@andrewgross
andrewgross / util.rb
Created July 15, 2013 14:20
Helper functions for safely working with node attribute keys.
def has_nested_key?(key, hash)
hash = hash.to_hash
if has_indeterminate_key?(key, hash)
return true
end
hash.values.each do |v|
if v.is_a?(Hash) && has_nested_key?(key, v)
return true
end
@joerayme
joerayme / LICENSE
Created July 5, 2013 13:33
Very simple Graphite widget for Dashing
Copyright (c) 2013 Couller Ltd. and Joseph Ray
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: