Skip to content

Instantly share code, notes, and snippets.

@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();
},
@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 / 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
}
}

Keybase proof

I hereby claim:

  • I am theangryangel on github.
  • I am the_angry_angel (https://keybase.io/the_angry_angel) on keybase.
  • I have a public key whose fingerprint is CCEE 2B7B 467E 6FFF 2FD9 A9B1 9C4E 1B64 F7F0 16E5

To claim this, I am signing this object:

import-module ActiveDirectory;
$smtpserver = "server.example.com"
$smtpport = 25
$smtpfrom = "something@example.com"
$maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge
Get-ADUser -filter * -properties PasswordLastSet, PasswordExpired, PasswordNeverExpires, EmailAddress, GivenName | % {
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const css_loaders = [
src = %{
first: %{
buy: [
%{cost: 90.394, supply: 2.245},
%{cost: 90.15, supply: 1.305},
%{cost: 89.394, supply: 4.3}
],
sell: [%{cost: 100.003, supply: 2.4}, %{cost: 100.013, supply: 2.2}]
},
second: %{

Microsoft Teams on Linux under Chrome/Chromium

This will result in working private voice calls, a working meetings and (as far as I can tell) functional chat on Chrome 71.0.3578.98. Screensharing does not seem to work.

  1. Install User Agent Switcher for Chrome,
  2. Import the user-agent-switcher.json in the User Agent Switcher for Chrome Options
  3. Navigiate to chrome://flags and set the following;
  • Hardware Acceleration
  • Override software rendering list: ENABLED
@theangryangel
theangryangel / main.py
Created August 6, 2019 15:09 — forked from mlaitinen/main.py
Odoo 12 Prometheus instrumentation
##############################################################################
#
# Author: Miku Laitinen / Avoin.Systems
# Copyright 2019 Avoin.Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
apiVersion: v1
kind: ConfigMap
metadata:
name: odoo-conf
data:
web: |
[options]
server_wide_modules = web
max_cron_threads = 0