This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cache layer for expressjs in typescript | |
// Based on https://medium.com/the-node-js-collection/simple-server-side-cache-for-express-js-with-node-js-45ff296ca0f0 | |
// Caches the headers specifically to resolve CORS Errors i was running into with the implementation above. | |
var mcache = require('memory-cache'); | |
let cache = (duration: number) => { | |
return (req: any, res: any, next: any) => { | |
let key = '__express__' + req.originalUrl || req.url | |
let headerkey = key + '-header' | |
let cachedBody = mcache.get(key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Make the python file | |
mkdir -p /usr/share/wififix/ | |
cat >/usr/share/wififix/fix.py <<EOL | |
import subprocess | |
def updatewireless(): | |
edit = False | |
needdisable = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------- Status Cats Error Pages!!! via: https://http.cat/ --------- | |
# | |
# requires that a dns resolver be set for nginx as in: resolver 127.0.0.1; | |
# typically uses dnsmasq for 127.0.0.1 resolver | |
# | |
# Usage: | |
# place this file somewhere accessible to nginx. /etc/nginx/snippets is a decent choice. | |
# then inside the server block(s) you want cat themed error status responses do: | |
# include snippets/http-cat-error-pages.conf | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Blocks USB devices from being used by registering a WMI event, Not entirely secure as base64 encoded secret is stored in WMI | |
Approved devices are by default stored in the root of the C drive should be moved to another directory or registry? | |
#> | |
function Get-Base64 { | |
param($string) | |
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-SCCMClientBusinessHours | |
{ | |
<# | |
.SYNOPSIS | |
Sets the Business Hours of the SCCM client | |
.DESCRIPTION | |
Sets the flag for rebooting inside or outside of business Hours, The Working Days, And the Start end end time in 24 hour format | |
.PARAMETER ComputerName | |
Name of computer to set the configuration on - Default is Localhost | |
.PARAMETER RebootOutsideBusinessHours |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://boxstarter.org/launch/Boxstarter.WebLaunch.Application?noreboot=1&package=https://gist.githubusercontent.com/Darkbat91/89c26989ef6526960306d032ce9a4d7f/raw/ | |
#https://tinyurl.com/WCRYFix | |
<# | |
The MIT License (MIT) | |
Copyright (c) 2016 Warren F. | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-UnobfuscatedData | |
{ | |
param($string) | |
$data = Replacehex -string $string | |
return [System.Text.Encoding]::UTF8.GetString(([System.Convert]::FromBase64String($data)|?{$_})) | |
} | |
function Replacehex { | |
param($string) | |
[regex]$regex ='(\%[A-Fa-f0-9]{2})' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Audits weak service permissions | |
.DESCRIPTION | |
Views Services on computer and return all weak permissions that are present | |
.NOTES | |
Author: Micah | |
Creation Date: 20170329 | |
Last Modified: 20170329 | |
Version: 0.0.1 |