Skip to content

Instantly share code, notes, and snippets.

View omaciel's full-sized avatar
🎯
Learning

Og Maciel omaciel

🎯
Learning
View GitHub Profile
@gpiancastelli
gpiancastelli / goodreads-oauth-example.py
Created August 19, 2010 13:50
A Python example of how to use OAuth on GoodReads
import oauth2 as oauth
import urlparse
url = 'http://www.goodreads.com'
request_token_url = '%s/oauth/request_token/' % url
authorize_url = '%s/oauth/authorize/' % url
access_token_url = '%s/oauth/access_token/' % url
consumer = oauth.Consumer(key='Your-GoodReads-Key',
secret='Your-GoodReads-Secret')
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@omaciel
omaciel / testsnitch.py
Created February 27, 2013 16:49
Generates reports against TCMS Test Plans
#!/usr/bin/env python
import sys
import kerberos
import optparse
try:
from nitrate import *
except ImportError:
print "Please install python-nitrate and try again: https://github.com/psss/python-nitrate"
@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
import argparse
import boto.ec2
import os
import paramiko
import sys
import tempfile
import time
from urllib import urlopen
@omaciel
omaciel / gist:7811339
Last active August 16, 2018 13:07
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.
@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 / 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 / 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"
@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