Skip to content

Instantly share code, notes, and snippets.

View theangryangel's full-sized avatar
🤡
Focusing

Karl theangryangel

🤡
Focusing
View GitHub Profile
@theangryangel
theangryangel / fix-MS16-072.ps1
Created June 20, 2016 08:00
Add authenticated users with read permissions to address kb3159398/MS16-072
Get-GPO -All | ForEach-Object {
if ('S-1-5-11' -notin ($_ | Get-GPPermission -All).Trustee.Sid.Value) {
$_ | Set-GPPermission -PermissionLevel GpoRead -TargetName 'Authenticated Users' -TargetType Group -Verbose
}
}
@theangryangel
theangryangel / TestController.js
Created March 9, 2013 16:45
Abusing sails' policies to use existing express middleware (ie. express-form)
// api/controllers/TestController.js
var TestController = {
// since the policy will have run, we can now use req.form as "normal"
formtest: function(req, res)
{
if (!req.form.isValid)
{
// Handle errors
@theangryangel
theangryangel / AuthController.js
Created February 28, 2013 21:54
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},