Skip to content

Instantly share code, notes, and snippets.

View omaciel's full-sized avatar
🎯
Learning

Og Maciel omaciel

🎯
Learning
View GitHub Profile
@mattbennett
mattbennett / .coveragerc
Last active March 4, 2020 05:59
coverage subprocess
[run]
branch = True
source = .
cd /etc/pki/ca-trust/source/anchors/
wget http://localhost/pub/katello-server-ca.crt
update-ca-trust enable
update-ca-trust
service docker restart
@omaciel
omaciel / 00-readme.md
Last active January 20, 2025 14:04
Create Host Collection and Activation Keys, associating them as well as adding all available subscriptions to the Activation Key for a scenario where you have enabled and synchronized RHEL 5/6/7 i386, x86_64, ppc64 and s390x repositories.

Instructions

Please update 01-credentials.sh to include your credentials, and run these scripts in the order shown below:

  • 01-credentials.sh
  • 02-os-versions.sh
  • 03-initial-configuration.sh
  • 04-enable-content.sh
  • 05-content-views.sh
@omaciel
omaciel / .gitconfig
Last active August 29, 2015 14:05
My personal .gitconfig
[user]
name = Og B. Maciel
email = <email goes here>
[color]
ui = true
status = auto
diff = auto
branch = auto
interactive = auto
@elyezer
elyezer / vm_provisioning.py
Created August 15, 2014 19:20
Example of VM Provisioning API for Robottelo
# Test body
with VirtualMachine(ram=512, cpu=1, os='rhel7') as vm:
stdout, stderr = vm.command('echo "hellow world"')
vm.ip_addr
vm.hostname
# one vm for a test case
class ClientTestCase(UnitTest):
def setUp(self):
self.vm = VirtualMachine(...)

How to configure a jenkins slave. On the slave setup a jenkins user and add the master SSH public key on the authorized_keys file.

useradd -m jenkins
su - jenkins -c "mkdir /home/jenkins/.ssh"
su - jenkins -c "chmod 700 ~/.ssh"
su - jenkins -c "chmod 600 ~/.ssh/*"
su - jenkins -c "restorecon -R -v ~/.ssh"
su - jenkins -c "vim /home/jenkins/.ssh/authorized_keys"
@omaciel
omaciel / proxy.sh
Last active August 29, 2015 14:04
Configure Satellite to connect to a proxy
# Block non-proxy traffic from your katello server
# The following environment variables must be set:
# SQUID: the FQDN for your proxy
# PROXY_USERNAME: username for squid
# PROXY_PASSWORD: password for your squid username
export ETH=$(ping -c 1 $(hostname) | grep 'icmp_seq' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}')
export PROXY=$(ping -c 1 $SQUID | grep 'icmp_seq' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}')
@omaciel
omaciel / gist:3d0bd0a5dc15211007a5
Created May 27, 2014 14:43
Locally running UI tests from Robottelo using Sauce Labs

Step 1

Sauce Connect is a secure tunneling app which allows you to execute tests securely when testing behind firewalls via a secure connection between Sauce Labs’ client cloud and your environment.

Download the version of Sauce Connect that corresponds to your guest's platform. For some reason Sauce Connect v4 never worked for me, so I use Sauce Connect v3 instead.

Step 2

After unpacking Sauce Connect, cd to its directory and start it up using your SauceLabs credentials:

import logging
import grequests as async
import requests
import json as js
prefix = "large_new_compose"
def request_json(prefix, i):
return js.dumps({
"organization_id": 1,
# First Add these iptable rules to /etc/sysconfig/iptables
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 636 -j ACCEPT
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 9830 -j ACCEPT
service iptables restart
yum install -y 389-ds openldap-clients
useradd dsuser
setup-ds-admin.pl
#^ this command will ask you lots of questions, I loosely based my answers on http://www.unixmen.com/setup-directory-serverldap-in-centos-6-4-rhel-6-4/