Skip to content

Instantly share code, notes, and snippets.

View omadjoudj's full-sized avatar

Othman Madjoudj (aka Athmane) omadjoudj

View GitHub Profile
@omadjoudj
omadjoudj / tatoeba_audio_download.py
Created June 25, 2023 12:19
tatoeba_audio_download.py
#!/usr/bin/env python
"""
TBD
"""
import logging
import os
import sys
import requests
@omadjoudj
omadjoudj / Victoria-Yoga-diff-flavor_access.py.diff
Created June 2, 2023 10:41
Victoria-Yoga-diff-flavor_access.py.diff
--- a/nova/policies/flavor_access.py
+++ b/nova/policies/flavor_access.py
@@ -25,25 +25,27 @@ POLICY_ROOT = 'os_compute_api:os-flavor-access:%s'
# NOTE(gmann): Deprecating this policy explicitly as old defaults
# admin or owner is not suitable for that which should be admin (Bug#1867840)
# but changing that will break old deployment so let's keep supporting
-# the old default also and new default can be SYSTEM_READER
-# SYSTEM_READER rule in base class is defined with the deprecated rule of admin
+# the old default also and new default can be System Admin.
+# System Admin rule in base class is defined with the deprecated rule of admin
@omadjoudj
omadjoudj / c8-min.ks
Created December 7, 2022 13:23
c8-min.ks
auth --enableshadow --passalgo=sha512
rootpw --plaintext passwd
url --url 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/'
network --bootproto=dhcp --ipv6=auto --hostname=root --activate
firewall --disabled
selinux --permissive
@omadjoudj
omadjoudj / templ.sh
Created October 30, 2022 18:18
templ.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
spec:
nodes:
openstack-gateway-dpdk::enabled:
features:
neutron:
dpdk:
bridges:
- ip_address: 100.64.130.254/25
name: br-phy
driver: mlx5_core
#!/bin/bash
#
# $Id: mussh,v 1.12 2006/12/26 21:57:22 doughnut Exp $
MUSSH_VERSION="1.0"
#
# Description: This script is used to execute the same command(s) on
# many hosts.
#
# by doughnut
#
@omadjoudj
omadjoudj / k8s-nsenter.sh
Created January 27, 2022 09:21
Getting a shell to a Node in K8s
#!/bin/sh
node=${1}
nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}')
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${nodeName:?}'" },'
podName=${USER}-nsenter-${node}
kubectl run ${podName:?} --restart=Never -it --rm --image overriden --overrides '
{
"spec": {
"hostPID": true,
"hostNetwork": true,
@omadjoudj
omadjoudj / create-vm.sh
Created September 13, 2020 14:05
create-vm.sh
virt-install \
-n pharos-m1\
--ram=8000 \
--vcpus=2 \
--disk path=/var/lib/libvirt/images/pharos-m1.qcow2,bus=virtio \
--graphics none \
--network bridge:virbr0,model=virtio \
--import
@omadjoudj
omadjoudj / cluster.yaml
Last active January 10, 2022 12:40
launchpad 3 mgr + 3 workers
apiVersion: launchpad.mirantis.com/mke/v1.4
kind: mke
metadata:
name: my-mke-cluster
spec:
hosts:
- ssh:
address: 172.19.116.185
user: ubuntu
port: 22
@omadjoudj
omadjoudj / qemu-2.8-and2.9-build-failure-patch
Created May 29, 2020 13:58
qemu-2.8-build-failure-patch
diff --git configure configure
index 1c9655e..9f83176 100755
--- configure
+++ configure
@@ -682,6 +682,7 @@ Haiku)
vhost_net="yes"
vhost_scsi="yes"
vhost_vsock="yes"
+ QEMU_CFLAGS="-D_XOPEN_SOURCE=500 $QEMU_CFLAGS"
QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"