Skip to content

Instantly share code, notes, and snippets.

View marcolussetti's full-sized avatar

Marco Lussetti marcolussetti

View GitHub Profile
@marcolussetti
marcolussetti / user-machine-login-history.sql
Created November 22, 2024 22:23
Get users <-> machine login history in MECM 2403
SELECT DISTINCT
UPPER(COALESCE(SCU.SystemConsoleUser0, UMR.UniqueUserName)) as Username,
SYS.Name0 as Machine,
COALESCE(
SCU.LastConsoleUse0,
UMR.CreationTime
) as Time_Last_Logged_On_Machine
FROM
v_R_System SYS
LEFT JOIN v_GS_SYSTEM_CONSOLE_USER SCU ON
@marcolussetti
marcolussetti / create-all-jira-issues.sh
Last active October 22, 2024 17:46
Create issues in Jira with bash from a Json file
#!/bin/bash
# Read through this first please
# First set some variables
echo "Enter username:"
read username
echo "Enter password:"
@marcolussetti
marcolussetti / amex-rewards.js
Last active February 5, 2024 07:10
American Express Points Rate Calculator
// Amex Rewards Points Rate Calculator
// by Marco Lussetti
// 1. Navigate to https://global.americanexpress.com/rewards/summary
// 2. Choose the month you need to run it on
// 3. Open your Browser Console
// 4. Paste the contents below
// 5. Wait for the script to run (it will keep clicking show more every 0.75s until
// it loaded the entire statement)
@marcolussetti
marcolussetti / goaccess-haproxy.sh
Created January 31, 2024 16:51
Parse Haproxy Logs with GoAccess
#!/bin/bash
# Takes a set of haproxy logs, and parses them in GoAccess
# By Marco Lussetti
# Some caveats:
# 1. This uses GoAccess in a container
# 2. HAProxy works off frontends and backends, not the usual format GoAccess expects, so:
# 2a. Frontends are logged as "Remote User (HTTP authentication)"
# 2b. Backends are logged as "Virtual Hosts"
zcat --force haproxy.log* | docker run --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format='%^]%^ %h:%^ [%d:%t.%^] %e %v/%R/%^/%^/%L/%^ %s %b %^"%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' - > report.html
@marcolussetti
marcolussetti / ConfigureRemotingForAnsible.ps1
Created November 30, 2023 16:59
ConfigureRemotingForAnsible.ps1 copy
#!powershell
#Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerShell commands.
#
@marcolussetti
marcolussetti / shell-setup.ps1
Last active July 18, 2023 16:37 — forked from mikepruett3/shell-setup.ps1
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@marcolussetti
marcolussetti / trip1.json
Created June 13, 2023 06:05
Test files for maffeo
{
"title": "A Trip to Scotland",
"itinerary": [
{
"date": "2012-04-21",
"locations": ["Vienna, Austria"],
"events": [
{
"title": "Visit the Hofburg Palace",
"startTime": "2012-04-21T08:00:00.000Z",
@marcolussetti
marcolussetti / cors-anywhere-setup.sh
Last active March 25, 2024 03:16
Setup your own cors-anywhere proxy (Ubuntu, using Let's Encrypt)
#!/bin/bash
# Use sudo plz
# CONFIGURATION, EDIT PLEASE
ALLOWED_DOMAINS=https://localhost:5000
CORS_DOMAIN=cors.example.com
# Install dependencies
apt install npm
@marcolussetti
marcolussetti / PickGame.svelte
Created October 10, 2020 05:19
Pick a game
<script>
import { onMount } from 'svelte';
const games = [
// Streamed via Discord
// Jackbox 4
"Fibbage 3 (2-8) - Jackbox 4 - (later)",
"Fibbage Enough about You (2-8) - Jackbox 4 - (later)",
"Survive the Internet (3-8) - Jackbox 4 - (earlier)",
"Monster Seeking Monster (3-7) - Jackbox 4 - (earlier)",
@marcolussetti
marcolussetti / test_winrm.ps1
Created December 30, 2019 23:37
Test WinRM's basic Auth
Enter-PSSession -ComputerName <HOST> -UseSSL -port 5986 -Authentication Basic -Credential (New-Object System.Management.Automation.PSCredential("Administrator", (ConvertTo-SecureString "<PASSWORD>" -AsPlainText -Force))) -SessionOption (New-PSSessionOption -SkipCACheck)