Skip to content

Instantly share code, notes, and snippets.

View marcolussetti's full-sized avatar

Marco Lussetti marcolussetti

View GitHub Profile
@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)
@marcolussetti
marcolussetti / 50-cloud-init.yaml
Created December 7, 2019 03:36
SoYouStart/OVH Ubuntu 18.04 Networking Config for ESXi
# Stored at /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens160:
@marcolussetti
marcolussetti / .worklog.csv
Last active December 4, 2019 18:23
worklog.py - An extremely simple worklog to CSV tracker with no dependencies (well, besides Python 3).
Date Description Task Difference Processed
20191204 0800:00 This is an example description Example Task False