Skip to content

Instantly share code, notes, and snippets.

View nightfly19's full-sized avatar

Sage Imel nightfly19

  • Portland State University
  • Portland, Oregon
View GitHub Profile
$cert_path = $::osfamily ? {
'RedHat' => '/etc/pki/tls/certs/cas.pem',
default => fail("osfamily ${osfamily} not supported"),
}
@nightfly19
nightfly19 / gist:7096306
Created October 22, 2013 07:02
Nginx proxying node
upstream node_daemon {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name realhost;
location / {
proxy_pass http://node_daemon;
:hierarchy:
- 'fqdn/%{fqdn}'
- 'modules/%{module_name}'
- 'global'
:logger: 'console'
:yaml:
:datadir: '/var/lib/hiera'
:backends:
- 'file'
- 'yaml'
@nightfly19
nightfly19 / gist:6820352
Created October 4, 2013 03:04
reload-file.js
module.exports = function(module){
try{
delete require.cache[require.resolve(module)];
}
catch(err){
console.log(err);
}
//console.log(require.cache);
return require(module);
};
app.get(
'/secure',
//What middleware to use here to see if I've already authenticated?
passport.authorize('ldap', { failureFlash: true }),
function(req, res){
res.render('index', {
pageTitle:'something here',
body:'cows mooooo'
});
}
@nightfly19
nightfly19 / gist:6216990
Created August 13, 2013 01:22
imapsync stats
++++ Statistics
Transfer started on : Mon Aug 12 18:14:40 2013
Transfer ended on : Mon Aug 12 18:20:19 2013
Transfer time : 338.7 sec
Messages transferred : 543
Messages skipped : 0
Messages found duplicate on host1 : 0
Messages found duplicate on host2 : 0
Messages void (noheader) on host1 : 0
Messages void (noheader) on host2 : 0
$groups = ['adm', 'plugdev']
$user = 'foo'
$users = [$user]
# method 1
user { $user:
groups => $groups,
}
@nightfly19
nightfly19 / gist:5675032
Last active December 17, 2015 21:29
The variable names in global.yaml are being expanded when the template is expanded. Not sure where I need to escape something
#global.yaml
'puppet::hiera::backends': - file
- yaml
'puppet::hiera::logger': console
'puppet::hiera::hierarchy': - '%{::environment}/fqdn/%{::fqdn}'
- 'fqdn/%{::fqdn}'
- '%{::environment}'
- global
@nightfly19
nightfly19 / hiera.yaml
Last active December 17, 2015 12:39 — forked from jamescarr/hiera.yaml
---
:backends: - file
- yaml
:logger: console
:hierarchy: - %{::environment}/fqdn/%{::fqdn}
- fqdn/%{::fqdn}
- %{::environment}
- global