Skip to content

Instantly share code, notes, and snippets.

View omaciel's full-sized avatar
🎯
Learning

Og Maciel omaciel

🎯
Learning
View GitHub Profile
@omaciel
omaciel / gist:11319054
Last active June 8, 2016 17:59
Configure Foreman Smart Proxy with all features baked in
# Figure out what OS version we're running
if uname -r | grep -q el6; then export OS_VERSION=6; else export OS_VERSION=7; fi
# Install libvirt
yum install -y libvirt
if [ $OS_VERSION -eq 6 ]
then
service libvirtd start
chkconfig libvirtd on
@elyezer
elyezer / vagrant-base-box.md
Last active August 29, 2015 13:59
Guide to create a base CentOS/RHEL vagrant box

Create a new VirtualBox machine

  • 512 RAM
  • 40 GB VDI dynamically allocated hard drive
  • Disable audio
  • Disable USB controller

Installing the OS

Load the DVD image and install the system. By convention the root password is vagrant.

@omaciel
omaciel / sprint_report.py
Last active August 29, 2015 13:58
Reports on results for an automation milestone (sprint) for Robottelo
from collections import defaultdict
from functools import partial
import sys
try:
from github import Github
except ImportError:
print "Install PyGithub: sudo pip install PyGithub"
sys.exit(-1)
@elyezer
elyezer / bootstrap.sh
Last active August 29, 2015 13:58
Provision Fedora 20 to run vagrant boxes based on libvirt provider
# Install required packages
sudo yum install @virtualization
sudo systemctl start libvirtd
# Install vagrant
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.5.2_x86_64.rpm
sudo yum install vagrant_1.5.2_x86_64.rpm
vagrant plugin install vagrant-libvirt
# Testing the installation with katello-deploy script
@omaciel
omaciel / generate_data_test.py
Last active August 29, 2015 13:56
Using SingleDispatcher to overload a random data generator.
# -*- coding: utf-8 -*-
import sys
from robottelo.common.helpers import generate_string
try:
from singledispatch import singledispatch
except ImportError:
print "Please install the singledispatcher module"
@omaciel
omaciel / README.rst
Last active January 2, 2016 03:59
An example of using a python MetaClass for Data Driven testing

An example of using python metaclasses to perform data driven tests.

nosetests test_metaclass.py
test_baz_exists (tests.cli.test_foo.TestMetaClass) ... ok
test_greater_than_zero_1 (tests.cli.test_foo.TestMetaClass) ... ok
test_greater_than_zero_2 (tests.cli.test_foo.TestMetaClass) ... ok
test_greater_than_zero_3 (tests.cli.test_foo.TestMetaClass) ... ok
test_greater_than_zero_4 (tests.cli.test_foo.TestMetaClass) ... ok
@omaciel
omaciel / .emacs
Last active February 19, 2016 15:36
Emacs configuration for Python development. Simply drop this file inside your $HOME/.emacs.d directory and enjoy it!
;;; package --- Emacs configuration for Python developement
;;; Commentary:
;;; Code:
;; Disable a couple of menus and startup message
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(setq inhibit-startup-message t)
@omaciel
omaciel / gist:7811339
Last active July 17, 2024 15:26
Proposed Git and Development workflow for Robottelo

How To Contribute

Every open source project lives from the generous help by contributors that sacrifice their time and Robottelo is no different.

To make participation as pleasant as possible, this project adheres to the `Code of Conduct`_ by the Python Software Foundation.

Here are a few hints and rules to get you started:

  • Add yourself to the AUTHORS.rst_ file in an alphabetical fashion.
import argparse
import boto.ec2
import os
import paramiko
import sys
import tempfile
import time
from urllib import urlopen
@omaciel
omaciel / gist:5709991
Last active August 24, 2016 18:40
A simple Katello CLI script to automatically download a product manifest, import it into a Katello organization and create content. It assumes that you have the following information (either as environmental variables or substituted into the script: ``` RHN_USERNAME: A valid username for https://access.redhat.com/ RHN_PASSWORD: A valid password …
#!/bin/bash
function kk() {
KATELLO_PATH=/usr/bin/katello
$KATELLO_PATH -u admin -p admin "$@"
}
ORG='SimpleOrg'
# Orgs