Skip to content

Instantly share code, notes, and snippets.

@beddari
beddari / gist:439de114c2230b4b1f043dff39bb8168
Last active March 22, 2022 11:58 — forked from yuezhu/gist:25e2e43c602a4aa2d1b897bbc47cb0cc
Build Ceph radosgw using Centos 7 container
mkdir -p /root/build
docker run --name centos --hostname centos -it -v /root/build:/root/build centos:7 /bin/bash
# inside centos container
yum install -y epel-release
yum install -y git jq wget cmake3 make gcc-c++ rpm-build rpmdevtools
yum install -y centos-release-scl
yum install -y devtoolset-8
scl enable devtoolset-8 bash
cd /root/build
@beddari
beddari / GNUPG_agent_forwarding.md
Created September 27, 2021 11:22 — forked from TimJDFletcher/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts

@beddari
beddari / hfsc-shape.sh
Created October 7, 2020 11:06 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@beddari
beddari / ansible-role-test.sh
Created March 2, 2020 08:20 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@beddari
beddari / ansible_when_truthy_test.yml
Created March 1, 2019 08:05 — forked from kcd83/ansible_when_truthy_test.yml
Test what vars evalute to true or false in Ansible 2.5
#!/usr/bin/env ansible-playbook
---
- name: Test truthiness
hosts: localhost
gather_facts: False
vars:
truthy_vars:
# TRUE
- True
- 1
@beddari
beddari / recovery.txt
Created May 29, 2018 14:44 — forked from Millnert/recovery.txt
ceph recovery when FUBAR (mem / cpu looping crashing OSDs with OOM)
## Stop all OSDs
## Set OSD nodown
ceph osd set nodown
##Set OSD nobackfill
ceph osd set nobackfill
@beddari
beddari / dict_merge.py
Created October 17, 2017 13:29 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@beddari
beddari / trello-to-newsletter.py
Created March 28, 2017 11:38 — forked from paulmist/trello-to-newsletter.py
Trello to Newsletter builder
"""
Trello to Newsletter builder
This is heavily inspired by: https://changelog.com/trello-as-a-cms/
To install:
pip install click cached_property markdown py-trello
To run:
export TRELLO_APP_KEY=''
@beddari
beddari / websso_federation_setup.sh
Created January 22, 2016 14:14
setup websso environment in one shot, works with google
#!/bin/bash
fqdn=sso-demo.test.ibmcloud.com
user=ibmcloud
# Install the OpenID Connect apache module
# not necessary, but will resolve any config errors when installing the module
sudo apt-get install libjansson4 libhiredis0.10 libcurl3 -y
sudo apt-get install -f -y
# TODO: figure out why v1.8.4 and 1.8.5 won't install

Linux Networking Veth Pair Namespace Sausage Factory

Summary

This is a simple example of namespace networking.

  • Create 4 different namespaces and assign an ip address to each side of the veth pair