Skip to content

Instantly share code, notes, and snippets.

View hngkr's full-sized avatar

Henning Kristensen hngkr

  • Aarhus, Denmark
View GitHub Profile
@devhero
devhero / envcontext.py
Last active February 12, 2019 20:01
A Python context manager for setting/unsetting environment variables
"""
Context manager for environment variables
Usage:
os.environ['MYVAR'] = 'oldvalue'
with EnvironmentContex(MYVAR='myvalue', MYVAR2='myvalue2'):
print os.getenv('MYVAR') # Should print myvalue.
print os.getenv('MYVAR2') # Should print myvalue2.
@enryold
enryold / storage-efs-mountfilesystem.config
Created January 16, 2017 16:27
EFS mount file system script for Elastic Beanstalk .ebconfig
#
# Replace FILESYSTEM-ID-HERE and REGION-ID-HERE
#
option_settings:
- option_name: EFS_VOLUME_ID
value: FILESYSTEM-ID-HERE
- option_name: EFS_REGION
value: REGION-ID-HERE
@donaldguy
donaldguy / Rockerfile
Created August 15, 2016 18:30
jordan/rundeck + kindlyops oauth2 proxy with roles
#build us a binary for https://github.com/bitly/oauth2_proxy/pull/277
FROM golang
WORKDIR /go/src/github.com/bitly
RUN git clone https://github.com/kindlyops/oauth2_proxy.git
WORKDIR /go/src/github.com/bitly/oauth2_proxy
RUN git checkout github-teams-tweaks
RUN go get
# include patch from https://github.com/bitly/oauth2_proxy/pull/295
RUN curl https://github.com/donaldguy/oauth2_proxy/commit/8965e6b58a3afd8ad9f0f326f91b25253c88d523.patch | git apply --apply -
RUN go build
@RafPe
RafPe / vyos_sample_site-2-site_vpn.sh
Created June 5, 2016 09:31
Vyos sample site-to-site vpn configuration
# Virtual Tunnel Interface
# 172.196.17.188 - 172.196.17.191
set interfaces vti vti0 address 172.196.17.190/30
set interfaces vti vti0 description 'Virtual tunnel interface for VPN tunnel'
# Phase 2
set vpn ipsec esp-group ESP-Default compression 'disable'
set vpn ipsec esp-group ESP-Default lifetime '3600'
set vpn ipsec esp-group ESP-Default mode 'tunnel'
set vpn ipsec esp-group ESP-Default pfs 'dh-group16'
@joefitzgerald
joefitzgerald / win-updates.ps1
Created December 31, 2013 23:18
Install All Windows Updates, Rebooting As Many Times As Required
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=10)
function Check-ContinueRestartOrEnd() {
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$RegistryEntry = "InstallWindowsUpdates"
switch ($global:RestartRequired) {
0 {
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry