Skip to content

Instantly share code, notes, and snippets.

View MarcoBuster's full-sized avatar

Marco Aceti MarcoBuster

View GitHub Profile
@MarcoBuster
MarcoBuster / amplix.py
Last active September 7, 2022 10:27
Simple AMPL wrapper for Operating Research
#!/usr/bin/python3
import subprocess
import argparse
import re
SOLVERS = [
"cplex",
"minos",
"snopt",

Keybase proof

I hereby claim:

  • I am MarcoBuster on github.
  • I am marcobuster (https://keybase.io/marcobuster) on keybase.
  • I have a public key whose fingerprint is 00B0 026F 65CF DE48 F95E 2BF1 2371 A2D6 4C58 1B16

To claim this, I am signing this object:

PosteID OTP

Scopi

Lo SPID è uno strumento utile per poter autenticarsi a tutti i servizi della Pubblica Amministrazione, senza dover rinunciare alla sicurezza. Difatti, tutti i provider SPID devono implementare la MFA (Multi-Factor Authentication) per l'autenticazione di livello 2 e superiori.

Poste Italiane è un provider SPID e implementa la MFA con due modalità:

  • via SMS
  • via applicazione proprietaria "PosteID"

Trovo la verifica SMS anacronistica, quindi ho sempre utilizzato l'applicazione ufficiale per autenticarmi. L'applicazione è però lenta, bloat, contiene 2 traccianti (Google Crashlytics e Google Firebase Analytics) e chiede svariati permessi inutili.

@MarcoBuster
MarcoBuster / righ2param.py
Last active March 15, 2024 11:17
Converti le tabelle testuali del corso di Ricerca Operativa del Professore Righini in parametri MathProg
import argparse
TAB_SIZE = 1
parser = argparse.ArgumentParser(
description="Converti le tabelle testuali del corso di Ricerca Operativa del Professore Righini in parametri MathProg",
)
parser.add_argument(
"name",
metavar="name",
@MarcoBuster
MarcoBuster / encrypted-backup-to-telegram.py
Last active February 20, 2021 21:25
Encrypt then backup to Telegram. Used to backup mailcow and other things
import os
import glob
from telethon.sync import TelegramClient
BACKUP_FOLDER="/your/backups/path"
KEY_FILE = "/your/key/path.txt" # echo "yourpassword" > key.txt
API_ID = 12345 # Telegram API ID (https://my.telegram.org)
API_HASH = "qwertyuiopasdfghjklzxcvbnm" # Telegram API hash (https://my.telegram.org)
BOT_TOKEN = "123456789:qwertyuiopasdfghjklzxcvbnmqwertyuiop" # Telegram bot token (@BotFather)
DEST_ID = -1001234567890 # Destination chat ID (hint: use a private channel)
@MarcoBuster
MarcoBuster / SARS-Cov-2 vaccine.txt
Last active June 6, 2021 14:35
BioNTech/Pfizer SARS-Cov-2 vaccine source code
GAGAAΨAAAC ΨAGΨAΨΨCΨΨ CΨGGΨCCCCA CAGACΨCAGA GAGAACCCGC 50
CACCAΨGΨΨC GΨGΨΨCCΨGG ΨGCΨGCΨGCC ΨCΨGGΨGΨCC AGCCAGΨGΨG 100
ΨGAACCΨGAC CACCAGAACA CAGCΨGCCΨC CAGCCΨACAC CAACAGCΨΨΨ 150
ACCAGAGGCG ΨGΨACΨACCC CGACAAGGΨG ΨΨCAGAΨCCA GCGΨGCΨGCA 200
CΨCΨACCCAG GACCΨGΨΨCC ΨGCCΨΨΨCΨΨ CAGCAACGΨG ACCΨGGΨΨCC 250
ACGCCAΨCCA CGΨGΨCCGGC ACCAAΨGGCA CCAAGAGAΨΨ CGACAACCCC 300
GΨGCΨGCCCΨ ΨCAACGACGG GGΨGΨACΨΨΨ GCCAGCACCG AGAAGΨCCAA 350
CAΨCAΨCAGA GGCΨGGAΨCΨ ΨCGGCACCAC ACΨGGACAGC AAGACCCAGA 400
GCCΨGCΨGAΨ CGΨGAACAAC GCCACCAACG ΨGGΨCAΨCAA AGΨGΨGCGAG 450
ΨΨCCAGΨΨCΨ GCAACGACCC CΨΨCCΨGGGC GΨCΨACΨACC ACAAGAACAA 500
@MarcoBuster
MarcoBuster / AoC2020-day07_1-graph.go
Created December 7, 2020 09:50
(Bonus) alternative solution for the first part of AoC2020 day 7
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@MarcoBuster
MarcoBuster / analyze.py
Last active September 14, 2020 17:13
Reddit posts per second calculator
import csv
from datetime import datetime
import praw
import base36
import plotly # plotly==2.0.8, latest version without the bullshit
import plotly.graph_objs as go
import plotly.plotly as py
from config import PLOTLY_USERNAME, PLOTLY_APIKEY, CLIENT_ID, CLIENT_SECRET, TARGET
@MarcoBuster
MarcoBuster / tgdockerbackup.sh
Created June 13, 2020 10:58
Docker redis and postgres backup via Telegram
#!/bin/bash
FILENAME="history/$(date +%Y-%m-%d"_"%H-%M-%s)".tar.gz
backup_redis () {
/usr/bin/docker cp $1:/data/dump.rdb latest/$1.rdb
}
backup_postgres () {
/usr/bin/docker exec -t $1 pg_dumpall -c -U postgres > latest/$1.sql
@MarcoBuster
MarcoBuster / CisiaDatesScraper.py
Last active May 4, 2020 15:22
Script per inviare una notifica su Telegram quando vengono pubblicate delle nuove date per gli esami TOLC CISIA
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit