Skip to content

Instantly share code, notes, and snippets.

View cutwater's full-sized avatar

Alexander Saprykin cutwater

  • Red Hat
  • Krakow, Poland
View GitHub Profile
@cutwater
cutwater / Dockerfile
Last active October 17, 2023 13:37
Django + Poetry Demo Dockerfile
FROM docker.io/library/python:3.11-slim AS base
ARG DEBIAN_FRONTEND=noninteractive
ENV VIRTUAL_ENV=/venv \
PATH="/venv/bin:${PATH}"
RUN set -eux; env apt-get update; \
apt-get install -y --no-install-recommends libpq5; \
rm -rf /var/lib/apt/lists/*
@cutwater
cutwater / pyproject.toml
Created January 5, 2023 11:18
Bug: `poetry install --only-root` deletes installed extras
[tool.poetry]
name = "sample"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
psycopg2 = {version = "^2.9.5", optional = true}
@cutwater
cutwater / example-0.1.0.dist-info__METADATA
Created March 10, 2020 20:32
Poetry: Optional dependencies are built as required in wheel
Metadata-Version: 2.1
Name: example
Version: 0.1.0
Summary:
Author: Example User
Author-email: example@example.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: psycopg2 (>=2.8.4,<3.0.0)
@cutwater
cutwater / policy-controller.yaml
Last active October 17, 2016 15:02
Calico Policy Controller
# Create this manifest using kubectl to deploy
# the Calico policy controller on Kubernetes.
apiVersion: v1
kind: ReplicationController
metadata:
name: calico-policy-controller
namespace: kube-system
labels:
k8s-app: calico-policy
kubernetes.io/cluster-service: "true"
@cutwater
cutwater / yaml_loader.py
Last active July 25, 2016 09:45
YAML metadata loader
import six
import yaml
class YamlMetadata(object):
def __init__(self, mark):
self.mark = mark
@property
def line(self):
@cutwater
cutwater / isolinux__txt.cfg
Last active February 12, 2016 14:50
Ubuntu automated installation
default virtserver
label virtserver
menu label Install ^Virtual Server
kernel /install/vmlinuz
append file=/cdrom/preseed/virtual-server.seed debian-installer/locale=en_US.UTF-8 keyboard-configuration/layoutcode=us vga=788 initrd=/install/initrd.gz quiet --
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet --
label cloud
@cutwater
cutwater / vm-install-template.xml
Created February 1, 2016 21:37
Libvirt KVM templates
<domain type='kvm'>
<name>{{ vm_name }}</name>
<memory>{{ vm_memory_KB }}</memory>
<currentMemory>{{ vm_memory_KB }}</currentMemory>
<vcpu>{{ vm_cpu }}</vcpu>
<os>
<type arch='x86_64'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
@cutwater
cutwater / install-fuel-master.sh
Created January 14, 2016 11:57
Fuel installation scripts
#!/bin/bash
NAME=fuel-master
MEMORY=2048
CPU=1
CPU_TYPE=host
CDROM="/mnt/data/images/_fuel/fuel-current.iso"
#DISK_1="path=/dev/vg0/fuel-master,bus=virtio,format=raw"
#!/bin/bash
VM_NAME="ubuntu-server-14.04.3"
MEMORY=512
VCPU=1
CDROM=/path/to/iso
DKSK=/path/to/disk/image
DISK_FORMAT=qcow2
OS_VARIANT=ubuntutrusty
GRAPHICS=spice
@cutwater
cutwater / local.conf
Created July 25, 2015 11:42
Devstack local.conf file
[[local|localrc]]
ADMIN_PASSWORD=devstack
MYSQL_PASSWORD=devstack
RABBIT_PASSWORD=devstack
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=devstack
# Neutron ML2 with OpenVSwitch
Q_PLUGIN=ml2
Q_AGENT=openvswitch