Skip to content

Instantly share code, notes, and snippets.

View PedroCavaleiro's full-sized avatar
💭
Powered by Caffeine

Pedro Cavaleiro PedroCavaleiro

💭
Powered by Caffeine
  • Portugal
  • 06:25 (UTC +01:00)
View GitHub Profile
@PedroCavaleiro
PedroCavaleiro / ColoredLineChartRenderer.swift
Created May 25, 2021 16:49
Multi color line (Charts Framework for Swift)
class ColoredLineChartRenderer: LineChartRenderer {
//
// var chartHeight:CGFloat = 0
private var myXBounds = BarLineScatterCandleBubbleRenderer.XBounds()
// added to support the commented "Color Section" code below
// min & maximum visible data geometry coordinate
private var minVisiblePoint = CGPoint.zero
private var maxVisiblePoint = CGPoint.zero
@PedroCavaleiro
PedroCavaleiro / mount-vmdk-linux.md
Last active June 27, 2026 14:23
Mount VMDK on Linux

Read VMDK on Linux

VMDK is a virtual disk file from VMWare, reading without any "special" software is rather useful specially because I didn't want to install VMWare software

It's possible that this works with vhd and vhdx but I didn't test it... If someone does test it let me know

The steps are rather easy

Mounting VMDK

@PedroCavaleiro
PedroCavaleiro / net8_deb_installer.sh
Last active January 21, 2026 18:09
Simple installer for .NET 8 for Debian. This follows the instructions on the MS website, can install the SDK, ASP Core Runtime or the Runtime without ASP support. This only installs the latest .NET 8 so only Debian 12 and 11 are supported
#!/bin/bash
echo -n "Debian Version [12 or 11]: "
read debianversion
echo -n "Install [sdk / asp / core]: "
read installer
wget https://packages.microsoft.com/config/debian/$debianversion/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
@PedroCavaleiro
PedroCavaleiro / debian13upgrade.sh
Last active July 26, 2026 04:21
Debian 13 upgrade script
#!/bin/bash
# A sequence of scripts to safely upgrade from Debian 12 to Debian 13
# This is based of this guide https://linuxconfig.org/how-to-upgrade-debian-to-latest-version
# This script ONLY executes the commands, some commands require user input for confirmations
# EMERGENCY RECOVERY
# If the upgrade fails and your system becomes unbootable, use a Debian 13 live USB to access recovery tools and restore your system from backups or fix package conflicts.
# Run as root (by logging in as root)
@PedroCavaleiro
PedroCavaleiro / install-upload-assistant.sh
Last active June 3, 2026 09:21
Upload Assistant Installer
#!/usr/bin/env bash
# Installs Audionut's fork of Upload Assistant https://github.com/Audionut/Upload-Assistant
# install-upload-assistant.sh
# Must be run as root (sudo or direct root — works in both)
set -euo pipefail
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; CYAN='\033[0;36m'
BOLD='\033[1m'; RESET='\033[0m'