Skip to content

Instantly share code, notes, and snippets.

View VincenzoLaSpesa's full-sized avatar
👀
Working on my side projects in my spare time. With no spare time

Vincenzo La Spesa VincenzoLaSpesa

👀
Working on my side projects in my spare time. With no spare time
  • Praha
View GitHub Profile
@VincenzoLaSpesa
VincenzoLaSpesa / fosdem_events_to_vcards.py
Created January 25, 2026 12:02
generate a VCARD calendar out of the events exported from https://fosdem.sojourner.rocks/2026/
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Filename: fosdem_events_to_vcards.py
Author: Vincenzo La Spesa
Date: 2026-01-25
Version: 1.0
Description:
This script allows to make a VCARD calendar out of the events exported from https://fosdem.sojourner.rocks/2026/
as a CSV.
@VincenzoLaSpesa
VincenzoLaSpesa / SplitTextIntoParagraphs.cs
Created April 16, 2024 15:31
Split a long string in paragraph breaking on spaces
/// <summary>
/// Splits a long text into paragraph with a limit on the characters
/// </summary>
/// <param name="text"></param>
/// <param name="maxCharPerParagraph"></param>
/// <returns></returns>
public static List<string> SplitTextIntoParagraphs(string text, int maxCharPerParagraph)
{
List<string> paragraphs = new List<string>();
int offset = 0;
@VincenzoLaSpesa
VincenzoLaSpesa / install_me.sh
Last active April 7, 2023 13:14
Linux base setup
# some stuff i install every time
sudo apt update
sudo apt upgrade
sudo apt install autoconf automake autotools-dev bubblewrap build-essential cmake curl docker.io python3 strace python3-pip
sudo apt install ffmpeg git mc ncurses-base ncurses-bin ncurses-term ninja-build nmap p7zip-full valgrind zsh tmux ne
sudo pip install conan
sudo pip install meson
conan profile detect
@VincenzoLaSpesa
VincenzoLaSpesa / TinyLogger.hpp
Created October 29, 2022 09:14
A tiny headers-only logging class
#pragma once
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <mutex>
#include <chrono>
#include <ctime>
@VincenzoLaSpesa
VincenzoLaSpesa / create_slideshow_video.py
Created October 7, 2022 10:48
Merge images to a slideshow saved as a video, in python
from moviepy.editor import *
from pathlib import Path
from subprocess import check_output
import os
import argparse
import json
def run(cmd, echo=True, shell=True, printOutput = True) -> str:
@VincenzoLaSpesa
VincenzoLaSpesa / esempi.sql
Created August 26, 2022 20:42
Varie query fatte ai tempi per preparare l'esame
--1 citta con un aereoporto di cui non si conosce il numero di piste
SELECT citta FROM esercizio.aeroporto WHERE numpiste=0;
--2 nazioni da cui parte e arriva il volo x
SELECT cittapart, cittaarr FROM esercizio.volo WHERE idvolo=2
--3 tipi di aerei che partono da torino
SELECT tipoaereo FROM esercizio.aereo WHERE tipoaereo IN(
SELECT tipoaereo FROM esercizio.volo WHERE cittapart='Torino'
);
--4 tipo aereo e numero passegeri per i voli che partono da Arcore
SELECT tipoaereo, numpasseggeri FROM esercizio.aereo WHERE tipoaereo IN(
@VincenzoLaSpesa
VincenzoLaSpesa / ForceTags.py
Created April 6, 2022 21:10
uses a json file to fix the tags for audiobooks
'''
Takes all the mp3 in the current directory, replace all the id3 tags inside
using the file name as title and the info in tags.json for almbum and artist
generates the track number from the position in the file list.
It also generates a playlist with the entire folder.
I use it for audiobooks.
The tags.json file is something like:
{
"album" : "name of the album",
@VincenzoLaSpesa
VincenzoLaSpesa / shell_packer.py
Created January 20, 2022 09:59
A small script for packing or unpacking single file packages made of a sh script and a tgz payload
from subprocess import check_output
import argparse
import pprint
import os
import mmap
def run(cmd, echo=True, shell=True, printOutput = True) -> str:
""" Runs a command, returns the output """
if echo:
@VincenzoLaSpesa
VincenzoLaSpesa / toolchain.cmake
Created November 17, 2021 13:03
CMake Toolchain for crossbuilding to WindowsCE+Arm from linux
set(CMAKE_SYSTEM_NAME WindowsCE)
set(CMAKE_SYSTEM_VERSION 8.0)
set(CMAKE_SYSTEM_PROCESSOR arm)
#set(CMAKE_GENERATOR_TOOLSET CE800) # Can be omitted for 8.0
#set(CMAKE_GENERATOR_PLATFORM SDK_AM335X_SK_WEC2013_V310)
set(base /usr/local/mingw32ce)
set(CMAKE_SYSROOT {base})
@VincenzoLaSpesa
VincenzoLaSpesa / poorManProfiler.py
Last active October 7, 2021 10:22
A quick&dirty way for logging the cpu and memory usage of a specific project. Probably cross platform
import pprint
import psutil
import time
import csv
import argparse
import os
class Writer:
stream=None
writer=None