Skip to content

Instantly share code, notes, and snippets.

View cloudnull's full-sized avatar
👨‍🚒
Yup

Kevin Carter cloudnull

👨‍🚒
Yup
View GitHub Profile
@cloudnull
cloudnull / install-macos-keystone.sh
Created July 7, 2024 15:25
Install openstack keystone on OSX
# This simple setup fixes the following error on MacOS.
#
# scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
# #include <openssl/aes.h>
# ^~~~~~~~~~~~~~~
# 1 error generated.
# error: command '/usr/bin/clang' failed with exit code 1
# [end of output]
#
# note: This error originates from a subprocess, and is likely not a problem with pip.
@cloudnull
cloudnull / flake.nix
Created April 6, 2024 06:16 — forked from voidus/flake.nix
Build a cloudinit image in nixos
{
description = "A nixos cloudinit base image without nixos-infect";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@cloudnull
cloudnull / rke1-openstack.sh
Last active November 24, 2023 21:04
RKE1 OpenStack
alias os='openstack --os-cloud rxt-mvp '
os network create osh1
os subnet create \
osh1-subnet \
--network osh1 \
--subnet-range 172.31.0.0/28 \
--dns-nameserver 8.8.8.8
@cloudnull
cloudnull / ara.bash
Last active March 2, 2023 12:49
Using the ARA CLI Client, return unique hosts where a task is found and in a defined state.
function ara-task-uniq-hosts () {
# Scans across all tasks within 1 million records and returns all of the unique hosts where the task
# meets a certain state. Default state is "ok"
# When looking for the "changed" state the special CLI modifier is used.
TASK_NAME=$1
TASK_STATE=${2:-ok}
if [ ${TASK_STATE} == "changed" ]; then
TASK_MODIFY="--changed"
else
TASK_MODIFY="--status ${TASK_STATE}"
@cloudnull
cloudnull / fig-up.rc
Last active August 4, 2023 15:58
compose omnibus protocol shell
function fig-up () {
function get_latest_release() {
curl $(curl --silent "https://api.github.com/repos/ovrclk/cosmos-omnibus/releases/latest" | jq ".url" -r) | jq -r .tag_name
}
function get_rpc_endpoint() {
curl --silent "https://cdn.jsdelivr.net/gh/cosmos/chain-registry@master/$1/chain.json" | jq ".apis.rpc[0].address" -r
}
if ! command -v jq &> /dev/null; then
@cloudnull
cloudnull / teleport-update-playbook.yml
Created November 10, 2022 14:28
Teleport upgrade playbook
# This playbook is used to upgrade teleport in place, it will deploy the apt repo using facts.
#
# Invocation,
# $ ansible-playbook -i ~/projects/teleport-inventory.py ~/projects/teleport-playbook.yml -e ansible_user=debian --limit '!teleport-server'
#
# NOTE: This playbook book exectuion is using dynamic inventory and a limit which is ensuring that the playbook is not executed against
# the teleport server. The playbook can be used on the teleport server, it just has to be done in isolation; a restart of the server
# will impact client connectivity.
---
- name: Teleport updates
import collections
import json
import re
import sys
GROUPS = dict()
HOSTS = dict()
PROTOS = dict()
R_WORDS = re.compile(r"\w+")
@cloudnull
cloudnull / gist:c17c210f86364ba561b5848bd7d70fe3
Created October 28, 2022 17:15
Installing Nvidia's proprietary drivers from source
cat > /etc/modprobe.d/blacklist-nouveau.conf <<EOF
blacklist nouveau
options nouveau modeset=0
EOF
apt update
apt install -y wget linux-headers-$(uname -r) build-essential libglvnd-dev pkg-config dkms
DOWNLOAD_URL="https://us.download.nvidia.com/XFree86/Linux-x86_64/515.76/NVIDIA-Linux-x86_64-515.76.run"
# Required config
# $ export ANSIBLE_SCP_IF_SSH=False
# $ export ANSIBLE_SSH_ARGS="-F /home/USERNAME/.ssh/teleport.cfg"
# $ export ANSIBLE_INVENTORY_ENABLED=yaml
# $ export ANSIBLE_HOST_KEY_CHECKING=false
---
- hosts: all
gather_facts: true
become: true
@cloudnull
cloudnull / teleport-inventory.py
Last active September 30, 2022 03:07
A simple dynamic Ansible inventory which uses node (server) information from teleport.
#!/usr/bin/env python3
"""Teleport Inventory Documentation.
Very simple inventory script which will use teleport as a dynamic inventory source.
The script assumes you've logged in and have access to the teleport service.
The script will read machines and return JSON information from teleport. Once the
return information is sourced, it will format the inventory using the node name
as the target host and the labels as hostvars and groups.