Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub 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
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'
demo:
provider: openstack
auth_service:
name: identity
host_uri: http://192.168.42.11:5000
request: create_token
validator: list_tenants
api_version: v3

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
kind: List
apiVersion: v1beta3
items:
- kind: ReplicationController
apiVersion: v1beta3
@relaxdiego
relaxdiego / gist:2048332
Created March 16, 2012 03:20
Installing Release Dashboard to CentOS 5
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 March 19, 2012 23:57
Sample Feature File
# 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
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>
@relaxdiego
relaxdiego / gist:2424861
Created April 19, 2012 23:35
Reasons...
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 |
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 $ "