Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from home

Hervé Beraud 4383

🏡
Working from home
View GitHub Profile
@mbaldessari
mbaldessari / disable-haproxy-backends.sh
Created Sep 18, 2019
Disables other controller haproxy backends on osp ctlplane
View disable-haproxy-backends.sh
#!/bin/bash
set -e
# Before running this script it would be best to disable haproxy on the other nodes
# via: for i in controller-1 controller-2; do pcs resource ban haproxy-bundle $i; done
# To clear the bans: for i in controller-1 controller-2; do pcs resource clear haproxy-bundle $i; done
# Run this script as root on the single controller you want to stay active
CONF="/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg"
HOST=$(hostname)
# Enable admin access to the haproxy stat socket
@zaneb
zaneb / fast8.sh
Created Jun 20, 2019
Run flake8 against only files that have changed
View fast8.sh
#!/bin/bash
set -e
enable_env() {
local env_name="$1"
local env_dir=".tox/${env_name}"
if [ ! -d "${env_dir}" ]; then
if [ ! -f tox.ini ]; then
echo 'No tox.ini found' >&2
View mandatory.md

Basic Idea

The idea is to add another parameter to the function RPCCLient as:

client = oslo_messaging.RPCClient(transport, target, options={'mandatory': True})
client.call({}, 'foo', id_value=str(i), test_value="hello oslo")

Inside the function, _publish decode the option value, as:

View gist:7885b0cd1e4cabd0fa3a3d101a4132c9
export OS_PROJECT_DOMAIN_NAME='Default'
export OS_USER_DOMAIN_NAME='Default'
export OS_PROJECT_NAME='admin'
export OS_USERNAME='admin'
export OS_AUTH_URL=http://192.168.24.2:5000/
export OS_AUTH_TYPE='password'
export OS_IDENTITY_API_VERSION='3'
export OS_PASSWORD=$(sudo hiera -c /etc/puppet/hiera.yaml keystone::admin_password)
@bogdando
bogdando / docker_vs_podman_run.sh
Last active Feb 1, 2019
Comparing the time it takes to launch containers concurrently for docker and podman runtimes
View docker_vs_podman_run.sh
#!/bin/bash
set -e
containers_total=${1:-100}
containers_concur=${2:-10}
container_image=${3:-docker.io/library/busybox}
podman pull $container_image
docker pull $container_image
rm -f bench-jobs.txt
@kenanpelit
kenanpelit / myweechat.md
Created Nov 9, 2016 — forked from pascalpoitras/myweechat.md
My always up-to-date WeeChat configuration (weechat-dev)
View myweechat.md

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@pnc
pnc / observer.md
Last active Nov 18, 2020
Using Erlang observer/appmon remotely
View observer.md

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@willprice
willprice / .travis.yml
Last active Oct 22, 2020
How to set up TravisCI for projects that push back to github
View .travis.yml
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@basilfx
basilfx / tmux-notify.pl
Last active Mar 31, 2018
Irssi and tmux-notify
View tmux-notify.pl
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
use Irssi;
# Script info
$VERSION = '0.1';
%IRSSI = (
authors => 'Bas Stottelaar',
You can’t perform that action at this time.