Skip to content

Instantly share code, notes, and snippets.

View JacobCallahan's full-sized avatar
🧐
🥓

Jake Callahan JacobCallahan

🧐
🥓
View GitHub Profile
# -*- encoding: utf-8 -*-
"""Genetic algorithm base classes."""
import random
from collections import deque
from itertools import izip
import attr
@attr.s()
class Population(object):
@JacobCallahan
JacobCallahan / gencerts.sh
Last active August 15, 2018 14:28
Satellite certificate generator script
#! /bin/bash
if [ -n "$1" ]; then
name=$1
else
name=$(hostname)
fi
git clone https://github.com/iNecas/ownca.git
cd ownca
yes "" | ./generate-ca.sh
yes | ./generate-crt.sh $name
@JacobCallahan
JacobCallahan / genvirt.py
Last active February 4, 2021 16:27
generate virt-who esx json data
import argparse
import json
import uuid
def gen_json(hypervisors, guests):
virtwho = {}
hypervisor_list = []
for i in range(hypervisors):
guest_list = []
@JacobCallahan
JacobCallahan / buildem.sh
Last active March 1, 2018 19:46
Used to build RHEL 6, 7.2, 7.4 content host images as well as download suse images to be used in Satellite 6 testing.
#!/bin/bash
git clone https://github.com/JacobCallahan/content-host-d.git
cd content-host-d
eho "Building rhel images"
for i in rhel6 rhel7 rhel74; do
git checkout $i
docker build -t ch-d:$i .
done
echo "Downloading sles images"
for i in sles11 sles12 suse; do
@JacobCallahan
JacobCallahan / docker-flood.py
Last active August 19, 2017 17:58
Rapidly deploy as many docker content hosts as you want, without having to worry about taking down old containers.
import argparse
from collections import deque
from time import time
import docker
def rm_container(client, containers):
del_container = containers.popleft()
client.remove_container(del_container['container'], v=True, force=True)
print ('Done with container #{0}'.format(del_container['number']))
Adonna
Agah
Agema
Ahamkara
Aiat
Aksis
Aksor
AlakHul
Alzok
Amytis
@JacobCallahan
JacobCallahan / .bashrc
Last active January 29, 2024 15:21
public
# .bashrc
# If the shell is not running interactively, immediately return. This ensures
# that programs like scp are given a pristine environment.
[[ $- != *i* ]] && return
export TERM=gnome-256color
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
Agema
Tubach
Holborn
Jagi
Warmind
Cayde
Draksis
Wintership
Cryptarch
Ahamkara
@JacobCallahan
JacobCallahan / bash things.txt
Created August 24, 2017 17:48
useful bash commands
1. Rename all files that start with a single _ to start with a single .
find . -type f -name "_[^_]*" -exec rename _ . {} \;
@JacobCallahan
JacobCallahan / chd-setup.yaml
Last active May 20, 2018 20:03
Ansible playbook to setup a RHEL 7.4 docker image. Also provides flood.py script
---
# This playbook will setup a docker-ized content host deployment
# environment on the target system(s).
# After completion, a RHEL 7.4 docker image will be available
# and the git repo will be located at /root/content-host-d
- hosts: beaker
remote_user: root
tasks:
- name: Install Docker
package: name=docker state=latest