Skip to content

Instantly share code, notes, and snippets.

@Informatic
Informatic / README.md
Last active June 20, 2024 14:31
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.

@tsangwpx
tsangwpx / remove_unused_virtualenvs.py
Last active April 10, 2021 13:55
remove_unused_virtualenvs.py
"""
Script to find dangling and probe potential unused virtualenvs
By default, dangling virtualenvs is automatically removed
Potentially unused virtualenvs are shown
"""
import logging
import os
import shutil
import stat