Skip to content

Instantly share code, notes, and snippets.

View odyssey4me's full-sized avatar

Jesse Pretorius odyssey4me

  • Red Hat
  • United Kingdom
View GitHub Profile
@odyssey4me
odyssey4me / opendevin-install.ps1
Last active April 3, 2024 19:38
OpenDevin on Windows 11 - this no longer works!
#
# Unfortunately, this does not work due to python libraries that do not support windows natively.
# Use a WSL VM instead!
#
# ref: https://github.com/OpenDevin/OpenDevin
# This must all be done from a Powershell Prompt run as Administrator
# install chocolatey (for ease of installing packages)
# https://docs.chocolatey.org/en-us/choco/setup
@odyssey4me
odyssey4me / lvm-cache-fedora.md
Created June 19, 2023 10:23 — forked from gabrieljcs/lvm-cache-fedora.md
Instructions to create an LVM cache for root in Fedora

LVM cache in Fedora

From the man-pages: "The cache logical volume type uses a small and fast LV to improve the performance of a large and slow LV. It does this by storing the frequently used blocks on the faster LV. LVM refers to the small fast LV as a cache pool LV. The large slow LV is called the origin LV. Due to requirements from dm-cache (the kernel driver), LVM further splits the cache pool LV into two devices - the cache data LV and cache metadata LV. The cache data LV is where copies of data blocks are kept from the origin LV to increase speed. The cache metadata LV holds the accounting information that specifies where data blocks are stored (e.g. on the origin LV or on the cache data LV). Users should be familiar with these LVs if they wish to create the best and most robust cached logical volumes. All of these associated LVs must be in the same VG."

Assuming LVM is already setup in HDD (e.g. from anaconda) and SSD is untouched.

Create a physical

---
# Final published location: https://access.redhat.com/solutions/4067471
- name: Rename network interfaces
hosts: all
become: true
vars:
src_prefix: "eth"
dst_prefix: "em"
osnet_conf: "/etc/os-net-config/config.json"
src_interfaces: "{{ ansible_interfaces | select('match', src_prefix ~ '.*') | sort | list }}"
@odyssey4me
odyssey4me / gist:3ce1b4f08bf8ceb34b93590c11d1f91a
Last active December 22, 2023 17:51
Mac OS X: working around brew failing to install a cask due to a protected file in /usr/local/lib/
If you see an error like this:
% brew install macfuse
==> Caveats
macfuse requires a kernel extension to work.
If the installation fails, retry after you enable it in:
System Preferences → Security & Privacy → General
For more information, refer to vendor documentation or this Apple Technical Note:
https://developer.apple.com/library/content/technotes/tn2459/_index.html
@odyssey4me
odyssey4me / 1-system_upgrade-batch_1.sh
Last active March 17, 2021 18:47
Examples of parallelism when running OSP 13->16.1 control plane upgrades
#!/bin/env bash
#
# Run overcloud Operating System upgrade on overcloud node ceph-0,controller-0,database-0,messaging-0,networker-0
#
set -euo pipefail
source /home/stack/stackrc
if [ ! -f .ceph_ran_ceph-0,controller-0,database-0,messaging-0,networker-0 ]; then
@odyssey4me
odyssey4me / yum.conf
Created August 6, 2020 16:37
Optimising yum repo access
# the default is 6h apparently
metadata_expire=24h
# the default is group:primary
mdpolicy=group:all
# this should be the default
retries=10
# no mention is made of what the default is
http_caching=all
@odyssey4me
odyssey4me / virt-install-centos
Created April 23, 2020 16:34 — forked from jnaulty/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@odyssey4me
odyssey4me / lvm-loopback-1.yml
Last active April 20, 2020 16:56
LVM local loopback device setup (RedHat)
- hosts: localhost
connection: local
gather_facts: yes
vars:
volume_path: "/var/lib/lvm-volume1"
volume_size: "100M"
volume_name: "loopback-volumes"
tasks:
- name: Ensure LVM dependencies are installed
package:
@odyssey4me
odyssey4me / applying_patches.sh
Last active March 24, 2020 12:53
TripleO handy notes
# Resetting back to the package state
rm -rf /usr/share/openstack-tripleo-heat-templates; yum reinstall -y openstack-tripleo-heat-templates
# Getting it from gerrit
GERRIT_ID="<num>"; \
FOLDER="openstack-tripleo-heat-templates"; \
curl -4 "https://review.opendev.org/changes/${GERRIT_ID}/revisions/current/patch?download" | \
base64 -d | \
sudo patch -d "/usr/share/${FOLDER}/" -p1
@odyssey4me
odyssey4me / output.log
Created December 14, 2018 14:35
ansible update vs combine
PLAY [localhost] ************************************************************************************************************************************************************
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": ""
}
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": {