Skip to content

Instantly share code, notes, and snippets.

View davidandreoletti's full-sized avatar

David Andreoletti davidandreoletti

View GitHub Profile
@davidandreoletti
davidandreoletti / Dockerfile.aur
Created March 24, 2025 06:32 — forked from gwpl/Dockerfile.aur
AUR in Dockerfile ArchLinux -> pacaur yay non-interactive etc (experiment)
# Making AUR work inside Dockerfile in non interactive way.(experiment)
# Use an official Arch Linux runtime as a parent image
FROM archlinux:latest
# Maintainer
LABEL maintainer="[email protected]"
# Update system and install dependencies (we do not modify this step for docker caching)
RUN pacman -Sy --noconfirm archlinux-keyring && \
pacman-key --init && \
@davidandreoletti
davidandreoletti / #cloud-config.md
Created January 16, 2025 01:58 — forked from dazeb/#cloud-config.md
Cloud-Init functions for Debian 12 - 2024

Debian 12 Bookworm cloud-init configs.

Other Linux flavours may have different configs! Test in dev mode first!

The configs below are all seperated. Pick what you need, theres a sample script at the bottom.

  1. Set Timezone and Locale: Configure the system's timezone and locale to match your geographic location and preferred language settings.
timezone: "Etc/UTC"
@davidandreoletti
davidandreoletti / cubietruck_gpio.md
Created September 22, 2024 06:37 — forked from alextgn63/cubietruck_gpio.md
How to setup and use GPIO ports/pins on a Cubietruck

Setup and use GPIOs on a Cubietruck

Cubietruck is also known as Cubieboard 3

Note: This file documents just what I did, first of all as a note for myself. So this is not primarily intended as a tutorial. Because it still might be helpfull, I uploaded it. The GPIO function is now confirmed to work, tested with my multimeter, but I am still waiting for my jumper cables to arrive, so I can use them securely.

Licensed under a Luna-Will-Cry-If-You-Modify-Or-Redistribute-This 1.0 licence.

@davidandreoletti
davidandreoletti / linux-vms-on-apple-m1-with-networking.md
Created September 16, 2023 14:30 — forked from max-i-mil/linux-vms-on-apple-m1-with-networking.md
Short summary to run Linux VMs on an Apple M1 host using QEMU, libvirt and HVF with a working network setup

Linux Virtual Machines with Private Network on an Apple M1 Device

Background

The aim was to be able to:

  1. Run multiple Linux VMs on an Apple M1/ARM device
  2. Use Apple's HVF for native performance speeds
  3. Configure VMs to allow network access to each other
  4. Configure VMs to allow access to the internet
  5. Not rely on custom modifications of software
@davidandreoletti
davidandreoletti / postgres.md
Created July 20, 2021 07:11 — forked from junqueira/postgres.md
Postgres notes

Database commands in psql

Connect to psql as a non postgres user $ psql -d testdbname - when the os user exists in the db and trusted authentication is enabled.

# create database db2; - create a database
# drop database db2; - drop a database
# \c[onnect] db2 - connect to a database
# \l[ist] - list all databases
# \l+ - list all databases with extra details, including size

@davidandreoletti
davidandreoletti / kvm-qemu.sh
Created April 21, 2019 12:25 — forked from doomedraven/kvm-qemu.sh
Linux - KVM + QEMU installer from sources :)
#!/bin/bash
#
# For latest version please check https://github.com/doomedraven/Tools/blob/master/Virtualization/kvm-qemu.sh
#
# https://www.doomedraven.com/2016/05/kvm.html
# Use Ubuntu 18.04 LTS
@davidandreoletti
davidandreoletti / ffmpeg_opencv.py
Created November 26, 2017 06:25 — forked from eruffaldi/ffmpeg_opencv.py
Feeding Python Opencv with FFmpeg
#
# Reading video from FFMPEG using subprocess - aka when OpenCV VideoCapture fails
#
# 2017 note: I have realized that this is similar to moviepy ffmpeg reader with the difference that here we support YUV encoding
# BUT we lack: bufsize in POpen and creation flags for windows
# https://github.com/Zulko/moviepy/blob/master/moviepy/video/io/ffmpeg_reader.py
#
# Emanuele Ruffaldi 2016
import cv2
import subprocess
@davidandreoletti
davidandreoletti / GenericDelegate.swift
Created September 11, 2017 22:24 — forked from smokyonion/GenericDelegate.swift
Generic Delegate Pattern in Swift 3
public protocol DataSource: class {
associatedtype AbstractType
func source() -> AbstractType
}
class ViewController<T: DataSource>: UIViewController {
weak var dataSouce: T?
typealias AbstractType = T.AbstractType
@davidandreoletti
davidandreoletti / create_install_iso.sh
Created October 20, 2015 07:22
Create OS X El Capitan Installer iso image
#!/bin/sh
INSTALLERIMG="/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg"
OUTDIR="/Users/$(whoami)/Desktop"
FILENAME="Install OS X El Capitan"
TMPIMG="/tmp/ElCapitan.sparseimage"
SOURCEDISK="/Volumes/InstallESD"
TARGETDISK="/Volumes/BaseSystem"