Skip to content

Instantly share code, notes, and snippets.

Mark Maglana relaxdiego

Block or report user

Report or block relaxdiego

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bash_profile
# git completion
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh
# unstaged (*) and staged (+) changes
# export GIT_PS1_SHOWDIRTYSTATE=1
# If something is stashed, then a '$' will be shown next to the branch name
# export GIT_PS1_SHOWSTASHSTATE=1
View stuff.py
class TestSuite:
@patch('real_class_name')
def test_case(self, mock_class):
# Delay the evaluation of Mock() so that we get
# a new mock object for each time the (mocked)
# class constructor is called.
def new_mock_obj(*args, **kwargs):
mock_obj = Mock()
mock_obj.some_function.return_value = 'w00t'
View aviator.yml
demo:
provider: openstack
auth_service:
name: identity
host_uri: http://192.168.42.11:5000
request: create_token
validator: list_tenants
api_version: v3
View gateway_ip_NOT_specified.md

Gateway IP (192.168.10.1) is NOT specified

Host 1

root@host1:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
View gist:8506ee842f70c44ac2f0
kind: List
apiVersion: v1beta3
items:
- kind: ReplicationController
apiVersion: v1beta3
@relaxdiego
relaxdiego / gist:2048332
Created Mar 16, 2012
Installing Release Dashboard to CentOS 5
View gist:2048332
yum update
yum groupinstall ‘Development Tools’
yum install readline-devel zlib zlib-devel openssl-devel perl cpio expat-devel gettext-devel
mkdir src
cd src
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-{date}
@relaxdiego
relaxdiego / gist:2128650
Created Mar 19, 2012
Sample Feature File
View gist:2128650
# All .feature files begin with a feature declaration
# such as the one below. The description is optional
# and can be made up of arbitrary text. Multiple
# paragraphs are also allowed
Feature: Withdraw Cash
This feature allows an account holder to withdraw
cash from an ATM.
# The background lists a set of assumptions that
# will be applied to each scenario and scenario
View 1_create_a_user.feature
Feature: Create a User
Background:
* Clarice is a system administrator
* Dave is an ordinary user
Scenario Outline:
Given <User> is logged in
When she tries to create a user
Then the new user will <Be Created or Not>
View gist:2424861
Scenario Outline: Create a user with certain attributes
Given I am authorized to create users in the system
And a user with username <Username> does not exist in the system
When I create a user with attributes <Username>, <Email>, <Password>, and <Password Confirmation>
Then the user will be <Created or Not>
Examples: Valid User Attributes
| Username | Email | Password | Password Confirmation | Created or Not |
| astark | astark@gmail.com | fkd2350a | fkd2350a | Created |
| astark | astark@gmail.com | ++afd]3b | ++afd]3b | Created |
View gist:2626700
source ~/.git-completion.sh
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NORMAL="\[\033[m\]"
PS1="$GREEN\w$YELLOW\$(__git_ps1)$NORMAL $ "
You can’t perform that action at this time.