Skip to content

Instantly share code, notes, and snippets.

View 4383's full-sized avatar
🏝️
Vacation

Hervé Beraud 4383

🏝️
Vacation
View GitHub Profile
@4383
4383 / 0001-Introducing-usage-of-pre-commit.patch
Last active September 3, 2020 08:00
pre-commit git patch
From 6eb68519a9e917169e7285df14c7ea20d0ff58a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Beraud?= <hberaud@redhat.com>
Date: Tue, 7 Jul 2020 11:33:55 +0200
Subject: [PATCH] Introducing usage of pre-commit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adding pre-commit
@4383
4383 / log.txt
Created July 31, 2020 14:26
oslo-cookiecutter
│13:22:49 hberaud | smcginnis, fungi: o/ any idea what's the problem here or how to identify him? => https://review.opendev.org/#/c/743972/1
│13:23:39 hberaud | CI logs are not really verbose so we can't find the issue, and locally everything works fine.
│14:23:46 smcginnis | hberaud: tox isn't in the default PATH, so https://opendev.org/openstack/oslo-cookiecutter/src/branch/master/tools/test_tox_targets.sh#L33
│ | fails to find it.
│14:24:11 smcginnis | I think that script needs to be updated to take the environment variable that gets set, or else the zuul configuration needs to add tox to
@4383
4383 / isort.sh
Created July 1, 2020 10:17
sort your imports
$ isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 -rc openstack
@4383
4383 / bash.sh
Created June 23, 2020 12:06
bashismes
!$ # last used path
$@ # positional parameters
# https://mywiki.wooledge.org/Bashism
@4383
4383 / debug.md
Last active June 5, 2020 14:02
tox debug

Run only a specific test with tox:

$ tox -e py38 -- oslo_service.tests.test_wsgi.TestWSGIServerWithSSL.test_ssl_server

Run command in a virtualenv managed by tox:

$ tox -e venv -- <command>
@4383
4383 / identitying.md
Created April 30, 2020 15:15
identifying linux distro
/etc/os-release
@4383
4383 / network-partitionning.md
Created April 17, 2020 12:01
network partitionning
grep 'ovs-vswitchd.service: Main process exited, code=killed, status=11/SEGV' controller-*/var/log/messages
@4383
4383 / check.md
Last active April 15, 2020 17:23
Check the number of error that happened in a cluster

This logs all errors recorded by the cluster by using crm_mon

$ crm_mon --as-xml | xmllint --xpath 'count(//failures/failure)' -

This one dumps current fail count per resource and per operation by using cibadmin

$ cibadmin -Q | grep fail-count
@4383
4383 / .tmux.conf
Created April 8, 2020 16:16
Switch tmux prefix from C-b to C-a,
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
@4383
4383 / infrared.sh
Created April 6, 2020 12:03
To know what infrared will think is the latest puddle, you run
rhos-release -t /tmp 16-trunk && cat /tmp/latest-installed