Skip to content

Instantly share code, notes, and snippets.

View matthewoestreich's full-sized avatar
♠️
👋

Matt Oestreich matthewoestreich

♠️
👋
View GitHub Profile
@matthewoestreich
matthewoestreich / xss.php
Last active March 6, 2019 05:29
xss.php
<?php
/**
* run in script directory:
* php -S 127.0.0.1:1337
*/
?>
<?php header('X-XSS-Protection: 0'); ?>
<!DOCTYPE html>
<html>
<head>
@matthewoestreich
matthewoestreich / Get-UserLogonTime.ps1
Last active February 24, 2020 23:54
Useful to find the last computer a user logged into, or their last logon time (NOTE: this is specific to the Domain Controller it is ran on, if you have multiple Domain Controllers you will need to run it on all of them to determine an accurate last logon time!!)
# Run this on a DC
function Get-UserLogonInfo {
param(
[Parameter(Mandatory)]
[string]$Username,
[Parameter()]
[int]$DaysAgo
)
# By default we search within the past 7 days
# MUST BE AN ARRAY OF STRINGS
# EVEN IF YOU HAVE A SINGLE PATH TO ADD, SURROUND IT IN '@( )' IN ORDER TO MAKE IT AN ARRAY
$files = @("C:\testing\SecondFileToAdd.txt")
# MUST BE AN ARRAY OF STRINGS
$folders = @("C:\testing\toAdd", "C:\testing\anotherToAdd")
# PATH TO ZIP FILE
$myZipPath = "C:\testing\zip\Zip.zip"
<template>
<div>
<v-layout row wrap justify-center mb-5>
<v-flex xs10 sm10 md10 lg10>
<v-card ref='map_container' id='map-container'>
<v-card-title class='justify-center'>
<h3>Click Marker For More Info</h3>
</v-card-title>
<div id='map-card' ref='map_card' :style="{ height: mapHeight + 'px' }"></div>
</v-card>
function Get-Connected {
try {
if(-not (Get-Module VMware.PowerCLI)){
Write-Host "You need the PowerCLI module!" -f yellow
Write-Host "We will install it for you, please click 'Yes To All' if prompted!" -f green
Install-Module VMware.PowerCLI -Cofirm:$false -Force
}
if(-not (Get-Module CredentialManager)){
Write-Host "You need the Credential Manager module!" -f yellow
@matthewoestreich
matthewoestreich / VuetifyFullScreenImageGrid.vue
Last active April 3, 2019 15:48
Props: 'shown'[controls visibility by v-model], 'images'[images to display in grid],
<template>
<v-dialog v-model="show" hide-overlay fullscreen transition="dialog-bottom-transition">
<v-card>
<v-card-actions pa-0>
<v-spacer/>
<v-btn dark small color="red" @click="show = false">Close</v-btn>
<v-spacer/>
</v-card-actions>
<v-container pt-0>
<v-layout>
@matthewoestreich
matthewoestreich / vue.config.js
Last active April 10, 2019 01:29
Vue Config Boilerplate
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
configureWebpack: {
entry: ['babel-polyfill', './src/main.js'],
plugins: [
new CopyPlugin([{
from: 'CNAME',
to: 'CNAME',
toType: 'file',
@matthewoestreich
matthewoestreich / mdbvue.import.js
Created April 10, 2019 01:31
Import Material Design Bootstrap Vue
import Vue from 'vue';
import * as mdbVue from 'mdbvue';
import 'bootstrap-css-only/css/bootstrap.min.css';
import 'mdbvue/build/css/mdb.css';
Object.keys(mdbVue).forEach(name => {
Vue.component(name, mdbVue[name]);
});
export default Vue;
@matthewoestreich
matthewoestreich / empty.array.js
Created April 13, 2019 20:23
how to create empty array
[...Array(8 + 1).keys()].slice(1)
// [1,2,3,4,5,6,7,8]
@matthewoestreich
matthewoestreich / express.simple.server.js
Created April 28, 2019 01:33
Simple boilerplate for Express [native logging requires 'chalk']
const express = require('express');
const app = express();
const chalk = require('chalk');
// eslint-disable-next-line no-console
const log = console.log;
const port = 8889;