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:2115b886b644409c4e28
Last active August 29, 2015 14:01
Configuring a 389-DS server with VNC access

Setting up a 389-DS Server

Installing needed pieces

Assuming you have a RHEL box:

# Subscribe box to get content
@omaciel
omaciel / install_sam_on_ec2.sh
Last active August 29, 2015 14:01
Install SAM from CDN on EC2
subscription-manager register --force --username=$USERNAME --password=$PASSWORD --autosubscribe
yum repolist
yum-config-manager --disable rhui*
yum-config-manager --disable rhel-ha*
yum-config-manager --disable rhel-rs*
yum-config-manager --disable rhel-lb*
yum-config-manager --disable rhel-6-server-cf-tools-1-rpms
yum-config-manager --disable *ose*
yum-config-manager --disable *realtime*
yum-config-manager --disable *rhs*
@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
@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)
@omaciel
omaciel / gist:10059276
Created April 7, 2014 21:20
One-Box Setup Satellite 6 to use libvirt for provisioning
puppet module install -i /tmp domcleal/katellovirt
puppet apply -v -e 'include katellovirt' --modulepath /tmp
export FORWARDERS=$(for i in $(cat /etc/resolv.conf |grep nameserver|awk '{print $2}'); do echo --capsule-dns-forwarders $i;done)
export OAUTH_SECRET=$(grep oauth_consumer_secret /etc/foreman/settings.yaml | cut -d ' ' -f 2)
echo FORWARDERS: $FORWARDERS
echo OAUTH_SECRET: $OAUTH_SECRET
katello-installer --capsule-parent-fqdn $(hostname) --capsule-dns true $FORWARDERS --capsule-dns-interface virbr1 --capsule-dns-zone katellolabs.org --capsule-dhcp true --capsule-dhcp-interface virbr1 --capsule-tftp true --capsule-tftp-servername $(hostname) --capsule-puppet true --capsule-puppetca true --capsule-register-in-foreman true --capsule-foreman-oauth-secret $OAUTH_SECRET --capsule-pulp true --capsule-pulp-oauth-secret $OAUTH_SECRET
import errno
import os
import socket
import sys
import time
from boto import ec2
# -----------------------------------------------------------------------------
# AMI definitions
@omaciel
omaciel / phantom_test.py
Last active August 29, 2015 13:56
Using PhantomJS for quick UI testing using Selenium's WebDriver. There seems to be an exception that is not bubbling up using https... no issues using http. Here's how to resolve it.
In [1]: from selenium import webdriver
In [2]: service_args = ['--ignore-ssl-errors=true']
In [3]: driver = webdriver.PhantomJS(service_args=service_args)
In [4]: driver.get("https://aaa.bbb.ccc")
In [5]: driver.title
Out[5]: u'Login'
@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 / gist:8676791
Created January 28, 2014 21:21
Configuring Katello
subscription-manager register --force [email protected] --password=xxxxxx --autosubscribe
yum repolist
rm -rf /etc/yum.repos.d/beaker-*
rm -rf /etc/yum.repos.d/epel*
rpm -e epel-release-6-8.noarch
rm -rf /var/cache/yum*
yum clean all
yum-config-manager --disable "*"
yum-config-manager --enable "rhel-6-server-rpms"
yum-config-manager --enable "rhel-6-server-optional-rpms"
@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